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
clacke has joined #picolisp
seninha has quit [Remote host closed the connection]
heartburn has joined #picolisp
heartburn has left #picolisp [#picolisp]
rob_w has joined #picolisp
clacke has quit [Remote host closed the connection]
chexum has quit [Ping timeout: 255 seconds]
chexum has joined #picolisp
seninha has joined #picolisp
seninha has quit [Quit: Leaving]
seninha has joined #picolisp
seninha has quit [Client Quit]
seninha has joined #picolisp
rob_w has quit [Remote host closed the connection]
<Hunar> Hello :) why (= (quote NIL) ()) is false but (= 'NIL ()) is true?
<abu[m]> Hi ! (quote NIL) is in fact '(NIL)
<abu[m]> You mean (quote . NIL)
<abu[m]> This behavior of quote is different from other Lisps
<abu[m]> (quote a b c) is '(a b c)
<Hunar> Aha
<Hunar> I was following a code that implements lisp interpreter, when I finished it had a bug where in his interpreter (EQ (QUOTE NIL) ()) was true while mine resulted in false.. I couldn't figure out why so checked out what pil says
<abu[m]> Is NIL in that version not auto-quoting?
<Hunar> It doesnt even have NIL :) the only boolean is () or not ()
<abu[m]> BTW, 'EQ' in other Lisps is '==' in Pil, not '='
<Hunar> but his code doesn't have a special code for handling NIL, or I missed it
<abu[m]> '=' is 'EQUAL'
<abu[m]> But probably EQUAL also does not exist
<Hunar> Ah, never used ==
<Hunar> yeah, only EQ .. its that lisp I talked about a while ago called sectorLisp which fits into a boot sector
<abu[m]> yes, cool thing
<Hunar> for some reason my head cant implement an eval, even for that simple lisp
<abu[m]> EQUAL is implemented with EQ and recursion anyway (also in Pil)
<abu[m]> Where do you have trouble with EVAL?
<abu[m]> It needs some funcall primitive
<abu[m]> and checks for atoms etc.
<Hunar> I don't know where my problem is.. I implemented it in python because implementing lisp in lisp is very easy.. the code is finished, works with small programs but bigger programs reach maximum recursion depth.. I have no idea how to debug such thing
<Hunar> Python by default has max recursion=1000 which I can change, but I think it shouldn't reach that level
<abu[m]> right
<abu[m]> The recursion in EVAL must bottom out upon an atom
<abu[m]> Atoms eval to their value, otherwise recurse on the args and call a function
<Hunar> I THINK the problem is in ASSOC which is used for storing and loading variable values. I think it grows like a memory leak, it uses a recursing to search through it
<Hunar> very weird.. I'll not take your time anymore :) thanks
<abu[m]> No worry, I like such issues ☺
<abu[m]> So this Lisp uses an association list for the binding environment
<abu[m]> kind of standard, but very slow
<Hunar> Yeah very slow.. here is the lisp that would run itself in itself http://ix.io/4j2K .. and my implementation in python http://ix.io/4j2L
<Hunar> the lisp version is unreadable in my eyes
<Hunar> the problem happens when I try to run the lisp code in my lispInterpreter which would be lisp in lisp in lisp :|
<abu[m]> Yeah, needs quite some time to dig in ;)
<Hunar> :) yeah, I'll give my brain afew more days to figure it out
<abu[m]> In Pil 'eval' would be:
<abu[m]> (de eval (X) (cond ((num? X) X) ((sym? X) (val X)) (T (apply (car X) (mapcar (eval (cdr X)))))))
<abu[m]> ☺
<Hunar> That's Cool :D
theruran has quit [Quit: Connection closed for inactivity]
theruran has joined #picolisp
razzy has joined #picolisp
<razzy> hello, I have trouble. I want to save file in vip with one key under different filename. example.txt i want to save example.txt-- i am unable to change vip code to do so.
<abu[m]> You mean the same as ":w example.txt-" ?
<razzy> yes, but with one key
<razzy> i can save current file. i had no luck changing name.
<abu[m]> So 'map'?
<abu[m]> :map @ :w file^V<return>
<abu[m]> then @ saves to "f"
<abu[m]> What do you mean with "changing name"? Another issue?
<razzy> abu[m]: i think :map would be bloated. I also want more code before and after the file save.
<beneroth> I understand razzy as hardcoding an additional key shortcut to do something with a filename before saving
<abu[m]> btw, ":bak" also writes <file>- (i.e. with "-" at the end)
<razzy> bak just copy file that already exists imho
<abu[m]> makes a backup
<abu[m]> so further changes can be seen with F2
<abu[m]> and ":kab" reverts changes
<razzy> the whole story: i have changed buffer, i want to save changes to file-- diff file file--, delete file--. human file save.
<razzy> 2 keys total for whole bak kab diff wite thing
<abu[m]> Good, so something like the above 'map'
<abu[m]> :map @ ....
<razzy> i can try map.
<abu[m]> or (cmd "foo" ...) ?
<abu[m]> not single-key though, but :foo
<razzy> i was hoping for something like this http://ix.io/4j3v
<abu[m]> Why not use :bak etc?
<razzy> :bak leaves file- that i need to take care afterwards
<abu[m]> ok, for me it is important to always keep the last version, so I have a %- for *every* file I edit
<razzy> and i edit messy files with weird characters, i want to be sure about changes i do.
<abu[m]> You could remove it somehow when closing, e.g in *Bye
<razzy> abu[m]: i agree, having one backup version is good. but it can confuse other people on system.
<razzy> one backup file is healthy, no more, no less. i agree :)
whatlambda has quit [Quit: Connection closed]
<razzy> i will think about it tomorrow. I wish you good night :].
<abu[m]> Good! ☺
<abu[m]> Let's sleep ...
<razzy> i will read the log
razzy has quit [Quit: leaving]
seninha has quit [Remote host closed the connection]
seninha has joined #picolisp