@cgrand trying out plain-repl:
WARNING: Use of undeclared Var lumo.repl/load-data-readers! at line 110 plain_repl/lumo.cljs
events.js:182
throw er; // Unhandled 'error' event
^
Error: This socket has been ended by the other party
at Socket.writeAfterFIN [as write] (net.js:352:12)
at plain_repl$lumo$accept_$_epl (evalmachine.<anonymous>:653:8)
at evalmachine.<anonymous>:294:11
at Socket.<anonymous> (evalmachine.<anonymous>:101:10)
at emitNone (events.js:110:20)
at Socket.emit (events.js:207:7)
at endReadableNT (_stream_readable.js:1059:12)
at _combinedTickCallback (internal/process/next_tick.js:138:11)
at process._tickDomainCallback (internal/process/next_tick.js:218:9)
and in nc
: #object[TypeError TypeError: Cannot read property 'call' of undefined]
this is on lumo 1.7.0 - are you on 1.8 beta?
I’m using lumo master
I'll try 1.8.0 beta
(as of weeks ago)
that works
pretty cool. I noticed it ends the lumo process when I type ^D
but other than that it works
trying to wrap my head around what this does though haha
haha found a new minimal formulation!
@pesterhazy hi 😉
Hi
Saw plain repl nice!
@richiardiandrea I’ve found a better way.
Better = simpler api and less impact on lumo
Does unrepl.el
currently support sending new deps to a running SOCKET repl?
@cgrand would love to try that ;)
darn! I was hoping to use the image rendering feature of unrepl.el
to generate graphs of datomic query results but my datomic SOCKET repl is bare bones.
lol may have to use unravel to send deps and then unrepl.el
to render graphs once deps are available
@gcast yes, you can even add to the classpath while the repl is running
But no packed printing
@cgrand yes to my hacky workaround or yes to sending deps to socket repl using unrepl.el
@gcast no to your hacky workaround, because of classpath isolation deps added in one repl may not be visible on another (once loaded generally they are but in subtle cases it may fail)
so unrepl.el
allows extending the classpath, even while the repl is already running
@pesterhazy @volrath, @gcast is the happy unravel user/evangelist I talked about earlier
@richiardiandrea I pushed a WIP which you may help with (a problem with ns not being set after eval)
however the new design is ok
Ok cool let my try that
Quick explanation: https://github.com/Unrepl/plain-repl/blob/master/src/plain_repl/min.cljs is impl agnostic stuff that should be better added to cljs but in the meantime, why not spawn this file in a standalone dep
No more *in*
as I’ve been struggling to fine an ok way to manage (or arather encourage) exclusive ownership of a global resource
So when eval retuns a suspension it means the host repl must pause and yield control to the suspension, passing in
as an argument.
https://github.com/Unrepl/plain-repl/blob/master/src/plain_repl/repl/lumo.cljs is the platform specific code
Ok cool, so what about ns problem you have?
In eval I always get nil out for ns
There are minor ns conveyance issues but the crux is that one.
Ok, almost in front of my pc
is the branch on lumo
?
cannot find branches in plain-repl
(also why plain 😄 ?)
oh got it, no unrepl..
This file https://github.com/Unrepl/plain-repl/blob/master/src/plain_repl/repl/lumo.cljs
so yes basically by using that eval
you are changing the global *ns*
...which is kept in https://github.com/anmonteiro/lumo/blob/master/src/cljs/snapshot/lumo/repl.cljs#L41
(btw sorry if I say something you know already)
it seems to me that your "sessions" should have their own current-ns
getter
I was on my phone so giving you details was arduous.
in eval
, before calling cljs/eval
, current-ns
contains 'cljs.user
and both *ns*
and ana/*cljs-ns*
have been set. When cljs/eval
returns the value for key :ns
is nil
. No matter what I eval (even if it changes the current namespace).
Uhm ok will look into that
found
there are too many eval
s in cljs.js
-> discrepancies
I pushed the fix.
yes I was following the dots as well 😉
oh you were using eval from cljs.js
gotcha
uhm..stiill not working here...
how?
the accept ns has changed
(I just edited the README)
ok let me see if I am doing it right
lumo -c src/ -n ‘{“port”: 5557, “accept”: “plain-repl.repl.lumo/accept”}’
$ nc localhost 5557
cljs.user=> (+ 3 4)
7
cljs.user=> (ns foo.bar)
nil
foo.bar=> *ns*
#object[cljs.core.Namespace]
foo.bar=> (ns-name *1)
foo.bar
foo.bar=>
ok that works, the client side in the README throws:
return caught_SINGLEQUOTE_.call(null,e,rrepl);
^
TypeError: Cannot read property 'call' of null
at plain_repl$repl$caught (evalmachine.<anonymous>:471:28)
at plain_repl$repl$pl (evalmachine.<anonymous>:436:15)
at plain_repl$repl$then_pl (evalmachine.<anonymous>:429:11)
at plain_repl$repl$lumo$eval (evalmachine.<anonymous>:229:4)
at plain_repl$repl$epl (evalmachine.<anonymous>:410:26)
at evalmachine.<anonymous>:241:11
at evalmachine.<anonymous>:156:11
at plain_repl.repl.lumo.bytes_stream_reader.cljs$core$IFn$_invoke$arity$2.plain_repl.repl.lumo.t_plain_repl$repl$lumo60.plain_repl$min$AsyncReader$read_chars$arity$2 (evalmachine.<anonymous>:102:10)
at plain_repl$min$read_chars (evalmachine.<anonymous>:14:10)
at plain_repl$repl$skip_if_eol (evalmachine.<anonymous>:149:34)
I also tried (in-ns 'foo.bar)
and it hangs...should be because it is a special function
Oh I haven’t tried exception, looks like I have a bug.
No in-ns
I'm trying out unravel
for the first time but it doesn't seem to work with my basic socket repl:
unravel localhost 50505
evalmachine.<anonymous>:22
var reader = cljs.reader.push_back_reader.call(null,s);
^
TypeError: Cannot read property 'call' of undefined
at unravel$lisp$safe_read_string (evalmachine.<anonymous>:22:42)
at Transform._transform (evalmachine.<anonymous>:56:60)
at Transform._read (_stream_transform.js:186:10)
at Transform._write (_stream_transform.js:174:12)
at doWrite (_stream_writable.js:385:12)
at writeOrBuffer (_stream_writable.js:371:5)
at Transform.Writable.write (_stream_writable.js:288:11)
at Transform.ondata (_stream_readable.js:642:20)
at emitOne (events.js:115:13)
at Transform.emit (events.js:210:7)
I installed this with brew install
, is there potentially a lumo problem at play?
$ unravel --version
Unravel 0.2.2 (Lumo 1.7.0)
I may be burying the lead with my repl impl.
@aengelberg better build from source
(Give the packed-printing branch a try :-) and you have to launch it with —flag packed
to enable it.