This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-04-10
Channels
- # beginners (61)
- # boot (264)
- # cider (125)
- # cljs-dev (3)
- # clojure (118)
- # clojure-gamedev (3)
- # clojure-greece (1)
- # clojure-italy (1)
- # clojure-nl (2)
- # clojure-poland (3)
- # clojure-russia (38)
- # clojure-spain (2)
- # clojure-spec (17)
- # clojure-taiwan (1)
- # clojure-uk (42)
- # clojurescript (118)
- # clojutre (5)
- # cursive (24)
- # datomic (22)
- # emacs (3)
- # events (2)
- # figwheel (19)
- # funcool (1)
- # jobs-discuss (224)
- # jobs-rus (1)
- # klipse (14)
- # luminus (1)
- # lumo (49)
- # off-topic (51)
- # om (34)
- # pedestal (1)
- # perun (1)
- # planck (93)
- # powderkeg (1)
- # re-frame (15)
- # ring (4)
- # rum (9)
- # slack-help (3)
- # spacemacs (2)
- # specter (13)
- # uncomplicate (1)
- # unrepl (22)
- # untangled (10)
- # yada (36)
Since I’m asking the question, I’m probably not gonna understand the answer, but I’ll try anyways:
Why are the functions in planck.repl.cljs mostly private and exposed through macros in the repl.clj namespace?
@slipset because you wanna call (doc merge)
for example
@slipset planck.repl
is a conflation of stuff needed to actually implement the REPL, and a namespace that is an appropriate home for imitations of stuff in clojure.repl
The few things that are public are indeed macros. I think that they in turn delegate to functions is just a matter if implementation choice for those macros.
and a function wouldn’t know how to get the docstring for the merge function
but it can for the merge
symbol
And, conversely, the doc
macro could probably have all of its implementation within it and not call the doc*
function.
@anmonteiro so, otherwise you’d have to call (doc 'merge)
which is not how the Clojure REPL works
and both Planck and Lumo wanna have parity with it
Yeah, I think all of the public things in planck.repl
are macros (some started off inappropriately being REPL specials, FWIW)
@slipset I think that implementation won’t work for macros
@anmonteiro you’re right:
cljs.user=> (planck.repl/get-arglists get-arglists)
Could not eval (var get-arglists)
Unable to resolve var: get-arglists in this context
nil
cljs.user=> (planck.repl/get-arglists println)
([& objs])
cljs.user=>
I forget, where did this get-arglists
thing come from. Was it something you made up @anmonteiro, or is it in Clojure or ClojureScript somewhere?
I don’t know what get-arglists
is 🙂
cljs.user=> (doc lumo.repl/get-arglists)
-------------------------
lumo.repl/get-arglists
([s])
Return the argument lists for the given symbol as string.
that’s something @richiardiandrea worked on
I think that’s needed for inf-clojure
for some reason
I didn’t recall that was in Lumo 🙂
since when I added planck support for inf-clojure, I saw that lumo and stock clojure had something for this, but planck was lacking.
yeah exactly for inf-clojure
, it kind of exposes the arglists that then we display as Eldoc at the bottom
(defcustom inf-clojure-arglists-form
"(try
(:arglists
(clojure.core/meta
(clojure.core/resolve
(clojure.core/read-string \"%s\"))))
(catch Throwable t nil))\n"
"Form to query inferior Clojure for a function's arglist."
:type 'string
:package-version '(inf-clojure . "2.0.0"))
Don't copy it because there is a bug 😄
so basically sometimes we see (quote (.....)
cljs.user=> (lumo.repl/get-arglists "defn")
(quote ([name doc-string? attr-map? [params*] prepost-map? body] [name doc-string? attr-map? ([params*] prepost-map? body) + attr-map?]))
with Antonio we kind of found out we need an if
in there
but I haven't had time to contribute it
https://github.com/mfikes/planck/blob/master/planck-cljs/src/planck/repl.cljs#L1252-L1259
yep exactly that piece
so I need to add that if
in get-arglists
Nice. Yeah. I suppose doc could rely on get-arglists
if it has all the funky logic in it
definitely I am going to see if I have some time these days for patching 😄
I have a bug in inf-clojure
to fix first I guess, kind of nasty
I wonder if this was when ClojureScript first got doc
support: http://swannodette.github.io/2014/12/29/nodejs-of-my-dreams
@slipset thanks, can you fix the indentation though?
he probably needs to set user.email
in .gitconfig
to an email that GitHub knows about
Let me know if you need me to roll back the Planck commits. I don't think anyone else has pulled them yet.
If it’s no biggie for you, it would be nice with “<mailto:[email protected]|[email protected]>”
@slipset FWIW I think you can fix it by adding your work email to your GH account
though that might not be something you wanna do
I think that’ll fix it in a backwards manner
interestingly your commit to Lumo is identified correctly
@anmonteiro because I amended it 🙂