From: Sam Steingold
Subject: user redefining standard functions
Date:
Message-ID: <ug06537h0.fsf@xchange.com>
where does the spec say that user program
(defun cons (x y) (+ x y))
is non-conforming?
I just need the reference.
[OTOH, if I am wrong and the above code _is_ conforming, I would
appreciate an explanation.]
Thanks.
--
Sam Steingold (http://www.podval.org/~sds)
Keep Jerusalem united! <http://www.onejerusalem.org/Petition.asp>
Read, think and remember! <http://www.iris.org.il> <http://www.memri.org/>
Someone has changed your life. Save? (y/n)
>>>>> "Sam" == Sam Steingold <···@gnu.org> writes:
Sam> where does the spec say that user program (defun cons (x y) (+ x
Sam> y))
Sam> is non-conforming? I just need the reference. [OTOH, if I am
Sam> wrong and the above code _is_ conforming, I would appreciate an
Sam> explanation.]
I think it depends on which package the defun'd cons is a member of.
<http://www.xanalys.com/software_tools/reference/HyperSpec/Body/sec_11-1-2-1-2.html>
--
Russell Senior ``The two chiefs turned to each other.
·······@aracnet.com Bellison uncorked a flood of horrible
profanity, which, translated meant, `This is
extremely unusual.' ''
Sam Steingold <···@gnu.org> writes:
> where does the spec say that user program
>
> (defun cons (x y) (+ x y))
>
> is non-conforming?
> I just need the reference.
> [OTOH, if I am wrong and the above code _is_ conforming, I would
> appreciate an explanation.]
Its behavior is undefined. So CLISP's continuable error, and CMUCL's
just bashing the old definition are both fine.
--
/|_ .-----------------------.
,' .\ / | No to Imperialist war |
,--' _,' | Wage class war! |
/ / `-----------------------'
( -. |
| ) |
(`-. '--.)
`. )----'
···@conquest.OCF.Berkeley.EDU (Thomas F. Burdick) writes:
> Sam Steingold <···@gnu.org> writes:
>
> > where does the spec say that user program
> >
> > (defun cons (x y) (+ x y))
> >
> > is non-conforming?
> > I just need the reference.
> > [OTOH, if I am wrong and the above code _is_ conforming, I would
> > appreciate an explanation.]
>
> Its behavior is undefined. So CLISP's continuable error, and CMUCL's
> just bashing the old definition are both fine.
I once, while folling around writing a algebraic manipulator, typed
(defun reduce (...)
...)
Oops. CMUCL didn't like that too much.
Cheers,
M.
Michael Hudson <···@python.net> writes:
> ···@conquest.OCF.Berkeley.EDU (Thomas F. Burdick) writes:
>
> > Sam Steingold <···@gnu.org> writes:
> >
> > > where does the spec say that user program
> > >
> > > (defun cons (x y) (+ x y))
> > >
> > > is non-conforming?
> > > I just need the reference.
> > > [OTOH, if I am wrong and the above code _is_ conforming, I would
> > > appreciate an explanation.]
> >
> > Its behavior is undefined. So CLISP's continuable error, and CMUCL's
> > just bashing the old definition are both fine.
>
> I once, while folling around writing a algebraic manipulator, typed
>
> (defun reduce (...)
> ...)
>
> Oops. CMUCL didn't like that too much.
I'm guessing we cmucl users all have at least one horror story of
doing something stupid to the cl package. I'm prone to writing
functions called prin1-foo and princ-foo. Oooh, don't redefine prin1
if you want to ever get another prompt (debugger or otherwise) in that
image ;-)
--
/|_ .-----------------------.
,' .\ / | No to Imperialist war |
,--' _,' | Wage class war! |
/ / `-----------------------'
( -. |
| ) |
(`-. '--.)
`. )----'