Re: plisp-mode on melpa
> On May 2, 2020, at 14:04, Jean-Christophe Helary > wrote: > > > >> On Apr 26, 2020, at 10:43, Alexis wrote: >> >> >> Jean-Christophe Helary writes: >> >>> Thank you Alexis, and sorry to bother you about that. It was late but it's >>> something I could have checked myself. >> >> It's no problem! As it was marked as an internal variable, it's good to err >> on the side of not trying to mess with it externally. :-) But i can't think >> of any reason it /needs/ to be internal, so it should definitely be a >> defcustom instead. > > Also, I was thinking that currently when you do your first C-x C-e, a > *picolisp* buffer opens behind the current buffer and the evaluation result > is sent there but it not immediately visible because the result buffer is > behind the edit buffer. > > It seems to me that it would be more practical to have the window split in > two and have the result displayed at the front (or at least in the evaluation > line at the bottom of the window). > > At first I was confused, I thought the command did not work properly because > I was not seeing the result buffer... :) I checked the code and it seems like (pop-to-buffer "*picolisp*")) is not working in inferior-plisp-run-picolisp. I'm working with the new "tab" feature on. So that may be related. Jean-Christophe Helary --- http://mac4translators.blogspot.com @brandelune -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
Re: miniPicoLisp cons(Nil, Nil);
Hi Kashyap, > Could you please tell me why we have the cons(Nil, Nil); in gen3m.c right > after insert(&Intern, "NIL", romSym("NIL", "(Rom+1)")); ? This allocates a dummy cell, required by 'NIL'. From doc/structures you see NIL: / | V +-+-+-+-+ |'NIL'| / | / | / | +-+-+-+-+ ^ | This is the dummy cell This cell is needed to allow for the dual nature of NIL, being both a symbol and as a cell (= empty list). PicoLisp demands that both (car NIL) and (cdr NIL) return NIL. If you do (val NIL) or (car NIL), the CDR of the first cell is accessed, but for (cdr NIL) the access goes to the next cell in memory, i.e. the dummy cell. The CDR of the dummy cell is never accessed. ☺/ A!ex -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
Re: miniPicoLisp cons(Nil, Nil);
Oh yes thanks Alex, Regards, Kashyap On Sat, May 2, 2020 at 7:10 AM Alexander Burger wrote: > Hi Kashyap, > > > Could you please tell me why we have the cons(Nil, Nil); in gen3m.c right > > after insert(&Intern, "NIL", romSym("NIL", "(Rom+1)")); ? > > This allocates a dummy cell, required by 'NIL'. From doc/structures you see > > NIL: / > | > V > +-+-+-+-+ > |'NIL'| / | / | / | > +-+-+-+-+ > > ^ > | > This is the dummy cell > > This cell is needed to allow for the dual nature of NIL, being both a > symbol and > as a cell (= empty list). PicoLisp demands that both (car NIL) and (cdr > NIL) > return NIL. > > If you do (val NIL) or (car NIL), the CDR of the first cell is accessed, > but for > (cdr NIL) the access goes to the next cell in memory, i.e. the dummy cell
Formatting in the REPL?
I'm experimenting with the object system in Picolisp, and I'm wondering if there is a way of teaching the REPL to invoke some formatting function when displaying an object instance? Having to constantly invoke (show) to see what is going on with the instances does get a little tedious... -wilhelm -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
divmod?
I'm not finding such a thing in the function reference, but asking on the off chance I'm overlooking it. Is there a way in Picolisp to get a division result and remainder as a single operation? -wilhelm -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
Re: Formatting in the REPL?
Hi Wilhelm, > Picolisp, and I'm wondering if there is a way > of teaching the REPL to invoke some formatting > function when displaying an object instance? Perhaps by setting '*Prompt'? ww https://software-lab.de/doc/refP.html#*Prompt ☺/ A!ex -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
Re: divmod?
Hi Wilhelm, > I'm not finding such a thing in the function > reference, but asking on the off chance I'm > overlooking it. Is there a way in Picolisp to > get a division result and remainder as a > single operation? No, there is not. I thought about it initially, but found that it makes no sense due to the bignum nature of PicoLisp. The remainder needs to be created separately (building up cell structures in memmory), so a single function call is not significantly more efficient than two separate calls to '/' and '%'. ☺/ A!ex -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe