[erlang-questions] Why doesn't erl_eval compile code?

Tony Arcieri tony@REDACTED
Mon Jul 6 04:03:11 CEST 2009


On Sun, Jul 5, 2009 at 5:11 PM, Robert Virding <rvirding@REDACTED> wrote:

> Seeing no one has replied I will give some comments:
>
> - What problem are you trying to solve? I admit that it would be cool to do
> it, but why?


Well, specifically I'm curious about this approach for Reia.  Right now I've
had difficulty keeping the semantics consistent between the compiled and
evaluated versions (and this is using erl_eval to handle the evaluation).

I figure by using a compiled solution for eval there's a single path all
code goes through to get executed.


> - While the fun code is not very elegant :-), it does work as it should.


Unless you're crazy enough to pass more than 20 arguments :)


> - If you remove the module when you are done, which you must explicitly do,
> then there could be some problem with funs if you have passed them on and
> they still are in use as they will not work after their module has been
> removed.


Oh right, crap... that's a tricky problem.  I can't think of a good solution
offhand either.

-- 
Tony Arcieri
medioh.com


More information about the erlang-questions mailing list