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
pablo_escoberg has joined #picolisp
aw- has quit [Ping timeout: 248 seconds]
aw- has joined #picolisp
seninha has quit [Quit: Leaving]
pablo_escoberg has quit [Ping timeout: 246 seconds]
clacke has joined #picolisp
<abu[7]> pablo_escoberg: Read up again https://software-lab.de/doc/ref.html#symbol, try to really grok it
<abu[7]> and https://software-lab.de/doc/ref.html#fun the explanation of 'var'
<abu[7]> Then look up the ref of 'car' and 'cdr'
pablo_escoberg has joined #picolisp
<pablo_escoberg> OK, I've read through again, and I guess the answer to my questions is "no, only get/put allow access to the properties list."  But now I'm confused about the definition of 'var' and what happens when it's a cons pair.  I'll play around some more.
<abu[7]> Well, there are two other ways
<abu[7]> one is 'getl'
<abu[7]> and the other 'adr' plus 'struct'
<abu[7]> The latter is not intended for normal use
<pablo_escoberg> ok.  got it.  But one more thing:  how does 'a differ from (quote a) ?
<abu[7]> Perhaps this explanation helps: 'var' is *always* a pointer to a value
<abu[7]> (quote a) is '(a)
<pablo_escoberg> aha!
<abu[7]> ' is (quote . a)
<abu[7]> 'a is (quote . a)
<abu[7]> That's why we have a REPL
msavoritias has joined #picolisp
<pablo_escoberg> ah, yes, I remember now.
<abu[7]> : '(quote a)
<abu[7]> -> '(a)
<abu[7]> : '(quote . a)
<abu[7]> -> 'a
<pablo_escoberg> right.  the surprising thing is the latter, because the reverse doesn't hold.
<abu[7]> Which reverse?
<abu[7]> Thoug ' is a read macro, 'print' is special here as it also outputs it
<abu[7]> Perhaps this is a bit surprising
<pablo_escoberg> : '(a)
<pablo_escoberg> -> (a)
<abu[7]> : (quote quote quote . a)
<abu[7]> -> ''a
<abu[7]> Same as
<abu[7]> : (quote . (quote . (quote . a)))
<abu[7]> -> ''a
<pablo_escoberg> That gives no hint that :
<pablo_escoberg> : '(quote . a)
<pablo_escoberg> -> 'a
<pablo_escoberg> this is a surprising thing to me
<abu[7]> Keep in mind that it is read-eval-print
<abu[7]> '(a) evaluated gives (a), right?
<pablo_escoberg> right
<abu[7]> : (read)
<abu[7]> (quote . a)
<abu[7]> -> 'a
<abu[7]> This is read + print without eval
<abu[7]> so you see that (quote . a) is 'a
<pablo_escoberg> ok, I think I get it.  Need to process a bit.
<pablo_escoberg> TY
<abu[7]> welcome :)
<abu[7]> It really boils down to understanding read, eval and print
<abu[7]> And the cell structures of symbols and lists
<abu[7]> The VAL of a symbol is the CDR of its cell
<abu[7]> so (car Sym) gives the value (see dth diagram in the reference)
<pablo_escoberg> seems that way, but I'd go further than "understand" and say "internalize".  It's slowly becoming second nature (emphasis on "slowly")
<abu[7]> Yeah, internalize is a better term
<pablo_escoberg> "The VAL of a symbol is the CDR of its cell," which is why it's really surprising that `car` returns that val!
<abu[7]> yeah
<abu[7]> 'car' returns whatever the pointer points to
<abu[7]> 'cdr' takes an offset of 8 bytes and accesses that, which is nirvana in case of a symbol
<abu[7]> 'car' is what *p is in C
<abu[7]> 'val' is a synonym
<abu[7]> 'val' is just different for external symbols
<abu[7]> That's why it exists
<pablo_escoberg> oh, ok.   I sometimes wonder if some of these functions are just synonyms...
<pablo_escoberg> so `pair` and `lst?` are the same thing, right?
<abu[7]> I think there are no really redundant functions
<abu[7]> No
<abu[7]> 'lst?' is NIL or pair
<abu[7]> (de lst? (X) (or (not X) (pair X)))
<abu[7]> or shorter (de lst? (X) (nand X (atom X)))
<abu[7]> (pair X) is (not (atom X))
<pablo_escoberg> ah, ok. so no real synonyms (at least universally).  That helps.
<abu[7]> I believe so
<abu[7]> (that no funs in the core are direct synonyms)
<pablo_escoberg> great.  I will always look for the subtle differences, then.
<abu[7]> T
<aw-> pablo_escoberg: you're asking good questions, keep at it
<abu[7]> indeed!
msavoritias has quit [Ping timeout: 256 seconds]
pablo_escoberg has quit [Quit: Client closed]
pablo_escoberg has joined #picolisp
<pablo_escoberg> Thanks!  Good to know I'm on the right track.
msavoritias has joined #picolisp
msavoritias has quit [Ping timeout: 258 seconds]
msavoritias has joined #picolisp
msavoritias has quit [Ping timeout: 244 seconds]
seninha has joined #picolisp
seninha has quit [Remote host closed the connection]
seninha has joined #picolisp
msavoritias has joined #picolisp
msavoritias has quit [Remote host closed the connection]
pablo_escoberg has quit [Quit: Client closed]
Iacob has quit [Remote host closed the connection]
user3456 has joined #picolisp
chexum_ has quit [Remote host closed the connection]
chexum has joined #picolisp
Iacob has joined #picolisp