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
chexum has quit [Remote host closed the connection]
chexum has joined #picolisp
genpaku has quit [Remote host closed the connection]
Iacob has quit [Remote host closed the connection]
genpaku has joined #picolisp
Iacob has joined #picolisp
Iacob has quit [Quit: IRCNow and Forever!]
Iacob has joined #picolisp
rob_w has joined #picolisp
<Hunar> Hello. This code causes stack overflow, is it outdated?
<tankf33der> I know this task
<tankf33der> Full version in tests for long time
<abu[m]> Looks good
<abu[m]> I tried here. Building the doubly linked list works fine
<abu[m]> Just printing it goes into an infinite loop
<abu[m]> Which is correct I think
<tankf33der> Correct, because have wrong layers
<tankf33der> print supports flat layer only
<abu[m]> T
<tankf33der> rosettacode have a print function for this structure
<abu[m]> and circular lists
<abu[m]> yeah, a complete set of functions for doubly linked lists
<Hunar> Ah, my mistake then :) the terminal prints the result of setq
<abu[m]> Hunar: Do you really need doubly linked lists? Usually it is better to use symbols (objects) with properties linking to each other
<Hunar> I dont :) I was just curious
<abu[m]> Good ☺
<beneroth_> I also get a stackoverflow in the repl just from executing the code
<Hunar> (prog (setq ...) NIL) was fine
<beneroth_> the (chain) looks also wrong to me, couldn't it be simpler with (link) ?
<beneroth_> ah okay
<beneroth_> that makes sense
<beneroth_> but the rosetta code crashing the repl is not really nice.
<abu[m]> yes, cause the REPL prints it
<beneroth_> yeah, but the rosetta code should not crash. the (setq ...) in the end should be corrected :P
<abu[m]> Rosetta should also include the 'prog' as Hunardid
<beneroth_> exactly
<abu[m]> But may confuse a reader
<Hunar> I remembered a question I had abu can I overwrite the printing functionality of the repl? for example I have a custom class, when I enter the object in repl I want a my custom printing function to run on the object, as if I typed (myPrint *Object)
<beneroth_> crashing is more confusing I would say
<abu[m]> depends. Most people only read rosetta
<beneroth_> what is code worth without evaluating it
<abu[m]> Hunar: No, the printing is hardcoded
<beneroth_> abu[m], so it doesn't use prin/print etc ?
<abu[m]> I think there is no hook
<abu[m]> It uses 'print' but calls it directly
<beneroth_> Hunar, then don't use the repl printing but do your own. in your code you can change/hide/redefine all built-ins
<abu[m]> not via a symbol binding iirc
<beneroth_> yeah makes sense
<beneroth_> using the symbol would give the hook
<abu[m]> right
<abu[m]> The printing is done in stdEval
<abu[m]> : (vi 'llvm~stdEval)
<Hunar> Thanks for the info :)
<abu[m]> You always have intersting questions ☺
<Hunar> :) I'm building an Artificial Neural Network thing, with backpropagation .. I used a normal list to build matricies but printing them was not fun in the repl
<abu[m]> cool
<Hunar> should be ready in a day or two
<abu[m]> Perhaps better use symbols
<abu[m]> it is not much overhead
<abu[m]> a symbol takes one cell
<abu[m]> and each propery also one
<abu[m]> A good example is simul~grid
<abu[m]> doubly linked lists in 2 dimensions
<Hunar> I'll try to make a clean program once finished :)
<Hunar> question, is this a bad practise: '((A B) '((A B) (...)) ) function in function with same parameter names?
<abu[m]> This is all right
<Hunar> Great, I hate thinking a about other names
<abu[m]> me too :)
<abu[m]> In this case you mean a function building another function?
<Hunar> No. let me show you this mess of code :) I will turn most of them into a single function later
<Hunar> I just feel like there is a better way, seeing all those (A B)s look wrong
<Hunar> Just an elementwise multiplication of two two-dimentional lists
<abu[m]> Technically fine. I usually use something like LstA to indicate it expects a list
<Hunar> Great :D I'll name a generalized version like (nestedMapcar '+ ListA ListB)
brandelune has joined #picolisp
brandelune has quit [Quit: This computer has gone to sleep]
brandelune has joined #picolisp
brandelune has quit [Quit: This computer has gone to sleep]
<abu[m]> 😨 Found yet another gc bug!
<abu[m]> Fixed now
<abu[m]> It crashed in 'gc' if such an expression was being read: (~(as A b c) d e f)
<abu[m]> i.e. if the CAR of the list was a tilde read macro
brandelune has joined #picolisp
v_m_v has joined #picolisp
<beneroth_> oh wow
<beneroth_> abu[m], only pil21, right?
<beneroth_> thanks for fixing :)
<abu[m]> Yes, only pil21
<abu[m]> It happens very seldom
<abu[m]> Saw this at BTG occasionally, so I generated core dumps and investigated
rob_w has quit [Quit: Leaving]
v_m_v has quit [Remote host closed the connection]
<tankf33der> All tests passed
<abu[m]> Great, thanks!
<beneroth_> thanks tankf33der !
pfd has joined #picolisp
brandelune has quit [Quit: This computer has gone to sleep]
beneroth_ has quit [Quit: Leaving]
beneroth has joined #picolisp
pfd has quit [Ping timeout: 260 seconds]
brandelune has joined #picolisp
brandelune has quit [Quit: This computer has gone to sleep]