Action return values,
was Re: Macro: Using captured strings (from a replace) in
subsequent code?
Tony Balinski
ajbj at free.fr
Tue Jan 9 13:40:29 CET 2007
Quoting Joerg Fischer <jf505 at gmx.de>:
> Tony Balinski wrote:
>
> > Joerg's suggestion of having a subexpression array is an excellent one,
>
> Well, it was Joachim's suggestion.
Oops! Sorry.
...
>
> Another limitation, well-known and unfortunately not so obvious to
> solve, is the fact that _actions_ can't have return values, can't
> even tell you whether they've succeeded or not. Okay, on failure
> some of them can beep, but then, you know, my macro can't hear the
> beep and act accordingly, so one is at a loss already even if one
> just tries to do very simple things. But for this topic, I need to
> change the subject line...
>
> (If actions can't return values, couldn't we have at least a global
> variable like $last_action_succeeded yes or no?)
>
> Cheers,
> Jörg
A very good point. I think, going forward, we should implement a lot
of actions (if not all) as macro routines, then implement the actions
(necessary for X resources etc) in terms of these macro routines.
(I would also suggest breaking up macros.c "thematically" - it's
much too big - and change the macro routine-name/func-pointer
associations into (an) array(s) of name/pointer pair structs rather
than have the current, clumsy array of names/array of pointers set-up
where the ordering of corresponding entries is less than obvious in
the source code. (Dream on...)
Tony
More information about the Discuss
mailing list