closing the loop on Erlang metaprogramming with Smerl

Yariv Sadan <>
Fri Aug 18 04:28:40 CEST 2006


> New way:
>
> A = 7,
> C1 = smerl:new(foo),
> {ok, C2} = smerl:add_func(foo, bar, fun() -> 3 + A end),
> smerl:compile(C2),
> foo:bar(). %% returns 10
>
> Yup, Smerl now supports fun expressions -- even closures!

Ugh, looks like I suffered a big setback -- erlang:fun_info behaves
differently in the shell and in compiled modules. I guess fun
expressions may not be part of Smerl after all...

Yariv



More information about the erlang-questions mailing list