Re: use of (+ N) in 'task and 'timeout
On Mon, May 24, 2021 at 08:03:35PM -0500, polifemo wrote: > As I refactor pil21 for my amusement, I've found the function '+ being used > on single numbers. What is this for? As far as I could think, it might have > to do something with formatting... but I really can't think of anything. > > here are two examples, in related operations: > > (de timeout (N) >(if2 N (assoc -1 *Run) > (set (cdr @) (+ N)) # here > (push '*Run (list -1 (+ N) '(bye))) # here > (del @ '*Run) ) ) > > it is also used inside 'task, in this expression: > `(link (+ (eval (++ Prg) 1)))` > , though the entire thing is too long for me to comfortably paste here. Very good that you found this! The unary '+' calls in the above cases are obsolete in pil21. They are remnants from pil32, I will remove them. They were necessary because pil32 did not have short numbers - only bignums each occupying one or more cells. The internal event handler operating on '*Run' modified (decremented) these values destructively for efficiency reasons. Therefore, numbers passed to 'task' or 'timeout' had to be protected. The unary '+' call works like a 'copy' on the number. ☺/ A!ex -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
use of (+ N) in 'task and 'timeout
As I refactor pil21 for my amusement, I've found the function '+ being used on single numbers. What is this for? As far as I could think, it might have to do something with formatting... but I really can't think of anything. here are two examples, in related operations: (de timeout (N) (if2 N (assoc -1 *Run) (set (cdr @) (+ N)) # here (push '*Run (list -1 (+ N) '(bye))) # here (del @ '*Run) ) ) it is also used inside 'task, in this expression: `(link (+ (eval (++ Prg) 1)))` , though the entire thing is too long for me to comfortably paste here.
Re: get the 'up value of a variable across a lambda
Ok, I see my mistake. I assumed that let and the rest could create enclosing environments, when only a function call can. Another example I made of how to use 'up: : (de f () (and 1000 (up 1 @) @)) -> f : (and 10 (f)) -> 10 Thanks for the clarification alex! On Mon, May 24, 2021 at 12:55 AM Alexander Burger wrote: > On Sun, May 23, 2021 at 08:44:32PM -0500, polifemo wrote: > > `(let @ 1 (let @ 10 (let @ 20 (up 2 @` > > This are two misunderstandings in this example: > > 1. It has not a good idea to bind '@' in a 'let' expression. '@' is set >implicitly by flow- and logic-functions, so a correct usage would be > > (and 1 (or 10 (while 20 (up 2 @ > >or - more realistically - > > (and (foo) (or (bar) (while (zup) (up 2 @ > > 2. 'up' does not care about 'let', 'use', 'for' etc. They are ignored. An > up >"enclosing environment" always means the enclosing *function* > environment. So >all the above 'let's all run in the same environment. The same rule > applies >to the environment offsets to 'eval' and 'run'. > > > > returns 1, as I expected, if I enclose the 'up expression inside a > function > > This return value of '1' just happens because the environment setup in > bindeng > '@' in 'let' is undefined. > > > Let me try to give an example. > >(when 7 # The result of 'when' is what we are interested in > (extract > '((N) # Here we are in a function > (when (num? N) # 'when' sets '@' >(+ N @) ) ) # so we add the wrong '@' > (1 a 2 b 3))) >-> (2 4 6) > >(when 7 > (extract > '((N) # in a function > (when (num? N) >(+ N (up 1 @)) ) ) # Here we get the '7' > (1 a 2 b 3))) >-> (8 9 10) > > ☺/ A!ex > > -- > UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe >
Re: any picolisp experiences with iSH on iOS ?
Hi, Alpine is one of primary test box for pil21 test farm. It passed full test suite. > Anyone have running a picolisp instance successfully on iOS or > busybox/Alpine? > (mike) -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
any picolisp experiences with iSH on iOS ?
Hi all, some months ago, in the Apple App Store I stumbled over the 'iSH' App, which could be easily installed on iPhone 7 (iOS 14.4.2). (uname -a in the app console shows: iSH 1.1.1 (91) Dec 21 2020) (I did not jailbreak the iPhone - but it is from second hand and I do not know, what others might have done to it.) It looks like iSH is busybox for iOS - Alpine Linux and it might be able to install packages. emacs 26.3 does run (takes its time to startup, of course :-) ) and shows 536870911 as value for most-positive-fixnum - so I think it is 32bit based. Before I might try to dig deeper into this all - did anyone try before? Any experiences, constraints or requirements, that may argue pro/against picolisp on iOS? Anyone have running a picolisp instance successfully on iOS or busybox/Alpine? Just curious, Olaf -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe