view tools/foreach.m4 @ 271:c990a9a9648f

Fix bug of calculator. - calc can not handle button press event. - It caused by miss-understanding event_t::cur_tgt. It is a subject, not a shape that calc think. - event_t::cur_tgt::obj is a shape that calc want. It is a the subject that the subject stands for.
author Thinker K.F. Li <thinker@branda.to>
date Sun, 25 Jan 2009 23:03:18 +0800
parents f4b792afa74e
children
line wrap: on
line source

divert([-1])

define([_arg1], [$1])

define([_foreach], [ifelse([$2], [()], [],
[define([$1], _arg1$2)$3[]_foreach([$1], (shift$2), [$3])])])

define([foreach], [pushdef([$1])_foreach($@)popdef([$1])])

divert[]dnl