[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: expand text using locals
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Wed, 13 May 2009 19:32:51 -0300
> Is there a way to write an expand function that make use of the local variables (not global)?
>
> function do_stuff (p1)
> print(expand'$(p1+1)')
> end
>
> do_stuff(1)
> --> 2
You could use the debug library for that, though its use for ordinary
programming is not recommended. If you have control over do_stuff, then
you could created a table with the values of the locals before calling
expand and pass it to expand.