polterguy / lizzie

A script language for .Net and the CLR
https://ainiro.io/
MIT License
190 stars 27 forks source link

IsNumeric has better implementation #22

Closed SapphireBrand closed 5 years ago

SapphireBrand commented 5 years ago

Compiler.IsNumeric is more simply (and comprehensively) implemented using double.TryParse.

SapphireBrand commented 5 years ago

Looking at it with fresh eyes... It seems to me that the purpose of this function is to decide how to treat a token: either as a number (which will be parsed using TryParse) or a symbol. So it is using the "C" language convention that numbers start with digits, and symbols do not.

And it allows numbers to start with period, as ".05" for example. Which is fine.

So I think this should stay as is. I am closing this issue.