lua-users home
lua-l archive

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


> = 1+2+3
6
> = { 4, 5, 6 }
table: 0x305510
>

Pavol Severa kirjoitti 24.2.2006 kello 16.53:

I'd like to ask if there is a version (or a patch to) the lua
executable that would make the interactive mode more "pleasant" (e.g.
when using as a calculator :). I mean the following:
If an expression is entered (not a statement), it would be evaluated
and printed.

(by entering an expression I mean writing it at the '>'-prompt; inside
a block (written at the '>>'-prompt) they'd better behave as now, i.e.
(mostly) be a syntax error)

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)
2. lot more that I don't see

[Maybe, when a table is entered, it could be printed not as 'table:
somenumber', but by showing its content (I definitely don't mean
changing the builtin print function, just changing the behavior when
entering a table at the prompt, which is currently a syntax error)]

regards
P.