[Haskell-beginners] Re: Closure

Daniel Bastos dbastos+0 at toledo.com
Sun Aug 16 12:12:38 EDT 2009


In article <200908152114.40077.daniel.is.fischer at web.de>,
Daniel Fischer wrote:

>> [Does] Haskell allow me to define a function at run time? I know
>> Lisp can, since a function is just a data structure which we can
>> put together at run time. But how about Haskell?

[...]

> If you write a good parser, you can also
>
> do  putStrLn "Please enter function code:"
>     code <- getLine
>     let fun = parseFunction code
>     use fun   -- may segfault if the entered code isn't good
>
> In which (other) ways can you construct functions at run time in Lisp?

None. I guess the only difference, if so considered, is that since
Lisp is so much syntactically simpler, it's easy to write a parser for
it, and I guess most implementations already bring one for ya. And
that's nice. It allows for the code that write code, which sounds
great. But anyway, my interest here was understanding Haskell better,
which I now do. Thanks for all inputs in this subthread.



More information about the Beginners mailing list