4 ms·
> That actually looks pretty nice but as Python 3.6 is slated for release in another 12 months you will have to wait a little longer. ...Or just do it in 28 li
by hisham_hm 11y ago
> That actually looks pretty nice but as Python 3.6 is slated for release in another 12 months you will have to wait a little longer.
...Or just do it in 28 lines of Lua:
http://hisham.hm/2016/01/04/string-interpolation-in-lua/ http://hisham.hm/2016/01/04/string-interpolation-in-lua/
This is a nice showcase of how Lua's metamechanisms can be applied to do things that often require new features in other languages.
- kedean 11y agoI'd argue that it's not a good thing that you can just disregard block scoping willy-nilly from within unprivileged code.
- hisham_hm 11y agoIf you are in a context where you are concerned about "privileged vs. unprivileged" code, you have to sandbox way more than that, and Lua provides you many mechanisms to control that (more than any other mainstream scripting language). Disabling the "debug" library which I used there for traversing block scopes is the very first thing one does when sandboxing in Lua.