Page 1 of 1
Doc string & structs in clisp?
Posted: Thu Aug 05, 2010 1:07 pm
by SigmaX
This isn't too big a deal -- but is it just me or is the documentation string functionality for structs broken in clisp? For example, in some of my code SBCL gives:
Code: Select all
* (documentation 'INF_node 'structure)
"A boolean expression in If-then-else Normal Form (INF).
i.e. the nodes for our (R)OBDD."
while clisp gives:
Code: Select all
[2]> (documentation 'INF_node 'structure)
NIL
SigmaX
Re: Doc string & structs in clisp?
Posted: Thu Aug 05, 2010 1:08 pm
by SigmaX
Er, yeah, the syntax I'm using is:
Code: Select all
(defstruct INF_node
"A boolean expression in If-then-else Normal Form (INF).\
i.e. the nodes for our (R)OBDD."
(var nil) ; The input variable this statement is for (integer from 1 to n)
(low nil) ; Expression or terminal to follow if var's value is 0
(high nil) ; Expression or terminal to follow if var's value is 1
)
Siggy
Re: Doc string & structs in clisp?
Posted: Thu Aug 05, 2010 2:18 pm
by gugamilare
The
Hyperspec states that "an implementation is permitted to discard documentation strings at any time for implementation-defined reasons." I guess Clisp chooses to discard documentations to keep the memory consumption low, since using low memory is one of Clisp's main advantage.
Re: Doc string & structs in clisp?
Posted: Thu Aug 05, 2010 2:49 pm
by ramarren
gugamilare wrote:The Hyperspec states that "an implementation is permitted to discard documentation strings at any time for implementation-defined reasons." I guess Clisp chooses to discard documentations to keep the memory consumption low, since using low memory is one of Clisp's main advantage.
It doesn't, actually, at least on default settings. DESCRIBE shows the structure documentation, and it is stored in SYMBOL-PLIST. It seems there is something wrong in documentation function logic for structures which have a structure class, but I am not quite sure what, since I have never really looked at CLISP internals. On my system (CLISP 2.48 on Gentoo) it seems to go into an infinite loop when I pass a structure class to (clos::class-documentation ...).
Re: Doc string & structs in clisp?
Posted: Thu Aug 05, 2010 11:03 pm
by SigmaX
gugamilare wrote:The
Hyperspec states that "an implementation is permitted to discard documentation strings at any time for implementation-defined reasons." I guess Clisp chooses to discard documentations to keep the memory consumption low, since using low memory is one of Clisp's main advantage.
You're right, they can discard. The weird thing is that it
keeps the doc strings for functions, and possibly everything else but structs. It's not going to really effect me... but it bugs me, no pun intended.
SigmaX
Re: Doc string & structs in clisp?
Posted: Fri Aug 06, 2010 6:06 am
by gugamilare
Try getting in touch with Clisp's maintainer, it is probably a bug.
Re: Doc string & structs in clisp?
Posted: Fri Aug 06, 2010 1:50 pm
by SigmaX
FIled a report. They say they've fixed it in the CVS tree (that was fast!). I feel like a good citizen

.
Siggy