lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hi All,
 
I am very new to Lua (first time post) and having too many ways to express the same statement is very confusing.
 
Not using the () with function calls is very difficult for my old 'C' eyes to understand :-) For my $0.02 worth I would like to have functions calls restricted to require () and having 'foo bar' instead of 'foo(bar)' is too much of a change for me.
 
Thanks
--Keith 
 
-------Original Message-------
 
Date: 02/25/05 15:09:11
Subject: Re: Lua and Saint-Exupery?
 
On Friday 25 February 2005 19:55, Aaron Brown wrote:
[...]
> This special case exists for literal strings and table
> constructors to make Lua more flexible as a data-description
> language:
 
In fact, I'd rather like to see this syntax kept, but generalised, so that
'print true' does actually work.
 
This opens up the possibility for some rather nice features by chaining
together functions.
 
Object = {...description of object...}
 
o1 = Object
o2 = green Object
o3 = large green Object
o4 = sparkly large green Object
 
....where green, large and sparkly are functions that take a single parameter,
examine their contents, and return a new table based on those contents.
 
Terribly handy, particularly for a data description language, and has the
bonus that it would make the language more consistent, which means a less
complex and therefore smaller parser.
 
Imagine this applied to LTN12, for example.
 
(However, you would have to be extremely careful with precedence, and it opens
the door for some unpleasant typo-based bugs. 'foo() + bar()' and 'foo()
bar()' become valid, the latter being equivalent to 'foo()(bar())'.)
 
[...]
> All of the libraries, including io, use the dot notation.
> The io library (the only library that deals with handles)
> also uses the colon notation when a handle is involved.
 
Yes, : is completely appropriate here.
 
--
"Curses! Foiled by the chilled dairy treats of righteousness!" --- Earthworm
Jim (evil)
 
 
 
--
No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 266.4.0 - Release Date: 2/22/2005
 
.
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 266.4.0 - Release Date: 2/22/2005