dlang-community / SDLang-D

An SDLang (Simple Declarative Language) library for D

Home Page:http://sdlang.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Change Value's type to prevent assigning infinity/NaN

Abscissa opened this issue · comments

While #27 is technically fixed, it would be better to prevent infinity/NaN from even being placed into a Value in the first place. This would make it much easier to track down occurrances of infinity/NaN in user code (ie, fail as early as possible).

Instead of being a straight algebraic type, Value should become a thin wrapper over an algebraic type that throws when the value is set to infinity or NaN.

Might want to do this together with #43.