[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Could Lua itself become UTF8-aware?
- From: "Soni L." <fakedme@...>
- Date: Mon, 1 May 2017 16:12:08 -0300
On 2017-05-01 03:44 PM, Jay Carlson wrote:
On Apr 30, 2017, at 10:44 AM, Soni L. <email@example.com> wrote:
On 2017-04-30 07:19 AM, Shmuel Zeigerman wrote:
On 29/04/2017 16:41, Dirk Laurie wrote:
The next step would be a compiler option under which the lexer
accepts a UTF-8 first character followed by the correct number
of UTF-8 continuation characters as being alphabetic for the
purpose of being an identifier or part of one.
BTW, LuaJIT 2 has it for years already (it allows UTF-8 in identifiers). But it seems nobody needs it.
Well, I'd argue mostly nobody needs it because it doesn't allow emoji in identifiers.
Does it prohibit all astral characters, or are emoji singled out?
Either way, that's too bad. You can write this Ruby:
🐦 = 💻(📖)
📝🚫🐊 = Array.new
🚫📥 = 🐦.blocked_ids
File.open(File.join(LOGDIR, 'block_ids.current'), 'w+') do |💾|
🚫📥.sort.each do |😭🐊|
📝🚫🐊 << 😭🐊.to_s
Beautiful! See, this is why we need 0x80-0xFF to be valid in
identifiers. (Or emoji, but we're trying to keep things simple and
adding full UTF-8 handling to Lua isn't simple.)
Disclaimer: these emails may be made public at any given time, with or without reason. If you don't agree with this, DO NOT REPLY.