lua-users home
lua-l archive

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



On 13 Nov 2018, at 19:16, Dirk Laurie <dirk.laurie@gmail.com> wrote:

I'm not too sure how one could implement hiding of upvalues at the
language level. (At the implementation level, it's obvious. Just skip
the phase that looks for them.) Maybe a keyword that makes upvalues
invisible to the end of the current local scope.

   rotate = function (_ENV,c,s) blind
     return {x=c*x-s*y,y=s*x+c*y}
   end

This does need a compiler change to fix because of the way locals and upvalues get hard coded at compile time.  My "declared upvalue" patch from 2-ish years ago fixes this as well as the recent request regarding upvalue ordering (I mentioned it in that thread).  I raise it again here because your proposal of adding a 'blind' keyword is the same as the empty upvalue list `<>` in my syntax.

http://lua-users.org/lists/lua-l/2016-05/msg00024.html
http://lua-users.org/lists/lua-l/2016-05/msg00187.html

Regards,

Duane.