Can't `doc` functions in `Math`
Issue:
(doc Math/sin) returns
Could not resolve the symbol
Math/sin. Maybe it has not been defined?
Interesting, I did not even know that Math is a special namespace:
https://cljs.github.io/api/syntax/Math-namespace
I don't think there are 'vars' associated with these special namespaces. I
suppose we could import docstrings from
https://www.w3schools.com/js/js_math.asp? or
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math
(depending on their licenses), or write our own. We could also do this for
other stuff in the js/ namespace which we know to be available in
most/all browsers. an easy onramp to the most-likely-to-be-needed
javascript/browser functions..
MDN, which I generally prefer, is CC-BY-SA licensed: https://developer.mozilla.org/en-US/docs/MDN/About#Copyrights_and_licenses
We should make sure to override our usual clojuredocs link with a link to https://cljs.github.io/api/syntax/Math-namespace.
Would we want to provide non "special namespaced" versions of the common functions to make the experience more uniform for learners?
I think we could take the "pretend-to-be-a-var" pathway that already exists
for repl-specials, and extend it for Math. That would have the advantage
of only being a tooling augmentation, and keep user code portable (without
dependencies).
On Tue, Mar 6, 2018 at 8:40 AM, Jack Rusher [email protected] wrote:
Would we want to provide non "special namespaced" versions of the common functions to make the experience more uniform for learners?
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/mhuebert/maria/issues/187#issuecomment-370691261, or mute the thread https://github.com/notifications/unsubscribe-auth/AAKFZ7Qgc7jKm7uxfkxTRaDOdacLkbrCks5tbj1sgaJpZM4Sclzg .
-- http://matt.is — Berlin, Germany
I'm torn. Math functions are almost a good time to introduce the concepts of namespaces and JavaScript...but they feel too soon. So yeah, I agree we should pretend to be a var, and in the source for those specials we point to CLJS.github.io and MDN.