How do you (the language designers) feel about having a way to write literals for +- infinity and NaN? Currently you can generate these values via arithmetic. For instance, (/ 1.0 0) evaluates to positive infinity. Also, the literal 1e309 will evaluate to positive infinity. But inf doesn't have a canonical output representation in pixie. So if a program uses 1e400 and you try to compile it using pixie-vm -c, the compiled program will use the symbol inf instead of a float. That leads to a confusing error when you try to re-read the compiled file.
Having +- infinity available could also simplify implementing or extending some algorithms. For instance, as initial values when computing maxes or mins. Or, if a function is already written in terms of some finite upper bound, it can often be trivially extended to work with no bound just by replacing the upper bound with +inf. E.g. (range 0.Inf)
How do you (the language designers) feel about having a way to write literals for +- infinity and NaN? Currently you can generate these values via arithmetic. For instance,
(/ 1.0 0)
evaluates to positive infinity. Also, the literal1e309
will evaluate to positive infinity. Butinf
doesn't have a canonical output representation in pixie. So if a program uses 1e400 and you try to compile it using pixie-vm -c, the compiled program will use the symbolinf
instead of a float. That leads to a confusing error when you try to re-read the compiled file.I think 0.Inf, -0.Inf, and 0.NaN are good ideas. cf. https://github.com/edn-format/edn/issues/2#issuecomment-31765748
Having +- infinity available could also simplify implementing or extending some algorithms. For instance, as initial values when computing maxes or mins. Or, if a function is already written in terms of some finite upper bound, it can often be trivially extended to work with no bound just by replacing the upper bound with +inf. E.g.
(range 0.Inf)