Hello,
is there a MOP way to extract the docstring of a slot definition? As much
as I see, a suitable MOP function (SLOT-DEFINITION-DOCUMENTATION) is simply
missing.
Thank you,
Nicolas.
Nicolas Neuss <·······@iwr.uni-heidelberg.de> wrote:
> is there a MOP way to extract the docstring of a slot definition? As much
> as I see, a suitable MOP function (SLOT-DEFINITION-DOCUMENTATION) is simply
> missing.
On SBCL at least you can use (DOCUMENTATION <direct-slot-definition> T):
* (use-package :sb-mop)
T
* (defclass foo ()
((x :documentation "Yer X")
(y :documentation "Yer Y")))
#<STANDARD-CLASS FOO>
* (mapcar (lambda (s)
(documentation s t))
(class-direct-slots (find-class 'foo)))
("Yer X" "Yer Y")
Cheers,
-- Nikodemus "Not as clumsy or random as a C++ or Java.
An elegant weapon for a more civilized time."
·········@random-state.net writes:
> On SBCL at least you can use (DOCUMENTATION <direct-slot-definition> T):
Nice! Thank you. This will suffice for my application. (I'm compiling a
reference manual in Texinfo format for Femlisp. I have started from Rudi
Schlatte's work for the SBCL manual, but now I am more and more deviating
because I allow my docstrings to be in Texinfo format. I am also not sure
if I should not incorporate information from the system definition file or
source code position of the definition later on).
Yours, Nicolas.
Nicolas Neuss wrote:
> Hello,
>
> is there a MOP way to extract the docstring of a slot definition? As much
> as I see, a suitable MOP function (SLOT-DEFINITION-DOCUMENTATION) is simply
> missing.
(documentation slot-definition-object 't) should do the job.
Pascal
--
Pascal Costanza University of Bonn
···············@web.de Institute of Computer Science III
http://www.pascalcostanza.de R�merstr. 164, D-53117 Bonn (Germany)
Pascal Costanza <········@web.de> writes:
> (documentation slot-definition-object 't) should do the job.
Thank you very much, probably this will work[1].
Nicolas.
[1] ... on CL implementations which store slot docstrings. Unfortunately,
it looks as if CMUCL or SBCL ignore them. (But this should go to the
respective mailing lists...)
From: marco
Subject: Re: MOP way to extract slot documentation?
Date:
Message-ID: <m2mzzt3tgq.fsf@bese.it>
Nicolas Neuss <·······@iwr.uni-heidelberg.de> writes:
> [1] ... on CL implementations which store slot docstrings. Unfortunately,
> it looks as if CMUCL or SBCL ignore them. (But this should go to the
> respective mailing lists...)
effective-slot-definitions lose the doc strings, look in the
corresponding direct-slot-definiton object.
if you're trying to read the doc strings, and not programmatically
manipulate them, i'd suggest using slime's inspector on the class
object.
--
-Marco
Ring the bells that still can ring.
Forget your perfect offering.
There is a crack in everything.
That's how the light gets in.
-Leonard Cohen
marco <··@bese.it> writes:
> if you're trying to read the doc strings, and not programmatically
> manipulate them, i'd suggest using slime's inspector on the class
> object.
In fact, if you're trying to do anything (but making cofee), use
Marco's brand new inspector in slime! It absolutely rocks!
Thanks Marco,
Andras
From: Thomas Schilling
Subject: Re: Slime's inspector (was: Re: MOP way to extract slot documentation?)
Date:
Message-ID: <opsecdkaxk1gy3cn@news.cis.dfn.de>
> In fact, if you're trying to do anything (but making cofee), use
> Marco's brand new inspector in slime! It absolutely rocks!
Definitely! [1]
And there's even room to further improvement. (Which will be filled soon.)
[1] Well, when you have the right implementation :P But ports are being
done quickly.
marco <··@bese.it> writes:
> effective-slot-definitions lose the doc strings, look in the
> corresponding direct-slot-definiton object.
>
> if you're trying to read the doc strings, and not programmatically
> manipulate them, i'd suggest using slime's inspector on the class
> object.
I am using SLIME and will update now to look at your inspector. Thanks for
the information and all your work on SLIME.
Nicolas.