gcl-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gcl-devel] Current state of the ansi test suite


From: Paul F. Dietz
Subject: Re: [Gcl-devel] Current state of the ansi test suite
Date: Wed, 02 Oct 2002 20:17:28 -0500
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.9) Gecko/20020408

Camm Maguire wrote:
Greetings!

OK, I'll defer to your judgement here.  What about supplying functions
that aren't in the spec -- i.e. implementation-dependent functions?
Is this generically OK as long as I don't tread on the canonical
namespace?

It's fine to add extra functions (all implementations do), but they can't
be exported from the COMMON-LISP package.

> Which leads me to another question -- there is no truly
'static' function declaration in lisp, is there?  I.e. if one does not
export a function from a package, one can still always access it with
package::function, right?  Is there any way to make an internal
function  visible only to a certain defined group of other functions,
no matter how it is called, i.e. like a static declaration in a C
'file'?

You can wrap the defuns for those functions in a FLET:

(flet ((sneaky-function (...) ...))
  (defun visible-function (...)
     ... (sneaky-function 'foo 'bar) ...)
  ...
)

I think you could also do something like use LOAD-TIME-VALUE to get
the symbol-function slot of a symbol in its callers, then unbind the
that slot.  That would make the function inaccessible elsewhere:

(defun foo (...) ...)

(defun bar (...) ... (funcall (load-time-value #'foo) ...) ...)

(eval-when (load) (fmakunbound 'foo))

        Paul





reply via email to

[Prev in Thread] Current Thread [Next in Thread]