pyret-lang
pyret-lang copied to clipboard
Please define `num-pi`, `num-e`
These should be pre-defined so people don't need to use atan, etc., to get π.
PI is now defined!
Any reason not to close?
Well, e isn't defined, and we haven't started thinking about how this should interact with the global namespace: e doesn't usually mean the base of natural logarithms, in many portals, so I don't want to co-opt that name by default. But yet we do want PI in the global namespace...
What about using some other name like e_log or _e?
(I'd like to work on this if that's OK)
Starting names with an underscore seems like "not good Pyret style", so I don't like that. e_log doesn't look right either; Pyret tends to go for dashes rather than hyphens in its names.
When this issue was filed, Pyret didn't yet have contexts, so it was much bigger of a problem that these numbers weren't defined by default. And in the intervening years... @shriram or @schanzer how often have the lack of these values been a problem for you?
Thanks for the suggestion, @safwansamsudeen. But this is not an issue for me, and if it were, I agree with Ben, contexts are the way to go to solve this. It avoids us having to argue about what to call these and just pick the name that works best for our context.
@blerner now that contexts are a thing this isn't an issue at all. But it would be nice to get some kind of e constant.....echoes of #486