CLIM mail archive
Accept with '(or...) types that have accept methods
Date: Wed, 2 Sep 1992 09:58 CDT
From: Scott McKay <SWM@STONY-BROOK.SCRC.Symbolics.COM>
Date: Tue, 1 Sep 1992 22:31 EDT
From: "Donald H. Mitchell" <email@example.com>
CLIM 1.1 Genera 8.1
I noticed something odd and was wondering whether anyone has a fix. I define two
presentation types and give each an accept method (using completing-from-suggestions),
and then do an accept on '(or one-type the-other). If I type sufficient to uniquely
identify an object from the first type (one-type) and hit <tab>, it completes. If I try
for an object from the second type (the-other), the first time I hit <tab> nothing
happens; if I immediately hit it again, then it completes. After hitting it twice, it
keeps working for either type (within the same accept call).
It doesn't surprise me that, in the second case, hitting <Tab> doesn't
complete from the second completion set. It surprised me at first that
hitting <Tab> a second time completed from the second set, but then I
realized that this is the "expected" behavior. It really surpises me
that hitting <Tab> after that completes from either set; I don't see how
that can happen.
Mea culpa, it doesn't today but I could swear it did yesterday.
Background: the OR type is implemented by looping over the component
types and running the ACCEPT method for each of components. If one type
"fails" (by signalling a parse-error), the next type is tried....
Why not try the second and so on right away? That is, before the next event? It seems
to continually retry the first one: i.e., I can't get it to require two tabs no matter
whether I make it fail at first or not.
Please consider making it try each accept method in turn for or's in CLIM 2.0.
I suppose no matter what you do it will always complete the input according to the first
type before checking to see if the input is truly unique by comparison to the other
types. That is, if one-type = "One" "Two" "Four" and the-other = "Own" "The" "Floor",
then typing the first character followed by <tab> will complete according to
possibilities for one-type. I don't know that I'd change this behavior but I certainly
would make it known in the documentation for 'or.
Don Mitchell firstname.lastname@example.org
Amoco Production Company (918) 660-4270
Tulsa Research Center
P.O. Box 3385, Tulsa, OK 74102
Main Index |