From: Daniel Berger Date: 2007-01-21T23:05:30+09:00 Subject: Re: Allowing Unicode in the grammar? Nikolai Weibull wrote: > On 1/19/07, Berger, Daniel wrote: >> One of the things Fortress allows you to do is use Unicode in the >> language itself. For example, instead of '==', you use '���'(U+2261). >> For those unable or unwilling to use that, Fortress also provides a >> macro equivalent such as 'EQ'. >> >> I don't expect you to support it, I was just wondering if you've ever >> considered it and what you think of the idea in general. >> >> If I had an initial wishlist, I would keep it small: >> >> ��� (U+2261) >> ��� (U+2265) >> ��� (U+2264) >> ��� (U+2260) >> >> I'm not suggesting replacing '==', just allowing the Unicode code >> point to mean the same thing (and thus, allowing us to define it in >> our own classes as well). >> >> Or are we prisoners of QWERTY? > > (Yeah, sorry, I'm not Matz, but I just couldn't help myself.) No problem. I suppose I should have opened this question up to everyone. So, anyone else have any thoughts? > I'm all for it. The only incompatibility I see is that the stance so > far has been that Ruby should be as encoding-independent as possible > (with regard to the IO and String classes). I don't know what the end > result was, but there was discussion of using Python-styled > script-encoding-declarations [1], and presumably the parser could > toggle on handling of characters like those above if the script's > encoding is Unicode. Couldn't we just lean on $KCODE? And make UTF8 the default? > (Warning! Possible flame-bait below.) > > It'd be really cool to be able to define additional operators at > runtime (a patch for this was sent to ruby-talk a while ago (2005?), > but it never really went anywhere), so that Set could take operators > like ���, ���, and ���. It's pushing it a bit, but I'd really appreciate > being able to write stuff like > > puts n if n ��� (1..100) Yes, that would be neat. I'm not sure where we would draw the line, though, as issues of readability and maintenance (for those who aren't familiar with mathematical notation) could become a concern. Regards, Dan