Re: Nested calls to WITH-OUTPUT-AS-PRESENTATION

Mark Nahabedian <[email protected]> Sat, 27 Dec 2003 10:07:08 -0500 (EST)
Newsgroups gmane.lisp.clim
Message-ID <1072537628.3feda01cbf81a@alpha-bits>
> ;; Note the use of NODE-TICK as the redisplay cache value
> (defmethod display-node ((node class-browser-node) stream)
>   (clim:updating-output (stream :unique-id node
> 				:cache-value (node-tick node))
>     (let ((class (node-object node)))
>       (clim:with-output-as-presentation (stream node
> 'class-browser-node)
>         (clim:with-output-as-presentation (stream class 'class-name)
>           (write (node-object-name node) :stream stream))))))
> 
> Why does it include the two nested calls to
> WITH-OUTPUT-AS-PRESENTATION? Given that the application defines
> commands and presentation to command translators involving
> CLASS-BROWSER-NODE, wouldn't it suffice for DISPLAY-NODE to include
> only the first call to WITH-OUTPUT-AS-PRESENTATION? What is the
> purpose of the nested calls?

I've not looked at the rest of the browser code.  One reason that
I might include both calls to WITH-OUTPUT-AS-PRESENTATION would be
to associate several orthogonal behaviors with the pointer foir the
same real estate.

In the case above there are these two presentations:

    NODE       as a CLASS-BROWSER-NODE       and
    CLASS      as a CLASS-NAME

Take a look at all of the presentation actions and presentation 
translators for the two presentation types CLASS-BROWSER-NODE
and CLASS-NAME.

My expectation would be that CLASS-BROWSER-NODE has 
PRESENTATION-TO-COMMAND translators which have to do with behavior
of the browser itself, for example "expand the inferiors of this
node" and that CLASS-NAME has PRESENTATION-TO-COMMAND-TRANSLATORs
(perhaps defined in other applications whose command table is 
inherited by the browser) which display useful textual information
about the so-named class.

Perhaps the implementors could have folded the CLASS-NAME behavior
into CLASS-BROWSER-NODE instead of CLASS-NAME, but they might have
decided that this was a useful distinction.  Perhaps not all 
CLASS-BROWSER-NODEs also behave as CLASS-NAMEs.  Perhaps there are
other unrelated applications which provide behavior for CLASS-NAME
and the implementor envisioned those applications at some point
being integrated with the browser.

--
[To unsubscribe to this list send an email to "[email protected]"
with the following text in the BODY of the message "unsubscribe clim"]