lua-users home
lua-l archive

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


Some things that came up in a bout of hacking over Christmas:

1. Why can't inner functions be defined for local values? I mean that:

function y ()
  function f() ...
  end
end

works, but

function y ()
  local f = function g()
              function h()
	      end
	    end
end

doesn't. By the way, provided f() in the first example above doesn't clash
with any other global, you can use inner functions of this sort to get
mutual recursion in "local" functions (albeit not anonymous functions).

This seems like an area of Lua that needs to be sorted out, as it's a bit
un-uniform.

2. It looks ugly on Windows PCs to use `' around tokens in error messages,
because these characters tend not to be symmetrical quotes as they usually
are under UNIX. Using '' would be a better compromise.

3. I miss having exceptions! (Though maybe they can be coded up using call
and error?)

4. In the manual it says 'Lua code can "catch" an error using the function
call': this is ambiguous. [Sorry, I can't quite find the bit of the manual
this referred to now]

5. What are the "syntactic reasons" for forcing break and return to occur at
the end of a block? (Sorry if this was already answered, but I couldn't find
it; a message number would suffice!)

-- 
http://sc3d.org/rrt/ | impatience, n.  the urge to do nothing