hughperman / pure-lang

Automatically exported from code.google.com/p/pure-lang
0 stars 0 forks source link

Declaration of 'inf' and 'nan" as nonfix symbols #86

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I think numeric values "inf" and "nan" should be declared as nonfix symbols, 
otherwise they cannot be pattern matched.

Jiri

Original issue reported on code.google.com by jiri.spitz@gmail.com on 1 Aug 2012 at 9:33

GoogleCodeExporter commented 8 years ago
Yeah, there are a couple of other symbols where this might make sense, but I've 
made it a policy that the standard library never declares any constant symbols 
as nonfix, since once a symbol is nonfix there's no going back. Thus a 
programmer needs to declare the symbols nonfix himself if he wants to use them 
in pattern-matching (see 
http://docs.pure-lang.googlecode.com/hg/pure.html#constant-definitions).

Original comment by aggraef@gmail.com on 4 Aug 2012 at 11:18