[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: strange 1+/1- bug?
- To: firstname.lastname@example.org
- Subject: Re: strange 1+/1- bug?
- From: email@example.com (Richard Shepherd)
- Date: Thu, 22 Feb 1996 11:45:16 +1300 (NZDT)
- In-reply-to: <9602211400.AA27230@ilog.ilog.fr>
- Reply-to: firstname.lastname@example.org
Bruno Haible wrote:
> Of course. The CLISP compiler recognizes that (+ x 1) is equivalent to
> (1+ x) and thus generates a tail-recursive call, just as if you had written
> (defun 1+ (x) (1+ x)).
Ah, how silly of me!
> > Is this a bug that is fixed in later versions?
> No, this isn't a bug. You are not allowed to modify built-in Common Lisp
> functions (see CLtL2 or dpANS), and that's what the warning was about.
Aha, I did not know this either. Can you tell me *where* in CLtL2 it
says this? I have been looking but with no success yet. As it turns
out I don't need to play with 1+ anyway. I thought incf may use it
but it doen't seem to, i.e. (incf x) seems to work, even when x is not
a number, in my code. So I'll leave it there.
> Using CLOS for arithmetic operations provides a great flexibility.
It certainly does, everything (in the arithmetic sense) seems to be
fine now, cheers,