From: Geoff Summerhayes
Subject: Re: Trouble with labels
Date: 
Message-ID: <td6ggj2p5i8tf6@corp.supernews.com>
<·······@hotmail.com> wrote in message ·······································@4ax.com...
>
> How can I make a function defined in labels refer to another function defined
> in the same labels body?
>
>                      (cond
>                       ((equal m 'withdraw) withdraw)

should be:              ((equal m 'withdraw) (withdraw))


>                       ((equal m 'deposit) deposit)

should be:              ((equal m 'deposit) (deposit))

>                       (t (format t "Unknown request -- MAKE-ACCOUNT")))))
>     dispatch))

should be:   (dispatch)))

> This gets an error:
> ; MAKE-WITHDRAW
> ;;;*** Warning in (SUBFUNCTION (LABELS DISPATCH) MAKE-ACCOUNT): WITHDRAW
> assumed special
> ;;;*** Warning in (SUBFUNCTION (LABELS DISPATCH) MAKE-ACCOUNT): DEPOSIT
> assumed special
> ;;;*** Warning in MAKE-ACCOUNT: DISPATCH assumed special
> ; MAKE-ACCOUNT
>

Without the parenthesies Lisp will look for variables with those names
not functions.

Geoff
From: Geoff Summerhayes
Subject: Re: Trouble with labels
Date: 
Message-ID: <td6h5t7oiq980a@corp.supernews.com>
"Geoff Summerhayes" <·············@hNoOtSmPaAiMl.com> wrote in message ···················@corp.supernews.com...
>
>
> should be:              ((equal m 'withdraw) (withdraw))
>
> should be:              ((equal m 'deposit) (deposit))
>
> should be:   (dispatch)))

Opened my mouth too soon, just took a closer look at the code.

Should be #'withdraw #'deposit #'dispatch instead of (withdraw),
(deposit), and (dispatch)

Oops, Geoff