Re: Matching and Hashes
Right you are. Brilliant! Documented indeed! On Wed, Jan 25, 2017 at 05:47:22PM +0100, Alexander Burger wrote: Hi Joe, The T appears to act as a function in your first option. Does that act like "If true return the cdr then break out of the for loop"? Yes, exactly. The 'T' is indeed not a function, but the marker of special clauses in the 'for' syntax (but also 'loop' or 'do'). 'NIL' is also supported. The reference of 'for' says, terse as usually: If a clause has NIL or T as its CAR, the clause's second element is evaluated as a condition and - if the result is NIL or non-NIL, respectively - the prg is executed and the result returned. I could do this in perl, but I wouldn't be building character ;-) Yess :) ♪♫ Alex -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe -- Joe Golden -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
Re: Matching and Hashes
> I could do this in perl, but I wouldn't be building character ;-) .. 20+yrs ago, I used to say that when using perl instead of some other language :) /Lindsay On Wed, Jan 25, 2017 at 8:47 AM, Alexander Burgerwrote: > Hi Joe, > > > The T appears to act as a function in your first option. Does that act > like > > "If true return the cdr then break out of the for loop"? > > Yes, exactly. The 'T' is indeed not a function, but the marker of special > clauses in the 'for' syntax (but also 'loop' or 'do'). 'NIL' is also > supported. > > The reference of 'for' says, terse as usually: > >If a clause has NIL or T as its CAR, the clause's second element is > evaluated >as a condition and - if the result is NIL or non-NIL, respectively - > the prg >is executed and the result returned. > > > > I could do this in perl, but I wouldn't be building character ;-) > > Yess :) > ♪♫ Alex > -- > UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe >
Re: Matching and Hashes
Hi Joe, > The T appears to act as a function in your first option. Does that act like > "If true return the cdr then break out of the for loop"? Yes, exactly. The 'T' is indeed not a function, but the marker of special clauses in the 'for' syntax (but also 'loop' or 'do'). 'NIL' is also supported. The reference of 'for' says, terse as usually: If a clause has NIL or T as its CAR, the clause's second element is evaluated as a condition and - if the result is NIL or non-NIL, respectively - the prg is executed and the result returned. > I could do this in perl, but I wouldn't be building character ;-) Yess :) ♪♫ Alex -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
Re: Matching and Hashes
I've just found filter (which looks like find ALL) whilst reading up on find sothank you very much both for the question and answer. On 25 January 2017 at 07:03, Alexander Burgerwrote: > Hi Joe, > > > (de account-list > > ("Bank Charge"."Expenses:Bank Fee") # matches if in > last position > > ("City Market"."Expenses:Groceries")# ONLY this line works to > match > > ) > > (de determine-acct (desc) > > (for x account-list # go through account list > > (when (sub? (car x) desc) > > (cdr x # on match > return expense category > > The problem is that the loops does not exit upon a match. > > You could either do > >(de determine-acct (Desc) > (for X account-list > (T (sub? (car X) Desc) > (cdr X) ) ) ) > > or use 'find' > >(de determine-acct (Desc) > (find > '((X) (sub? (car X) Desc)) > account-list ) ) > > ♪♫ Alex > -- > UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe >
Re: In the docs: within or vice versa, more glitches
Hi Jon, > It seems you forgot something in doc/form/refF.html, line 101. I guess there > should have been “Formatting” just before the final “.” Seems so, added the missing word. Regards, Mattias -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
Re: In the docs: within or vice versa, more glitches
Hi Mattias, It seems you forgot something in doc/form/refF.html, line 101. I guess there should have been “Formatting” just before the final “.” /Jon > On 23. Jan, 2017, at 14:12, Mattias Sundbladwrote: > > Hi Jon, > >> I’ve found a few more glitches: > > Thanks, I'll go through them and change the files. > > Regards, > Mattias > --