Lisp HUG Maillist Archive

DEFCLASS slot options in CAPI:DEFINE-INTERFACE

Has anyone noticed that the :DOCUMENTATION slot-option, if provided in
a define-interface form for a slot defined within :panes (and
:layouts, &c., but I haven't checked these cases), doesn't get put
into the slot definition of the corresponding DEFCLASS form.  E.g., in
the following DEFINE-INTERFACE, the :reader, :writer, and :accessor
are present in the macroexpansion's DEFCLASS.

It make sense that the allocation, initarg, initform and type aren't
passed through, since the allocation should always be instance (so
that the same pane isn't displayed in multiple interfaces), the
initarg wouldn't be used, initform isn't useful since the
capi::initialize-instance method creates an instance of the pane, and
the type is already known from the define-interface form.  But I don't
see a reason not to pass the :documentation option through to the
defclass.

(capi:define-interface interface-class () ()
  (:panes
   (output capi:output-pane
           :reader reader
           :writer writer
           :accessor accessor
           :allocation allocation ; * shouldn't be passed through
           :initarg initarg ; * no reason to pass through
           :initform initform ; * no reason to pass through
           :type type ; * already known
           :documentation "docstring")))

expands to

(DSPEC:DEF (CAPI:DEFINE-INTERFACE INTERFACE-CLASS)
  (DEFCLASS INTERFACE-CLASS
            (CAPI:INTERFACE)
            ((OUTPUT :READER READER :WRITER WRITER :ACCESSOR ACCESSOR))
            (:METACLASS CAPI::CAPI-CLASS))
  NIL
  NIL
  (DEFMETHOD CAPI::INITIALIZE-INTERFACE
    :AFTER
    ((#:SELF465245 INTERFACE-CLASS) &REST #:ARGS465246 &KEY &ALLOW-OTHER-KEYS)
    (WITH-SLOTS (OUTPUT) #:SELF465245
      (DECLARE (IGNORABLE OUTPUT))
      (LET ((CAPI::SELF #:SELF465245) (CAPI:INTERFACE #:SELF465245))
        (DECLARE (IGNORABLE CAPI::SELF CAPI:INTERFACE))
        (SETF (SLOT-VALUE #:SELF465245 'OUTPUT)
              (MAKE-INSTANCE 'CAPI:OUTPUT-PANE
                             :ALLOCATION
                             ALLOCATION
                             :INITARG
                             INITARG
                             :INITFORM
                             INITFORM
                             :TYPE
                             TYPE
                             :DOCUMENTATION ; should be up in the defclass form
                             "docstring"
                             :NAME
                             'OUTPUT))
        (SETF (SLOT-VALUE #:SELF465245 'CAPI::PANES)
              (LIST* (SLOT-VALUE #:SELF465245 'OUTPUT)
                     (SLOT-VALUE #:SELF465245 'CAPI::PANES))))))
  'INTERFACE-CLASS)

As a workaround, I do

(capi:define-interface interface-class () ()
  (:panes
   (output capi:output-pane
           #-(and) :documentation #-(and) "docstring")))

since it really is nice to have a docstring with the slot definition,
to have it look like a docstring in the source rather than a comment,
and since the documentation shouldn't be an initarg to the pane.  (In
my syntax highlighting, strings (including docstrings) are green, but
comments are red, so the difference really is noticeable.)  While I
don't think LW does anything with slot docstrings, some documentation
generators know about them, and that's another reason that it would be
nice to have define-interface recognize the :documentation
option---the documentation generators can macroexpand to see the
defclass form and read the documentation.

Anyone else run into this?

-- 
Joshua Taylor, http://www.cs.rpi.edu/~tayloj/


Re: DEFCLASS slot options in CAPI:DEFINE-INTERFACE

Joshua TAYLOR wrote on Thu, 22 Apr 2010 19:16:18 -0400 03:16:

| Has anyone noticed that the :DOCUMENTATION slot-option, if provided in
| a define-interface form for a slot defined within :panes (and
| :layouts, &c., but I haven't checked these cases), doesn't get put
| into the slot definition of the corresponding DEFCLASS form.

IMHO, the :HELP-KEY or :TOOLTIP is more useful than :DOCUMENTATION for
panes.
--
Sincerely,
Dmitriy Ivanov
lisp.ystok.ru


Re: DEFCLASS slot options in CAPI:DEFINE-INTERFACE

Unable to parse email body. Email id is 10241

(Lisp HUG) Delivery (?) Issue...

Greetings to the List --

I am Delivering a fairly complex system (called ls1100) from within 
LispWorks v5.1on a Windows XP system.

Occasionally, when I start the ls1100.exe file on the Windows box, I 
see the following error:

"file d:\ls1100.exe did not begin or end with WR32" in a DOSy looking 
error box -

I did a google of the error and found only a single reference at 
http://forums.opensuse.org/english/other-forums/looking-something-other-than-support/417965-regular-expression-tester-2.html

The interesting thing is that, best that I can tell, that same error 
popped up with Lisp in a Linux application -

This implies, perhaps, that it is some sort of startup code generated 
by the Delivery mechanism that fails during the Lisp start 
sequence(??), considering that it has been seen in both a Windows XP 
and Linux environment.

The error goes away (usually) if I recompile/rebuild/redeliver the 
app. It is quite sporadic - last time I saw this was several months ago.

Has anyone seen this and/or know what it might mean and, of course, 
how to kill the wretched thing with some incantation or the other??


Regards on a lovely fall day from the Rocky Mountains.

Jack Harper
Secure Outcomes Inc.
Evergreen, Colorado USA


Updated at: 2020-12-10 08:39 UTC