Re: documentation strings on lambda expressions
> On Wed, 26 Sep 2007 21:58:42 +0100, Taylor, Joshua <tayloj@cs.rpi.edu>
> wrote:
>
> >
> > On 9/26/07, Taylor, Joshua <tayloj@cs.rpi.edu> wrote:
> >> Hello all,
> >>
> >> I read in the HyperSpec about lambda:
> >>
> >> "Syntax: lambda lambda-list [[declaration* | documentation]] form*
> >> Arguments: ... documentation---a string; not evaluated. ...
> >> Description: ... Documentation is attached to the denoted function (if
> >> any is actually created) as a documentation string."
> >>
> >> I'm wondering how to retrieve the docstring though, as
> >> (documentation ... 'function) doesn't seem to do it:
> >>
> >> CL-USER 1 >
> >> (defun inc-defun (x)
> >> "Add one to x."
> >> (1+ x))
> >> Inc-Defun
> >>
> >> CL-USER 2 > (documentation #'inc-defun 'function)
> >> "Add one to x." ;; documentation
> >>
> >> CL-USER 3 >
> >> (defparameter *inc-defparameter*
> >> #'(lambda (x)
> >> "Add one to x."
> >> (1+ x)))
> >> *Inc-Defparameter*
> >>
> >> CL-USER 4 > (documentation *inc-defparameter* 'function)
> >> Nil ;; no documentation?
> >>
> >> Any thoughts? Suggestions? Thanks in advance!
> >>
> >
> > Also, I'm currently on LWL5.0
>
On 9/26/07, Yury Davidouski <dcu-stuff@list.ru> wrote:
> Hi Joshua,
>
> it says "Documentation is attached to the denoted function (if any is
> actually created) as a documentation string." but it is obvious that there
> is no documentation present so I guess in LW we just have the case where
> it is not created.
I did notice that phrase, but I'd think that the location of the
parenthetical meant "if any [function] is created". (Though that
doesn't make too much sense to me either, unless it's a distinction
between compiled and interpreted code, perhaps?)
--
=====================
Joshua Taylor
tayloj@rpi.edu
"A lot of good things went down one time,
back in the goodle days."
John Hartford