Clojurians
#lumo
<
2017-06-20
>

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

hlolli18:06:21

I wonder if the cacheing mechanism is in any way configureable. Like chache once and whenever a macro is defined after that, lumo will reject its change, or setting compilation level to none (if its other than none), not very important, just sometimes evaluating macros can take up to a minute, just one (big) macro.

anmonteiro18:06:57

@hlolli not exactly sure what you’re saying there

anmonteiro18:06:12

Lumo will currently invalidate the cache for a file if that file changes

hlolli18:06:49

ok for example I just made this macro now

(defmacro define-fx
  [fx-name string-inject-fn param-vector]
  `(letfn [(param-key# [param-num#]
             (keyword (str "p" param-num#)))]
     (defn ~(symbol fx-name)
       [~(symbol "&") {~(symbol "keys") keys-vector# :as fx-env#}]
       (let [fx-env# (merge ~(apply hash-map param-vector) fx-env#)]
         (fn [aL# aR# param-cnt#]
           (let [param-vector-keywords# ~(filter keyword? param-vector)
                 param-nums# (range (inc param-cnt#)
                                    (inc (+ param-cnt# (count param-vector-keywords#))))
                 param-val-list# (partition 2 (interleave (map param-key# param-nums#)
                                                          param-vector-keywords#))
                 fx-name-key# (keyword ~fx-name)]
             ;; Swap parameter name for p-field number
             [(apply ~string-inject-fn aL# aR#
                     (map (fn [s#] (str "p" s#)) param-nums#))
              ;; Make a map of {:px [:fx-name :param-name]}
              ;; and {[:fx-name :param-name] value}
              (merge (reduce (fn [init# val#] (assoc init# (first val#)
                                                     [fx-name-key# (second val#)]))
                             {} param-val-list#)
                     (reduce (fn [init# val#] (assoc init# [fx-name-key# (second val#)]
                                                     (get get-env# (second val#))))
                             {} param-val-list#)
                     {:param-cnt (last param-nums#)})]))))))
takes ca. 30 secs to load. These are two seperate questions. That invalidate mechanism, is it possible to turn it off, so that even in situations the file has changed, lumo will not recache.

hlolli18:06:36

Maybe it would render all useage of lumo repl unuseable, in that case, I wont push that question further :slightly_smiling_face:

anmonteiro18:06:11

so.. if you don’t wanna use the cache, don’t pass the -K/-k flag

hlolli18:06:45

oh, I thought lumo would do it anyway, just if it would be automatic or not :slightly_smiling_face: nice I try that!

anmonteiro18:06:02

caching is opt-in

anmonteiro18:06:20

it’s off by default

hlolli18:06:24

I could cache once, and use small -k to point to a pre-cached directory, and it wont recache?

anmonteiro18:06:01

if the file has changed from the cached version, it will recompile & re-cache

anmonteiro20:06:11

@moxaj are you still thinking about working on the tagged literal stuff?

moxaj20:06:26

@anmonteiro sure! I was abroad for a few days, so no progress was made

anmonteiro20:06:09

just wondering if I should add it to my queue or not :slightly_smiling_face:

moxaj20:06:49

if your hands are empty, i'm not going to fight for it :slightly_smiling_face: otherwise, I can give it another shot tomorrow

anmonteiro20:06:16

@moxaj you’re welcome to do it. happy to provide any guidance should you need it

moxaj20:06:01

alright. later then

hlolli21:06:13

any caveats to connecting to the socket repl, trying this js snippent

//client.js
var io = require('socket.io-client');
var socket = io.connect('',
			{reconnect: true});

// Add a connect listener
socket.on('connect', function (socket) {
  console.log('Connected!');
});


socket.emit(`(println "Hello Lumo!")`)
nothing prints on either side (telnet works, so its running).

anmonteiro22:06:59

you might not be redirecting streams in http://socket.io?