[Omake] closure/objects bug?

Erick Tryzelaar erickt at dslextreme.com
Sun Jan 28 19:47:05 PST 2007


Erick Tryzelaar wrote:
> I found a bug with closures and objects. Here's an example: 

I forgot to mention that there's an easy workaround for this, all you 
have to do is just pull the anonymous function into a named function, 
and it works:

% Foo. =
Foo>      Foo. =
Foo>         make(target) =
make>           return $(target)
make>           .
.
Foo>         .
.
% foo(name, sources) =
foo>      foo(name, sources) =
foo>         Foo.make($(name))
foo>         .
.
% bar(s) =
bar>      bar(s) =
bar>         return $(foo $s, $s)
bar>         .
.
% baz(sources) =
baz>      baz(sources) =
baz>         return $(sources.map $(bar))
baz>         .
.
% echo $(baz 1 2 3)
1 2 3




More information about the Omake mailing list