CLIM mail archive


Re: use of AND and Or in presentation specs

    Date: Tue, 2 Nov 1993 09:07 EST
    From: Rick Duffy <>

    >CLIM 1.1, Lucid 4.0.
    >Could someone enlighten me concerning the use of AND and OR presentation
    >specifiers? That is, where are they supposed to be used?
    >We would like to be able to use them in commands ...
    >  (define-test-window-command (BEEP-ON-A-OR-B-PRESENTATIONS)
    >      ((presentation '(or a b) :gesture :select))
    >    (clim:beep)
    >    (format *standard-output* "~%You found an A or B."))
    >... and/or as presentation specifiers ...
    >  (with-output-as-presentation
    >      (:stream stream :object 'bbb :type '(and a b))
    >      ...)
    >... but we get ...
    >  >>Error: No applicable method exists for the generic-function
    >  CLIM::PRESENTATION-TYPEP-METHOD when called with these arguments: 
    >  (#<{Instance?} #X11B13036> NIL B A)
    >or variations thereof. What is "{Instance?}"? 
    >[We've tried '(or a b) and (or 'a 'b). Test file available on request.]
    > Dan Suthers           | LRDC, room 505A
    >     | 3939 O'Hara Street
    > (412) 624-7036 office | University of Pittsburgh
    > (412) 624-9149 fax    | Pittsburgh, PA 15260

    I'm still pretty new at CLIM (and finding the docs of little help), but
    from what I understand so far, the way to do what you want would be
    to define presentation command translators for a and b. Then, as the 
    frame's command loop is accepting things of type 'command, both
    a and b will become sensitive.

You could do this, but what he has done should work fine.

    I think the 'and and 'or are better used in other cases, like
    (accept '(or integer string)), rather than for trying to accept a


Main Index | Thread Index