[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lightweight syntax: a dissident view
- From: Tony Finch <dot@...>
- Date: Sat, 27 Nov 2010 22:56:32 +0000
On 27 Nov 2010, at 20:37, David Kastrup <dak@gnu.org> wrote:
>
> The Lua approach would be to _make_ functions tables. Then one need not
> worry about one being supported differently from the other.
I think Lua is more pragmatic than that. There are important differences in efficiency between functions and tables: arguments and local variables are more efficient than table entries. This is not just an artefact of the implementation: LuaJIT's analyses rely on the restrictions on how you can use local variables (without going through the debug library) such as not being able to enumerate them like a table and not being able to get or set them via a dynamically computed name.
If you want a language that uses the same structures for tables and functions, see Python.
Tony.
--
f.anthony.n.finch <dot@dotat.at> http://dotat.at/
- References:
- Re: Lightweight syntax: a dissident view, Philippe Lhoste
- Re: Lightweight syntax: a dissident view, Pierre-Yves Gérardy
- Re: Lightweight syntax: a dissident view, Mark Hamburg
- Re: Lightweight syntax: a dissident view, Pierre-Yves Gérardy
- Re: Lightweight syntax: a dissident view, Pierre-Yves Gérardy
- Re: Lightweight syntax: a dissident view, Axel Kittenberger
- Re: Lightweight syntax: a dissident view, steve donovan
- Re: Lightweight syntax: a dissident view, phlnc8
- Re: Lightweight syntax: a dissident view, Doug Lua
- Re: Lightweight syntax: a dissident view, Dirk Laurie
- Re: Lightweight syntax: a dissident view, Luis Carvalho
- Re: Lightweight syntax: a dissident view, Mark Hamburg
- Re: Lightweight syntax: a dissident view, David Kastrup