[Omake] Function that modifies the environment and returns a value

Alain Frisch alain.frisch at lexifi.com
Wed Nov 28 08:54:30 PST 2007


Hello,

It seems that a function can modify the environment of its caller, as 
demonstrated by the following script which prints "a":

FILES=
f(file) =
   FILES += $(file)
   export FILES
f(a)
echo $(FILES)

If I add a return statement before or after the export statement, the 
update on FILES is not visible outside the function.

Is it possible to write a function which modifies the environment of its 
caller and returns a value at the same time?


   Alain



More information about the Omake mailing list