lua-users home
lua-l archive

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




On 2017-05-01 03:44 PM, Jay Carlson wrote:
On Apr 30, 2017, at 10:44 AM, Soni L. <fakedme@gmail.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:

def 🚫(📖)
	🐦 = 💻(📖)
	📝🚫🐊 = Array.new

	begin
		🚫📥 = 🐦.blocked_ids
		File.open(File.join(LOGDIR, 'block_ids.current'), 'w+') do |💾|
			🚫📥.sort.each do |😭🐊|
				💾.puts(😭🐊)
				📝🚫🐊 << 😭🐊.to_s

https://github.com/oapi/emojiautoblocker/blob/master/emojiautoblocker




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.