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
aw- has quit [Quit: Leaving.]
schulze has quit [Ping timeout: 252 seconds]
Hunar has joined #picolisp
<Hunar> Hello :)     Regenaxer is there a way to view the underlying structure of the cells? I mean when the (doc) explains the picolisp machine, it mentions the pointers in binary and how they are connected with each other and how each datatype is represented .. is there a way for example to see a bignum cells, with each cell pointers bits binary?
<Regenaxer> Good morning Hunar!
<Regenaxer> You can do that with 'adr' and 'byte' or 'struct'
<Regenaxer> A bignum cannot be accessed directly, but via the value of a sym or the CAR of a cell for example
Hunar71 has joined #picolisp
Hunar has quit [Ping timeout: 256 seconds]
Hunar71 is now known as Hunar
<Hunar> Is this correct?     (setq A 5)   (bin (adr (sym A)))
<Regenaxer> Why 'sym' of a number#
<Regenaxer> ?
<Regenaxer> (adr 'A) gives a pointer to 'A'
<Hunar> I just want to see how a symbol's cell is represented in binary
<Hunar> I can read the documentation of course :)  but just wanted to see it in pil for fun
<Regenaxer> yeah
<Regenaxer> : (setq A 5)
<Regenaxer> -> 5
<Regenaxer> : (struct (adr 'A) T)
<Regenaxer> -> 5
<Regenaxer> (adr 'A) points to the value part
<Regenaxer> (- (adr 'A) 8) points to the tail
<Regenaxer> To see all 16 bytes of the symbol:
<Regenaxer> : (mapcar hex (struct (- (adr 'A) 8) '(B . 16)))-> ("12" "4" "0" "0" "0" "0" "0" "0" "52" "0" "0" "0" "0" "0" "0" "0")
<Regenaxer> ("12" "4") is the encoding of the symbol name "A" as a short num
<Regenaxer> "52" is the short num '5'
<Hunar> why 52 is 5? is short num a different thing than normal representation?
<Regenaxer> Take a look into doc/structures
<Hunar> Ok :)
<Regenaxer> 'cnt' is short num
<Regenaxer> ...xxxxS010
<Regenaxer> So the lowest nibble is 0010 or 2
<Regenaxer> (S is the sign)
<Regenaxer> hex 52 is the value shifted left by 4 plus the four tag bits
<Regenaxer> Same for the name "A"
<Regenaxer> : (hex (+ 2 (>> -4 (char "A"))))
<Regenaxer> -> "412"
<Regenaxer> It gives the bytes ("12" "4") in little endian
<Hunar> Thank you very much :D  now it's very clear
<Regenaxer> :)
<Regenaxer> Hello tankf33der! Are you here?
<Hunar> Extra questions: you said 16 bytes, so that's a complete cell 128bits instead of only head or tail right? ..  I made this  (pack (mapcar '((N) (pad 8 (bin N))) (struct (- (adr 'A) 8) '(B . 16))))  but it's not what I want, I want to output the format that is used in the documentation  xxxxx...xxxS010  I have to reorder the bytes right?
<Hunar> changing the 16 bytes from  A B C D E F G H - I J K L M N O P      to       H G F E D C B A - P O N M L K J I
<tankf33der> Morning all
<tankf33der> here
<Hunar> Good morning tankf33der :)
<Regenaxer> Hi tankf33der! I changed a lot in the base system (see mailing list). Can you run your tests?
<Regenaxer> Hunar, yes, one cell
<Regenaxer> Yes, little endian
<Regenaxer> better fetch two longs
<Regenaxer> (struct ... '(N . 2))
<Hunar> Yeah that was much better :D
<tankf33der> Regenaxer: all passed
<Hunar> I got what I want :D   (setq A 5)   (de viewCell (Var) (let Cell (struct (- (adr Var) 8) '(N . 2)) (pack (pad 64 (bin (car Cell))) " | " (pad 64 (bin (cadr Cell))))))   (viewCell 'A)
<Hunar> ->  "0000000000000000000000000000000000000000000000000000010000010010 | 0000000000000000000000000000000000000000000000000000000001010010"
<Regenaxer> tankf33der, thanks!!
<Regenaxer> Cool Hunar :)
Hunar has quit [Ping timeout: 256 seconds]
aw- has joined #picolisp
schulze has joined #picolisp
aw- has quit [Quit: Leaving.]
TeddyDD has joined #picolisp
clacke has joined #picolisp
<beneroth> [INFO] Jitsi is currently down, working on it.
<Regenaxer> Oh
<Regenaxer> Thank you!
<razzy> Regenaxer: where do you execute gz command? for temporary backgrounding vip? I have troubles :]
<Regenaxer> It makes sense only inside the REPL of a running application
<Regenaxer> Stand-alone Vip just terminates I think
<Regenaxer> With gz you are back in the REPL
<razzy> ^G ^Z background with pil REPL
<Regenaxer> ^G does nothing I think
<Regenaxer> ^Z is the standard SIGSTPT signal
<razzy> i see.
<Regenaxer> ie. back to Unix shell
<razzy> yep
<razzy> gz in vip does nothing
<Regenaxer> ah
<Regenaxer> sorry
<Regenaxer> "q"
<Regenaxer> qz
<razzy> :D nice
<razzy> Regenaxer: i sometimes go sideways in my tasks, so sometimes it takes a while before i test it :]
<razzy> Regenaxer: thank you
<Regenaxer> Sideways how?
<razzy> different problems, tasks, i put a note and pick it up later
<Regenaxer> ah, ok
<Regenaxer> me moo
<Regenaxer> too
<Regenaxer> The line in Vip is:
<Regenaxer> ("z" (run *TStp1) (yield) (run *TStp2)) # [qz] Suspend
<Regenaxer> So it stops in (yield)
beneroth has quit [Ping timeout: 256 seconds]
inara has quit [Quit: Leaving]
inara has joined #picolisp
beneroth has joined #picolisp