lua-users home
lua-l archive

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


Hmmm, so we start with Lua that maybe 60% of people CAN read, either because they speak English natively, or because they know enough to memorize the two dozen keywords (which they probably know from other languages) …. and we then convert to a symbol set that NO-ONE can ever read or remember … well that's one way of leveling the playing field! (grin)

Anyway, to my mind for non-native speakers it's not the keywords, they can easily pick that up, it's the use of English words and phrases as variable names.

--Tim

On Apr 10, 2013, at 2:49 PM, Dirk Laurie <dirk.laurie@gmail.com> wrote:

> 2013/4/9 Dirk Laurie <dirk.laurie@gmail.com>:
> 
>> Lua's existing syntax *is* lambda syntax, but for the sake of
>> portability the three symbols required are spelt out with keywords.
> 
> Portability-shmortability. Get yourself a font that displays all
> of Unicode properly and configure your keyboard to make the
> Unicode characters you need with the alternate graphic key.
>   http://en.wikipedia.org/wiki/AltGr_key
> 
> The attached patch to Lua 5.2 allows the syntax
> 
>    ∆(a,b) → a+b ⋄
> 
> Actually, all Lua keywords have been replaced by single Unicode
> symbols, as a service to those who find Lua code obfuscated when
> using English words like 'function' and 'return' instead of symbols.
> 
> Here is a sample:
> 
> ⊣ i ∊ pairs(_G) ⊢ print(i) ⋄  -- prints the global table
> ⍳ 2<3 ⊥ print(∪) ⊤ print(∩) ⋄ -- prints "true"
> 
> The mapping of Unicode symbols to Lua terminals is defined
> in the patch to llex.c.
> <unicode-alphabetic.patch>