Clojurians
#lumo
<
2018-05-07
>

This page is not created by, affiliated with, or supported by Slack Technologies, Inc.

richiardiandrea19:05:46

@mfikes @anmonteiro do you folk think that we are ready to add something like find-var in self-host implementations? I don't see why not but maybe I am missing something. In particular I was looking at porting cljs-tooling to self-host and that's the only thing I am missing

mfikes19:05:42

@richiardiandrea I can't see how it wouldn't work. In fact, you might be able to use cljs.core/resolve for now even without it.

richiardiandrea19:05:31

cool thanks for the answer, it would be indeed cool to add

mfikes19:05:10

Planck also has a (slightly more dynamic) planck.core/resolve if you need to support the case where the symbol isn't a compile-time constant.

richiardiandrea19:05:07

yeah I think that's the case for completion

mfikes19:05:18

The implementation is trivial now that eval is a thing:

(let [sym 'cljs.core/map]  (eval `(~'var ~sym)))

richiardiandrea19:05:39

wow that works also in lumo now, just tried :smile:

richiardiandrea19:05:15

(meta (let [sym 'cljs.core/filter]  (eval `(~'var ~sym))))
{:ns cljs.core,
 :name filter,
 :file "cljs/core.cljs",
 :end-column 13,
 :top-fn {:variadic false,
          :max-fixed-arity 2,
          :method-params ([pred] [pred coll]),
          :arglists ([pred] [pred coll]),
          :arglists-meta (nil nil)},
 :column 1,
 :line 5099,
 :end-line 5099,
 :arglists ([pred] [pred coll]),
 :doc "Returns a lazy sequence of the items in coll for which\n  (pred item) returns true. pred must be free of side-effects.\n  Returns a transducer when no collection is provided.",
 :test nil}

mfikes19:05:43

I'm glad you didn't bowdlerize my speech :slightly_smiling_face:

richiardiandrea19:05:03

lol should I :smile:

mfikes19:05:31

An F bomb every now and then is a good thing, as is juxt

madstap15:05:17

New tagline for apropos clojure?

richiardiandrea19:05:58

it was very genuine :smile:

dominicm19:05:58

New word, nice. Sticking that one into my toolkit.

mfikes19:05:37

I think to match find-var you need to check that the argument is a symbol? but not a simple-symbol?

richiardiandrea19:05:00

wow, sorry for my ignorance, but I did not know about simple-symbol?

richiardiandrea19:05:51

on another note, I will be porting cljs-tooling to self-host as well: https://github.com/clojure-emacs/cljs-tooling/pull/24

richiardiandrea19:05:01

it has not been as bad as I thought it would be