[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Compilation order
- From: Reuben Thomas <rrt@...>
- Date: Mon, 29 Apr 2002 13:36:58 +0100 (BST)
> Lua *used* to be like that, in the early days, before it had anonymous
> functions. Now, *all* functions in Lua are anonymous: "function f...end" is
> simply sugar for "f=function...end". In other words, functions definitions
> are not special constructs, simply assigments. So, what you propose is no longer
> possible.
Well, it is, but it's ugly: you'd need letrec and simultaneous assignment:
f, g = function () ... g() ... end, function () ... f() ... end
would work if the assignments to f and g were scoped over the right hand
side. Of course, in normal assignments they're not, or writing
f = f + 1
would be tricky...
--
http://www.mupsych.org/rrt/
Fate is unmoved by hope; rather, what we hope for changes (Murasaki)