lua-users home
lua-l archive

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

Could be made optional without being ambiguous, unlike the current way
  tab = { bob = function() end or 2 }
is ambiguous,
  tab = { function bob() end or 2 }
is obviously an error.

And yes, self is fine with a well taught editor. The only place the @ symbol differs
is possibly more confusing, as I've opted to not make it equivalent to "self" but
to the value involved, eg:

function tab:getiterator()
  return function()
    local self = "confusing self"
    return @iterator

I chose this way to prevent confusion about what the @ symbol really means,
to someone who never uses self. (unlikely you could find such a programmer,
but still).

On Wed Jan 23 21:41 , 'steve donovan' sent:

On Jan 23, 2008 3:39 PM, steve donovan <> wrote:
> function __init(width, height, depth)
> is of course exactly the same as
> __init = function(self, width, height, depth)

I am of course being an idiot; this is one place where it isn't true.
What about the commas after the function ends? They can be

steve d.