[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gcl-devel] Re: nag from July
From: |
Camm Maguire |
Subject: |
[Gcl-devel] Re: nag from July |
Date: |
13 Oct 2005 21:25:40 -0400 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 |
Greetings! I've committed a lightly more capable alternate in
gcl_mislib.lsp. Please check it out. The doc says the result has to
be acceptable to compile and function -- currently these are lists
beginning with lambda only. Internally, GCL has lambda, lambda-block,
lambda-closure and lambda-block-closure (and perhaps one other), so
I've written function-lambda-expression to omit the specific closure
variable information, produce a genuine lambda list, and set the other
values accordingly. The function returned is therefore not the same
as the original function -- I'm hoping this is what "pre-processed in
some way" below means. If not, we need to expand compile and function
to accept arguments in the other lambda forms, that is if the spec
allows. Paul? BTW, this info is available for interpreted functions
only. Might be nice to carry the definition around post compile too
for inlining purposes, but this would likely consume a lot of memory.
Of course, probably no one cares and your original nil t nil was the
best idea -- it is just that I just dealt with this, and it is fresh
in my mind, and I wanted to make it accessible before I forgot it.
Take care,
Robert Boyer <address@hidden> writes:
> Ok, what was wrong with this suggestion?
>
> Bob
>
> >From boyer Wed Jul 20 18:52:48 -0500 2005
> To: address@hidden
> Subject: more useless compliance!
>
> In the same spirit of merely complying with the letter of law, you could, for
> ANSI compliance, add to GCL's COMMON-LISP package the following:
>
> (defun function-lambda-expression (fn)
> (declare (ignore fn))
> (values nil t nil))
>
> Bob
>
> Someday when someone has more time and knows what they are doing, let them do
> more.
>
> Below is the relevant documentation.
>
> -------------------------------------------------------------------------------
>
> \DefunWithValuesNewline function-lambda-expression
> {function}
> {lambda-expression, closure-p, name}
>
> Arguments and Values::
>
> function---a function.
>
> lambda-expression---a lambda expression or nil.
>
> closure-p---a generalized boolean.
>
> name---an object.
>
> Description::
>
> Returns information about function as follows:
>
> The primary value, lambda-expression, is function's defining lambda
> expression, or nil if the information is not available. The lambda
> expression may have been pre-processed in some ways, but it should remain a
> suitable argument to compile or function. Any implementation may
> legitimately return nil as the lambda-expression of any function.
>
> The secondary value, closure-p, is nil if function's definition was enclosed
> in the null lexical environment or something non-nil if function's definition
> might have been enclosed in some non-null lexical environment. Any
> implementation may legitimately return true as the closure-p of any function.
>
> The tertiary value, name, is the ``name'' of function. The name is intended
> for debugging only and is not necessarily one that would be valid for use as
> a name in defun or function, for example. By convention, nil is used to mean
> that function has no name. Any implementation may legitimately return nil as
> the name of any function.
>
> ...
>
> Although implementations are free to return ``nil, true, nil'' in all cases,
> they are encouraged to return a lambda expression as the primary value in the
> case where the argument was created by a call to compile or eval (as opposed
> to being created by loading a compiled file).
>
>
>
>
--
Camm Maguire address@hidden
==========================================================================
"The earth is but one country, and mankind its citizens." -- Baha'u'llah
- [Gcl-devel] Re: nag from July,
Camm Maguire <=