lua-users home
lua-l archive

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


s="s=%qprint(s:format(s))"print(s:format(s))

2008/5/13 Yuri Takhteyev <yuri@sims.berkeley.edu>:
> >  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/
>