beneroth changed the topic of #picolisp to: PicoLisp language | The scalpel of software development | Channel Log: https://libera.irclog.whitequark.org/picolisp | Check www.picolisp.com for more information
bjorkintosh has quit [Quit: "Every day, computers are making people easier to use." David Temkin]
bjorkintosh has joined #picolisp
bjorkintosh has joined #picolisp
Iacob has quit [Ping timeout: 265 seconds]
Iacob has joined #picolisp
elnegro has joined #picolisp
elnegro has left #picolisp [#picolisp]
geri has joined #picolisp
<geri> hey, im working on my lsp server and for some reason i have some weird bug
<geri> line in handle-request, line ~30
<geri> here's what i read from the client
<geri> if i do (get (cdr Msg) "method") in repl it works
<geri> sometimes? xd
<geri> (get (in "out.l" (read)) "method") also works
<abu[7]> I haven't investigated your source, put note that 'get' uses ==
rob_w has joined #picolisp
<abu[7]> So it depends on the scope
<abu[7]> of eg transients
<geri> is there a get with "="
<abu[7]> assoc
geri` has joined #picolisp
<geri> okay it seems assoc worked
<geri> so weird
<geri> those transients are read in the same file...
<abu[7]> You don't use 'read'
<abu[7]> so transients are not interned
<geri> hm
<abu[7]> into transient ns
<geri> okay
geri` has left #picolisp [#picolisp]
<geri> well, calling (read) on resulting structure would be rather wasteful as well
<geri> so assoc it is
<abu[7]> T
<geri> oh wow, get can give you nth element as well
<geri> didn't know
<abu[7]> (cdr (assoc))
<geri> yeah
<abu[7]> Especially useful in 'get', ':' etc. it that they allow chaining
<abu[7]> (: Var foo -1 bar 7 blub)
<geri> yeah...
<geri> too bad cant use it with my transients as keys
<abu[7]> T
<abu[7]> That's why the pil json lib uses 'read' and internals
<geri> can you intern transients otherwise
<abu[7]> Did not continue with that matrix lib
<abu[7]> Yes
<geri> (intern)?
<abu[7]> (intern "car")
<geri> will it intern 'car or "car"?
<abu[7]> ((intern "car") Lst)
<geri> okay, so it'll return 'car
<geri> but i need to intern into transients
<abu[7]> This is not possible
<geri> eh
<geri> i could maybe just (read) resulting structure at the end of (json-read) or something
<geri> wasteful though
<abu[7]> Transients are by definition not "interned"
<geri> okay..
<abu[7]> Why not intern "really"?
<abu[7]> Some namespace
<geri> then cant differentiate between json "null" and null
<abu[7]> (symbols 'json ...)
<geri> and same with false/true
<geri> tough
<abu[7]> I think null and false/true is never needed
<abu[7]> for an app
<geri> XD
<geri> i literally need it for the lsp server
<abu[7]> Lisp has to interprete the data anyway
<abu[7]> What actually is a "lsp" server?
<geri> language server protocol
<geri> it's for completions and stuff
<geri> like every non-trivial editor nowadays has a client for it
<geri> it may be useless though cause maybe picolisp is too dynamic to make use of it
<abu[7]> I see
<geri> but we'll see that when it's at some usable state
<abu[7]> ok
<geri> maybe ill have to implement a get using = for tests
<abu[7]> Why not use a separate namespace for the Json symbols?
<geri> will i be able to == null in json and null created by user?
<abu[7]> Why not?
<geri> cause maybe null is defined and used in some other namespace?
<geri> + when null read into pico namespace may be different from null in another namespace, no?
<abu[7]> That's the idea and purpose of namespaces
<geri> exactly
<abu[7]> Keep symbols with same names separate
<geri> then i won't be able to use == on the nulls and everything breaks
<geri> could re-encode null as ("null") or something, then "null" is different from null
<geri> hm
<geri> uncomfy
<abu[7]> I don't understand why "null" is needed
<geri> *because its part of the standard*
<abu[7]> Can't all be intern?
<abu[7]> You get an internal \"null\" then
<geri> what if someone wants to parse a string "null"?
<geri> the idea was to make it as compliant to standards as possible first and foremost
<geri> now gotta think about usability without sacrificing what we do have..
<abu[7]> ok
<geri> how do i print something to both stdout and stderr at the same time?
<geri> (let) over the contents and then do (out 0/2 ...) twice?
<abu[7]> Best is to start as pil ... 2>&1 >log
<geri> and if from picolisp itself?
<abu[7]> Hmm, perhaps with a dup call?
<abu[7]> 'fd'
<abu[7]> haven't tried
<geri> didn't seem to work
<geri> well, a bit tired, gonna go read smth
<abu[7]> right
<abu[7]> ok :)
<geri> (setq "hi" T)
<geri> -> T
<geri> -> T
<geri> : "hi"
<geri> why does this work if transient symbols are not interned?
<geri> something something about *Transient?
<abu[7]> They *are* interned in a local scope
<abu[7]> repl-local
<geri> local scope is per-file?
<abu[7]> per REPL
<abu[7]> can be cut off with (====)
<geri> hm
<geri> per REPL like, i started pil, and until i exit itll be interned? or like per process
<abu[7]> no
<abu[7]> REPL is 'load'
<abu[7]> An empty line in TTY stop the REPL too and starts a new one
<abu[7]> Wait, forget that
<geri> forgot
<geri> :D
<abu[7]> This was only in pil32/pil64
<abu[7]> pil21 improved on that. Transient scope is per 'load', but is preserved now over nesded 'load's
<abu[7]> So unless (====) is called, the scope of a transient symbol can be regarded local to this 'load'
<abu[7]> ('load' may not just be a file)
<abu[7]> bbl
<geri> oki
<abu[7]> ret
<geri> o7
<abu[7]> :)
rob_w_ has joined #picolisp
rob_w_ has quit [Ping timeout: 246 seconds]
bjorkintosh has quit [Quit: "Every day, computers are making people easier to use." David Temkin]
geri has quit [Ping timeout: 245 seconds]
theruran has joined #picolisp
rob_w has quit [Read error: Connection reset by peer]
<viaken> I can't for the life of me figure out how (cookie) is supposed to work. Using transients threw an error that looked like it expected interned symbols, but that said they were undefined even with a (let) wrapping the (cookie). What I was trying to do was have the cookie get set in response to a button press; should I be using JS instead?
<viaken> (Not in general, just to set the cookie)