Doc string & structs in clisp?

Discussion of Common Lisp
Post Reply
SigmaX
Posts: 19
Joined: Tue Jul 27, 2010 9:29 am
Location: Santa Fe, NM

Doc string & structs in clisp?

Post by SigmaX » Thu Aug 05, 2010 1:07 pm

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

SigmaX
Posts: 19
Joined: Tue Jul 27, 2010 9:29 am
Location: Santa Fe, NM

Re: Doc string & structs in clisp?

Post by SigmaX » Thu Aug 05, 2010 1:08 pm

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

gugamilare
Posts: 406
Joined: Sat Mar 07, 2009 6:17 pm
Location: Brazil
Contact:

Re: Doc string & structs in clisp?

Post by gugamilare » Thu Aug 05, 2010 2:18 pm

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.

ramarren
Posts: 613
Joined: Sun Jun 29, 2008 4:02 am
Location: Warsaw, Poland
Contact:

Re: Doc string & structs in clisp?

Post by ramarren » Thu Aug 05, 2010 2:49 pm

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 ...).

SigmaX
Posts: 19
Joined: Tue Jul 27, 2010 9:29 am
Location: Santa Fe, NM

Re: Doc string & structs in clisp?

Post by SigmaX » Thu Aug 05, 2010 11:03 pm

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

gugamilare
Posts: 406
Joined: Sat Mar 07, 2009 6:17 pm
Location: Brazil
Contact:

Re: Doc string & structs in clisp?

Post by gugamilare » Fri Aug 06, 2010 6:06 am

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

SigmaX
Posts: 19
Joined: Tue Jul 27, 2010 9:29 am
Location: Santa Fe, NM

Re: Doc string & structs in clisp?

Post by SigmaX » Fri Aug 06, 2010 1:50 pm

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

Siggy

Post Reply