lua-users home
lua-l archive

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

Lua 5.0.2  Copyright (C) 1994-2004 Tecgraf, PUC-Rio
> a=2+3; =a
stdin:1: unexpected symbol near `='
> a=2+3
> =a
> = (function() a=2+3 end)(), a
nil     5


Goran Zoricic kirjoitti 24.2.2006 kello 17.37:

Goran Zoricic wrote:
Alex Queiroz wrote:
On 2/24/06, Pavol Severa <> wrote:
I imagine there are some formal problems:
1. a function call is a valid statement - still it would be nice if
its results were printed (except when it's nil)
     Try putting a '=' before the expression or function call.
A followup question: if i write '= 2+3', the lua console prints '6',
as it should. However, lua doesn't support expression cascading
('a=b=c;' is not valid), so if i write something like '=a=2+3;', i
get an error. Is there a way to make it print '6' even in this case?


'= 2+3' actually prints '5', most of the time. :))


The absolute law of the universe: everything depends