This is a read-only archive of lispforum.com. The forum was locked to new users and posts and is preserved here as static HTML from a database snapshot taken on 2019-09-07.

Doc string & structs in clisp?

7 posts · 1384 views

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:
* (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:
[2]> (documentation 'INF_node 'structure)
NIL
SigmaX

Re: Doc string & structs in clisp?

Er, yeah, the syntax I'm using is:
(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?

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?

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?

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?

Try getting in touch with Clisp's maintainer, it is probably a bug.

Re: Doc string & structs in clisp?

FIled a report. They say they've fixed it in the CVS tree (that was fast!). I feel like a good citizen :-).

Siggy