<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