Re: [q-lang-users] More Unicode queries.
Brought to you by:
agraef
From: Rob H. <hub...@gm...> - 2008-01-15 09:11:24
|
Ah, I wrote this before I saw John's reply. Here it is anyway... > >> No. Are there other languages which offer this? > > > > Python: > > \N{name} > > Ok, I see. Well, I could probably extract the necessary tables from ICU, > but that would add quite as lot of static string data to the > interpreter. So, before I put this on the TODO list, let me ask whether > anybody really wants/needs this? I see. Well in that case, ironically, my vote is "no". I don't think the price is worth paying. Apart from anything else, the Unicode names are truly horrible. However, I wonder whether a mechanism like XML's entities could be used for Q strings. I can't think of a Q-like way to do it. Allowing \N{name} within a string to be subject to rewrite rules would be the sort of thing that would be useful. However, it ought to be done when the program is parsed rather than run. [XML does not restrict an entity to a single character.] I don't think this would upset the Q style, as currently a Q file can already affect the way a program is parsed, with the advent of under-defined infixed symbolic operators. A user would be free to define his string entities in a Unicode-like or XHTML-like or TeX-like style, according to taste. Thus he could define an em dash as \N{EM DASH} or \N{mdash} or \N{---}. In this way, it might be possible to supply a handful of <entity.q> files containing names for at least the most commonly used symbols, perhaps in varying styles and to varying extents. Rob. |