Re: conc: unexpected results

2017-02-09 Thread Lindsay John Lawrence
Apologies for bothering everyone with this. It took some research (there is surprising little discussion of the function online or even in most books), but I at least understand how it works now. It seems that it is not often used in everyday programming: "It is a good idea to leave the use of NCO

Re: conc: unexpected results

2017-02-09 Thread Lindsay John Lawrence
I tried conc to an empty list on both 32 and 64 bit versions of picolisp I even installed SBCL just to try the similar 'nconc' on that platform. The results are consistent for all of them. I just don't understand why Is it simply 'standard', historical reasons? because of the way evaluation w

Re: box? on address

2017-02-09 Thread pd
On Thu, Feb 9, 2017 at 6:13 PM, Christopher Howard wrote: > Hi, I was just trying to understand... > > : (box? (box (4 5 6))) > -> $384375304 > : (box? $384375304) > -> NIL > : (car $384375304) > -> 4 > > Shouldn't (box? $384375304) be non-NIL? > As Danilo said box? evaluates its arguments and t

Re: box? on address

2017-02-09 Thread Mike Pechkin
hi, Lets talk about ​​t ransient ​s​ ymbols ​ from this two links: http://software-lab.de/doc/ref.html#transient http://pastebin.com/AsuveCFY ​ On Thu, Feb 9, 2017 at 7:13 PM, Christopher Howard wrote: > Hi, I was just trying to understand... > > : (box? (box (4 5 6))) > -> $384375304 > : (box

conc: unexpected results

2017-02-09 Thread Lindsay John Lawrence
conc does not rewrite N if N is an empty list. # 1. : (let (N '()) (conc N '(A))) -> (A) # 2 : (let (N '()) (conc N '(A)) N) -> NIL # 3. : (let (N '(NIL)) (conc N '(A)) N) -> (NIL A) # 4. : (let (N '()) (setq N (conc N '(A))) N) -> (A) In #2 above, I was expecting N to be (A) If N is not empty, a

Re: box? on address

2017-02-09 Thread Danilo Kordic
`box?' evaluates it's argument. In this case it is `lst' ``(4 5 6)''. BTW I didn't know `print'ed box can be `read' back. For example ``$0'' does have a name, but `print'ed one does not. It makes no sense to me. On 2/9/17, Christopher Howard wrote: > Hi, I was just trying to understand... > >

Re: binding free symbols in a lambda definition

2017-02-09 Thread Lindsay John Lawrence
Hi Alex, > However, a function call is about the most expensive thing in PicoLisp. It > interprets the parameter list (X), saves the old value of X, evaluates (not X) > and restores the value of X. (de null..) was really unnecessary here :) I just wrote it for completeness as part of the book exe

box? on address

2017-02-09 Thread Christopher Howard
Hi, I was just trying to understand... : (box? (box (4 5 6))) -> $384375304 : (box? $384375304) -> NIL : (car $384375304) -> 4 Shouldn't (box? $384375304) be non-NIL? -- Christopher Howard, Computer Assistant Alaska Satellite Internet 3239 La Ree Way, Fairbanks, AK 99709 907-451-0088 or 888-396

Re: binding free symbols in a lambda definition

2017-02-09 Thread Danilo Kordic
If `and' and `or' is renamed, or just aliased, to `then' and `else', there is little need left for `if' and `cond' >:) . -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe

Re: binding free symbols in a lambda definition

2017-02-09 Thread Alexander Burger
Hi Lindsay, > I missed to include it... >(de null (X) (not X)) OK! :) However, a function call is about the most expensive thing in PicoLisp. It interprets the parameter list (X), saves the old value of X, evaluates (not X) and restores the value of X. Therefore I would recommend (def '

Re: binding free symbols in a lambda definition

2017-02-09 Thread Lindsay John Lawrence
Hi Alex, I missed to include it... (de null (X) (not X)) Thanks! for the suggestions. I tried the pairlis alternatives. Much better. 'extract' will be very useful. I'll have to work with nond a bit more to get how/when use that. /Lindsay On Thu, Feb 9, 2017 at 3:17 AM, Alexander Burger w

Re: binding free symbols in a lambda definition

2017-02-09 Thread Alexander Burger
Hi Lindsay, > # pairlis2: gives a list of pairs of corresponding elements > # of the lists x and y, and appends this to the list a. > # (pairlis '(A B C) '(1 2) () ) -> ((A . 1) (B . 2)) > > (de pairlis2 (X Y A) >(cond > ((null X) A) > ((null Y) A) > (T > (cons >

Re: binding free symbols in a lambda definition

2017-02-09 Thread Lindsay John Lawrence
Picolisp continues to astonish me with its 'Principle of Least Astonishment'... using @ variable arguments is much nicer. /Lindsay # using pairlis2 and sublis from prior email... (de curri2 @ (let (Fun (next) Args (rest) Par (pairlis2 (car Fun) Args) dropP

Re: binding free symbols in a lambda definition

2017-02-09 Thread Alexander Burger
Hi Andrés, thanks for the "curri" examples! > Sorry for the large email and even while pretending to be a clarifying text > it is not :( I think it was :) > Also don't want to give an image of pretending to arrange picolisp's flaw > design, it is absolutely not, not only I don't have the needed

Re: binding free symbols in a lambda definition

2017-02-09 Thread Lindsay John Lawrence
I've enjoyed the discussion. Curry is a common idiom in the javascript world (my current day job) so it was very interesting to explore it here. Being relatively new to picolisp I have a lot to learn about built-in functionality so exploring these ideas, with feedback from Alex and others more fam

Re: binding free symbols in a lambda definition

2017-02-09 Thread pd
Sorry for the large email and even while pretending to be a clarifying text it is not :( Also don't want to give an image of pretending to arrange picolisp's flaw design, it is absolutely not, not only I don't have the needed understanding of picolisp nor the knowledge to do so but I consider pico