[Openmcl-devel] my Custom Function is not protected.

Gary Byers gb at clozure.com
Mon Aug 22 13:33:18 PDT 2011


Doing

? (set-user-environment t)

is supposed to protect all currently-defined functions against casual
redefinition.  (If you really want to, nothing will stop you from
doing

(setf (fdefinition 'car) (fdefinition 'cdr))

but

(defun car (x) (cdr x))

is supposed to CERROR)

That doesn't actually work: the code that tries to enforce that only
guards against redefinition of symbols in the CL or CCL packages.  I
don't think that's intentional (based on my recollection of what this
is all supposed to do), but the code's behaved that way for a very
long time.

So: at this moment there's no way to do what you want to do.  It certainly
seems that there should be.


On Mon, 22 Aug 2011, ??? wrote:

>
> (defpackage #:foo
>    (:use :cl :ccl)
>    (:export #:hello)))
>
> (in-package :foo)
>
> (defun hello ()
>    "hello world")
>
>
> ?after?.
>
> (in-pakcage :cl-user)
>
> (use-package :foo)
>
> (defun hello ()
>    "no??..I don't want redefine it.")
>
>
>
> in CCL package function is protected.  It is predefine function.
>
> but..my?foo:hello  function is not protected. 
>
> I want my  foo:hello  function is predefine function also?
>
>
> I read  http://ccl.clozure.com/manual/chapter18.2.html#Using-CCL-in--development--and-in--user--mode 
>
> but?I don't understand it.  how to use it?
>
>
>
> sorry. I can't speak english~...
>
> _______________________________________________
> Openmcl-devel mailing list
> Openmcl-devel at clozure.com
> http://clozure.com/mailman/listinfo/openmcl-devel



More information about the Openmcl-devel mailing list