lua-users home
lua-l archive

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


>  A variant using "print" might be nice, to get a final newline:
>
>  s=[[print('s=['..'['..s..']'..'];'..s)]];print('s=['..'['..s..']'..'];'..s)

For Lua console fans, the following version also prints the initial "> ":

s=[[print('> s=['..'['..s..']'..'];'..s)]];print('> s=['..'['..s..']'..'];'..s)

Then you get:

> s=[[print('> s=['..'['..s..']'..'];'..s)]];print('> s=['..'['..s..']'..'];'..s)
> s=[[print('> s=['..'['..s..']'..'];'..s)]];print('> s=['..'['..s..']'..'];'..s)
>

:)

- yuri

-- 
http://sputnik.freewisdom.org/