POV-Ray : Newsgroups : povray.off-topic : Really strange design choices : Re: Trixy Server Time
6 Sep 2024 19:22:32 EDT (-0400)
  Re: Trixy  
From: Invisible
Date: 18 Dec 2008 08:40:41
Message: <494a52d9$1@news.povray.org>
>> Other amusing edge cases include "/":
>>
>> - A name is usually executable; by preceeding it with "/", it becomes 
>> literal.
>>
>> - The toke "/" by itself (i.e., not preceeding a name) is a valid 
>> (executable) name.
>>
>> Trixy Hobbitses!
> 
> 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).

Ah, but these interact!

Anything that isn't parsable as a number is a name. Therefore,

"0."    -> real
".0"    -> real
"."     -> name
"1.1"   -> real
"1.1.1" -> name
"1e1"   -> real
"1x1"   -> name
"s1"    -> name
"1s"    -> name

Will the insanity never end?? >_<

Good luck writing a parser that can untangle all of that... :-(


Post a reply to this message

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