lua-users home
lua-l archive

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


On Fri, Mar 21, 2014 at 2:34 PM, Hisham <h@hisham.hm> wrote:
> On 21 March 2014 18:19, Javier Guerra Giraldez <javier@guerrag.com> wrote:
>> On Fri, Mar 21, 2014 at 3:44 PM, Luiz Henrique de Figueiredo
>> <lhf@tecgraf.puc-rio.br> wrote:
>>> The main change in Lua 5.3.0 is the introduction of integers.
>>> For other changes, see
>>>         http://www.lua.org/work/doc/readme.html#changes
>>
>>
>> "no need to prefix with '='"
>>
>> hurray!!
>
> A much welcome addition, seriously! I'll have to retrain my fingers
> from typing "python" whenever I need to do a quick calculation.
>
> Also, to pop the champagne, this just _had_ to be done ;)
>
> ]cat iostream.lua
>
> std = {}
> std.cout = {
>    __shl = function(a, b)
>       io.write(b)
>       return std.cout
>    end
> }
> setmetatable(std.cout, std.cout)
> std.endl = "\n"
>
>
>
> ]cat hellocpp.lua
>
> require "iostream"
>
> _= std.cout << "Hello overloadable bitwise operators!" << std.endl
>
>
> Cheers!
>
> -- Hisham
>

This is why we can't have nice things :(