POV-Ray : Newsgroups : povray.off-topic : Really strange design choices : Re: Trixy Server Time
6 Sep 2024 13:20:13 EDT (-0400)
  Re: Trixy  
From: Invisible
Date: 18 Dec 2008 06:39:45
Message: <494a3681$1@news.povray.org>
Invisible wrote:

> Also fun is trying to write a correct number parser:
> 
> - ".0" and "0." are both real number objects (equal to 0.0).
> 
> - "." by itself is a name object.
> 
> - PostScript allows both "-" and "+" as sign prefixes (which is good). 
> Haskell does not, however (which is bad).

Now the joy of parsing strings.

Simple, right? RIGHT??

Ah, but you forget about *escape sequences*! >:-]

PostScript supports these:

- Strings are delimited with brackets, not quotes.
- Matched brackets work automatically. Unmatches ones must be escaped.
- \n, \t, etc.
- \\ is a backslash, \( and \) are brackets.
- \100 is an octal character code. (Oh what fun finding an octal 
conversion function!)
- A backslash before a newline discards the newline character.
- Anything else preceeded by a backslash is just itself.

Man my head hurts... Again, 2% of the functionality takes 90% of the 
implementation effort! >_<


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.