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

Reply via email to