[Omake] closure/objects bug?

Erick Tryzelaar erickt at dslextreme.com
Sun Jan 28 17:32:36 PST 2007


I found a bug with closures and objects. Here's an example:

% Foo. =
Foo>      Foo. =
Foo>         make(target) =
make>           return $(target)
make>           .
.
Foo>         .
.
% foo(name, sources) =
foo>      foo(name, sources) =
foo>         Foo.make($(name))
foo>         .
.
% bar(sources) =
bar>      bar(sources) =
bar>         return $(sources.map $(fun s, $(foo $s, $s)))
bar>         .
.
% echo $(bar 1 2 3)
*** omake error:
   File -: line 7, characters 36-38
   unbound variable: s


However, if the "make" function is defined outside of an object, it works:

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

%


More information about the Omake mailing list