Adding Unicode operators to D

Bill Baxter wbaxter at gmail.com
Wed Oct 22 18:45:17 PDT 2008


On Thu, Oct 23, 2008 at 10:26 AM, Bill Baxter <wbaxter at gmail.com> wrote:
> 2008/10/23 Bill Baxter <wbaxter at gmail.com>:
>> On Thu, Oct 23, 2008 at 9:59 AM, Benji Smith <dlanguage at benjismith.net> wrote:
> From the Fortress wiki:
> http://projectfortress.sun.com/Projects/Community/wiki/MathSyntaxInFortress
> """
> Support for the full collection of symbols is not widespread yet, but
> three fonts offer good coverage:
>
>    * Code2000 many characters, shareware ($5)
>    * Everson Mono monowidth, shareware (€25 for 3 computers)
>    * Stix fonts comprehensive, integrated with TeX, probably released
> later this year.
> """
>
> So there are only three fonts usable for Fortress?  And two require
> payment, and one isn't actually released yet??

And after downloading them to take a look, I'll add that the two fonts
that are available on that list look *horrible*.

>From looking over the sample code on the Fortress site it looks to me
like what they've done with Unicode is closer to Andrei's emacs hack
for rendering !( ) as chevrons.  All the code examples are in ASCII,
but apparently can be rendered by a program called "Fortify" that
replaces things like [/ and \]  with unicode symbols.

One big difference between D and fortress is that Fortress makes no
attempt to keep the grammar simple.  They say it's difficult to parse,
but it can be done with something called a "Packrat parser".  I
suspect that gives them more freedom to define ascii sequences that
are reminiscent of the math operators they want to mimic.  Like  [/ x
\]  for ceil(x).   Also wacky is that   a+b * 3 is a syntax error
because the precedence implied by the spacing does not match the
actual precedence of the operators!   Must be written   a + b*3.   I'd
just as soon not have that one in D.  :-)

--bb



More information about the Digitalmars-d mailing list