lua-users home
lua-l archive

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




function f(x,y=0) --> function f(x,y)  y= y==nil and 0 or y;


Ok, I'm wrong.  There's a bug in my semantic. What you actually want is probably:

function f(x,y=<const _expression_>) --> if y ~= nil then y= <const _expression_> end

Piggybacking on OP_OR or OP_AND just leads to all sorts of trouble in the boolean cases.

-Sven