<abu[7]>
Perhaps 'view' is better to communicate in IRC:
<abu[7]>
: (setq L '(a (b . c) d))
<abu[7]>
-> (a (b . c) d)
<abu[7]>
: (view L)
<abu[7]>
+-- a
<abu[7]>
|
<abu[7]>
+---+-- b
<abu[7]>
| |
<abu[7]>
| c
<abu[7]>
|
<abu[7]>
+-- d
<abu[7]>
-> NIL
<abu[7]>
-> xyz
<abu[7]>
: (set (cdr L) 'xyz)
<abu[7]>
: (view L)
<abu[7]>
Throttled :(
<abu[7]>
Shorter bits:
<abu[7]>
: (setq L '(a (b . c) d))
<abu[7]>
-> (a (b . c) d)
<abu[7]>
: (view L)
<abu[7]>
+-- a
<abu[7]>
|
<abu[7]>
| |
<abu[7]>
+---+-- b
<abu[7]>
| c
<abu[7]>
|
<abu[7]>
+-- d
<abu[7]>
<abu[7]>
: (set (cdr L) 'xyz)
<abu[7]>
-> xyz
<abu[7]>
: (view L)
<abu[7]>
+-- xyz
<abu[7]>
+-- a
<abu[7]>
|
<abu[7]>
|
<abu[7]>
+-- d
<abu[7]>
<abu[7]>
<abu[7]>
: (setq L '(a (b . c) d))
<abu[7]>
-> (a (b . c) d)
<abu[7]>
: (set (cadr L) 'xyz)
<abu[7]>
-> xyz
<abu[7]>
+-- a
<abu[7]>
| |
<abu[7]>
|
<abu[7]>
: (view L)
<abu[7]>
+---+-- xyz
<abu[7]>
| c
<abu[7]>
|
<abu[7]>
+-- d
<abu[7]>
Still ugly :(
rob_w has quit [Remote host closed the connection]
fuxoft has joined #picolisp
<fuxoft>
Huh, now I see that some of my replies probably didn't go through because I don't see them in the chat archive. Thank you very much, I will try reading through all that again.
fuxoft has quit [Client Quit]
<abu[7]>
Strange
<abu[7]>
Anyway ask whenever you are back. I try to explain better :)
rob_w has joined #picolisp
beneroth has quit [Ping timeout: 276 seconds]
beneroth has joined #picolisp
corecheckno has quit [Remote host closed the connection]
fuxoft has joined #picolisp
<fuxoft>
I am back. :)
<fuxoft>
Let me know if I understand this correctly (hopefully).
<fuxoft>
* "var" can be a symbol or a pair
<abu[7]>
Right :)
<fuxoft>
* If var a is symbol, the function (e.g. "(pop)") operates on its value
<abu[7]>
Yes
<fuxoft>
* if var is a pair, the function operates on its CAR
<abu[7]>
Exactly
<fuxoft>
* The implementation remains the same in both cases because PicoLisp just works with the raw pointer to the structure, WITHOUT ZEROING THE BOTTOM 4 BITS. That means the pointer points to Value in the case of Symbol and to CAR in the case of Pair
<abu[7]>
Perfect!
<fuxoft>
Great. So to understand how the hell this works, it helps to have fairly good understanding of the low level cell structure. :)
<abu[7]>
Yes, it is the core of undersianding the machinery
<abu[7]>
That's why I said some
<abu[7]>
times
<abu[7]>
that doc/structures *is* picolisp
<abu[7]>
The rest is just examples
<fuxoft>
The more I understand it the more I am amazed at the low-level elegance of PicoLisp. Pity I didn't know about it 20 years ago when my brain worked better...
<abu[7]>
☺
fuxoft has quit [Quit: Client closed]
gahr has quit [Quit: leaving]
gahr has joined #picolisp
aw- has quit [Ping timeout: 244 seconds]
aw- has joined #picolisp
rob_w has quit [Read error: Connection reset by peer]
lagash has quit [Remote host closed the connection]