Michel,
thanks a lot for explanation. Despite its name, I always thought that #displayString is intended to answer aText for two reasons: 1) - see method comment Allows any Object to be used as the basis for a Label, although the purpose of displayString is to provide something more suitable than printString, primarily for use in SequenceViews. 2) it's used for SequenceViews, which can show emphasis. Then, why not have it answer a Text? In 7.4 vanillla.im, I did the following experiment: 1) browse all implementors of #displayString 2) select them all 3) use rewrite tool to rewrite ^``@stats to temp := ``@stats. Transcript show: temp class name; cr. ^temp (not a perfect rewrite - temp is not declared - but a quick one to create :-) 4) do the rewrite 5) open system browser and play with it ... you'll see a mix of Text and String in the Transcript. Therefore, Cincom ("officially") sometimes uses #displayString to answer Text, too. On Milan's SeaSide problem with result of #displayString being stored in a dictionary, in the light that #displayString "officially" uses #displayString to answer both aText and aString: can we use ... displayString asString in Seaside? Please get me right: I don't want to downgrade what Avi decided with the VW team, I want to be sure what #displayString should answer. If this is to be aString, then, how do we (simply!) make SequenceViews to show something with emphasis? (visualBlock or setting it's own displayStringSelector are not very simple for new-comers). Thanks a lot, Petr Stepanek > -----Original Message----- > From: Milan Čermák [mailto:[hidden email]] > Sent: Wednesday, March 08, 2006 1:05 PM > To: Petr Stepanek > Subject: [Fwd: RE: SeasideForSwazoo bundle] > > > > -------- Původní zpráva -------- > Předmět: RE: SeasideForSwazoo bundle > Datum: Wed, 8 Mar 2006 11:39:32 -0000 > Od: Bany, Michel <[hidden email]> > Komu: Milan Cermák <[hidden email]> > > This code was automatically ported from Squeak. > > Apparently, the count i-var is a value holder for a number, this needs > to be converted to a String. > #displayString does exactly that. > > We did not use #asString for this conversion to String because VW does > not have Object>>asString > and has Object>>displayString. > > Please note that the use of #displayString rather than #asString for > converting objects to String > is the result of an agreement after thourough discussions > involving Avi > Bryant and the VW engineering > team. > > We could use #asString in this very specific case because VW has > Number>>asString and > we know that we have a number. > > However, #displayString is used in many places by Seaside with the > assumption > that a String is returned, not a Text. So even if you fix the #nextKey > method to > use #asString, it will probably break in other places. > > My conclusion is that you took a big risk overriding #displayString. > > HTH, > Michel. > > > > > > -----Original Message----- > > From: Milan Cermák [mailto:[hidden email]] > > Sent: Wednesday, March 08, 2006 11:59 AM > > To: Bany, Michel > > Subject: Re: SeasideForSwazoo bundle > > > > Hi Michel, > > I made some investigation in my image and found the reason. > > Now I'm curious about WARenderingContext>>#nextKey method: > > > > nextKey > > ^ count contents displayString > > > > I wonder why do you use #displayString for key construction. > > > > The problem that arise in my image was that my coleague overrided > > Object>>#displayString to return Text ('cause it can do better > > formating). This value you use as a key in dictionary of > > callbacks. But when the reply comes this callback dictionary > > is searched with String key. And they don't compare do each other. > > > > Thanks, > > Milan > > > > Bany, Michel wrote: > > > I quickly tried it on VW 7.4 and did not get any of your symptoms. > > > > > > Since VW 7.4 comes with Swazoo 1.0 rather than 0.9.94, I > > also made the > > > effort of trying it also in VW 7.3. > > > I did not get your symptoms either. > > > > > > Finally, I published SeasideForSwazoo (2.6a2.125.0,mbany) > > and gave it > > > a quick try in VW 7.3. All the things I tried worked fine. > > > > > > Did you load things into a virgin VW image ? > > > Usually we get all sort of weird results if you load on top > > of older > > > versions. > > > > > > Best luck with SeasideForSwazoo 2.6a2.125.0, Michel > > > > -- > > Ing. Milan Čermák > > programátor, analytik > > > > [hidden email] > > > > ................................................................ > > e-FRACTAL, s.r.o. => e-business driven company nám. Míru 15, > > Praha 2, http://www.e-fractal.cz > > tel: 222 512 000, fax: 222 515 000 > > ................................................................ > > > > > > > > -- > Ing. Milan Čermák > programátor, analytik > > [hidden email] > > ................................................................ > e-FRACTAL, s.r.o. => e-business driven company > nám. Míru 15, Praha 2, http://www.e-fractal.cz > tel: 222 512 000, fax: 222 515 000 > ................................................................ > |
Hi Petr,
Ah, ok, thanks for all these details, that I was not aware of. I was just trusting the method selector name. Have you try to use #asString instead of #displayString in #nextKey ? If we are lucky and nothing else breaks, then I will update Seaside to use #asString in this method. Michel. > -----Original Message----- > From: Petr Stepanek [mailto:[hidden email]] > Sent: Thursday, March 09, 2006 10:55 AM > To: 'VWNC' > Subject: RE: VW SeasideForSwazoo bundle > > Michel, > thanks a lot for explanation. > > Despite its name, I always thought that #displayString is > intended to answer aText for two reasons: > 1) - see method comment > > Allows any Object to be used as the basis for a Label, > although the purpose of displayString is to provide something > more suitable than printString, primarily for use in SequenceViews. > > 2) it's used for SequenceViews, which can show emphasis. > Then, why not have it answer a Text? > > In 7.4 vanillla.im, I did the following experiment: > 1) browse all implementors of #displayString > 2) select them all > 3) use rewrite tool to rewrite > ^``@stats > > to > > temp := ``@stats. > Transcript show: temp class name; cr. > ^temp > > (not a perfect rewrite - temp is not declared - but a quick > one to create > :-) > > 4) do the rewrite > 5) open system browser and play with it > > ... you'll see a mix of Text and String in the Transcript. > > Therefore, Cincom ("officially") sometimes uses > #displayString to answer Text, too. > > On Milan's SeaSide problem with result of #displayString > being stored in a dictionary, in the light that > #displayString "officially" uses #displayString to answer > both aText and aString: can we use ... > displayString asString in Seaside? > Please get me right: I don't want to downgrade what Avi > decided with the VW team, I want to be sure what > #displayString should answer. If this is to be aString, then, > how do we (simply!) make SequenceViews to show something with > emphasis? (visualBlock or setting it's own > displayStringSelector are not very simple for new-comers). > > Thanks a lot, > Petr Stepanek > > > > > > > > -----Original Message----- > > From: Milan Čermák [mailto:[hidden email]] > > Sent: Wednesday, March 08, 2006 1:05 PM > > To: Petr Stepanek > > Subject: [Fwd: RE: SeasideForSwazoo bundle] > > > > > > > > -------- Původní zpráva -------- > > Předmět: RE: SeasideForSwazoo bundle > > Datum: Wed, 8 Mar 2006 11:39:32 -0000 > > Od: Bany, Michel <[hidden email]> > > Komu: Milan Cermák <[hidden email]> > > > > This code was automatically ported from Squeak. > > > > Apparently, the count i-var is a value holder for a number, > this needs > > to be converted to a String. > > #displayString does exactly that. > > > > We did not use #asString for this conversion to String > because VW does > > not have Object>>asString and has Object>>displayString. > > > > Please note that the use of #displayString rather than > #asString for > > converting objects to String is the result of an agreement after > > thourough discussions involving Avi Bryant and the VW engineering > > team. > > > > We could use #asString in this very specific case because VW has > > Number>>asString and > > we know that we have a number. > > > > However, #displayString is used in many places by Seaside with the > > assumption that a String is returned, not a Text. So even > if you fix > > the #nextKey method to use #asString, it will probably > break in other > > places. > > > > My conclusion is that you took a big risk overriding #displayString. > > > > HTH, > > Michel. > > > > > > > > > > > -----Original Message----- > > > From: Milan Cermák [mailto:[hidden email]] > > > Sent: Wednesday, March 08, 2006 11:59 AM > > > To: Bany, Michel > > > Subject: Re: SeasideForSwazoo bundle > > > > > > Hi Michel, > > > I made some investigation in my image and found the reason. > > > Now I'm curious about WARenderingContext>>#nextKey method: > > > > > > nextKey > > > ^ count contents displayString > > > > > > I wonder why do you use #displayString for key construction. > > > > > > The problem that arise in my image was that my coleague overrided > > > Object>>#displayString to return Text ('cause it can do better > > > formating). This value you use as a key in dictionary of > callbacks. > > > But when the reply comes this callback dictionary is > searched with > > > String key. And they don't compare do each other. > > > > > > Thanks, > > > Milan > > > > > > Bany, Michel wrote: > > > > I quickly tried it on VW 7.4 and did not get any of > your symptoms. > > > > > > > > Since VW 7.4 comes with Swazoo 1.0 rather than 0.9.94, I > > > also made the > > > > effort of trying it also in VW 7.3. > > > > I did not get your symptoms either. > > > > > > > > Finally, I published SeasideForSwazoo (2.6a2.125.0,mbany) > > > and gave it > > > > a quick try in VW 7.3. All the things I tried worked fine. > > > > > > > > Did you load things into a virgin VW image ? > > > > Usually we get all sort of weird results if you load on top > > > of older > > > > versions. > > > > > > > > Best luck with SeasideForSwazoo 2.6a2.125.0, Michel > > > > > > -- > > > Ing. Milan Čermák > > > programátor, analytik > > > > > > [hidden email] > > > > > > ................................................................ > > > e-FRACTAL, s.r.o. => e-business driven company nám. Míru > 15, Praha > > > 2, http://www.e-fractal.cz > > > tel: 222 512 000, fax: 222 515 000 > > > ................................................................ > > > > > > > > > > > > > > -- > > Ing. Milan Čermák > > programátor, analytik > > > > [hidden email] > > > > ................................................................ > > e-FRACTAL, s.r.o. => e-business driven company nám. Míru > 15, Praha 2, > > http://www.e-fractal.cz > > tel: 222 512 000, fax: 222 515 000 > > ................................................................ > > > > > |
Hi Michael,
no problem :-) We tried that, and ... displayString asString ... in the #nextKey works. Petr > -----Original Message----- > From: Bany, Michel [mailto:[hidden email]] > Sent: Thursday, March 09, 2006 1:33 PM > To: Petr Stepanek; VWNC > Subject: RE: VW SeasideForSwazoo bundle > > Hi Petr, > > Ah, ok, thanks for all these details, that I was not aware of. > I was just trusting the method selector name. > > Have you try to use #asString instead of #displayString in #nextKey ? > > If we are lucky and nothing else breaks, then I will update > Seaside to use #asString in this method. > > Michel. > > > > > -----Original Message----- > > From: Petr Stepanek [mailto:[hidden email]] > > Sent: Thursday, March 09, 2006 10:55 AM > > To: 'VWNC' > > Subject: RE: VW SeasideForSwazoo bundle > > > > Michel, > > thanks a lot for explanation. > > > > Despite its name, I always thought that #displayString is > > intended to answer aText for two reasons: > > 1) - see method comment > > > > Allows any Object to be used as the basis for a Label, > > although the purpose of displayString is to provide something > > more suitable than printString, primarily for use in SequenceViews. > > > > 2) it's used for SequenceViews, which can show emphasis. > > Then, why not have it answer a Text? > > > > In 7.4 vanillla.im, I did the following experiment: > > 1) browse all implementors of #displayString > > 2) select them all > > 3) use rewrite tool to rewrite > > ^``@stats > > > > to > > > > temp := ``@stats. > > Transcript show: temp class name; cr. > > ^temp > > > > (not a perfect rewrite - temp is not declared - but a quick > > one to create > > :-) > > > > 4) do the rewrite > > 5) open system browser and play with it > > > > ... you'll see a mix of Text and String in the Transcript. > > > > Therefore, Cincom ("officially") sometimes uses > > #displayString to answer Text, too. > > > > On Milan's SeaSide problem with result of #displayString > > being stored in a dictionary, in the light that > > #displayString "officially" uses #displayString to answer > > both aText and aString: can we use ... > > displayString asString in Seaside? > > Please get me right: I don't want to downgrade what Avi > > decided with the VW team, I want to be sure what > > #displayString should answer. If this is to be aString, then, > > how do we (simply!) make SequenceViews to show something with > > emphasis? (visualBlock or setting it's own > > displayStringSelector are not very simple for new-comers). > > > > Thanks a lot, > > Petr Stepanek > > > > > > > > > > > > > > > -----Original Message----- > > > From: Milan Čermák [mailto:[hidden email]] > > > Sent: Wednesday, March 08, 2006 1:05 PM > > > To: Petr Stepanek > > > Subject: [Fwd: RE: SeasideForSwazoo bundle] > > > > > > > > > > > > -------- Původní zpráva -------- > > > Předmět: RE: SeasideForSwazoo bundle > > > Datum: Wed, 8 Mar 2006 11:39:32 -0000 > > > Od: Bany, Michel <[hidden email]> > > > Komu: Milan Cermák <[hidden email]> > > > > > > This code was automatically ported from Squeak. > > > > > > Apparently, the count i-var is a value holder for a number, > > this needs > > > to be converted to a String. > > > #displayString does exactly that. > > > > > > We did not use #asString for this conversion to String > > because VW does > > > not have Object>>asString and has Object>>displayString. > > > > > > Please note that the use of #displayString rather than > > #asString for > > > converting objects to String is the result of an agreement after > > > thourough discussions involving Avi Bryant and the VW engineering > > > team. > > > > > > We could use #asString in this very specific case because VW has > > > Number>>asString and > > > we know that we have a number. > > > > > > However, #displayString is used in many places by Seaside > with the > > > assumption that a String is returned, not a Text. So even > > if you fix > > > the #nextKey method to use #asString, it will probably > > break in other > > > places. > > > > > > My conclusion is that you took a big risk overriding > #displayString. > > > > > > HTH, > > > Michel. > > > > > > > > > > > > > > > > -----Original Message----- > > > > From: Milan Cermák [mailto:[hidden email]] > > > > Sent: Wednesday, March 08, 2006 11:59 AM > > > > To: Bany, Michel > > > > Subject: Re: SeasideForSwazoo bundle > > > > > > > > Hi Michel, > > > > I made some investigation in my image and found the reason. > > > > Now I'm curious about WARenderingContext>>#nextKey method: > > > > > > > > nextKey > > > > ^ count contents displayString > > > > > > > > I wonder why do you use #displayString for key construction. > > > > > > > > The problem that arise in my image was that my coleague > overrided > > > > Object>>#displayString to return Text ('cause it can do better > > > > formating). This value you use as a key in dictionary of > > callbacks. > > > > But when the reply comes this callback dictionary is > > searched with > > > > String key. And they don't compare do each other. > > > > > > > > Thanks, > > > > Milan > > > > > > > > Bany, Michel wrote: > > > > > I quickly tried it on VW 7.4 and did not get any of > > your symptoms. > > > > > > > > > > Since VW 7.4 comes with Swazoo 1.0 rather than 0.9.94, I > > > > also made the > > > > > effort of trying it also in VW 7.3. > > > > > I did not get your symptoms either. > > > > > > > > > > Finally, I published SeasideForSwazoo (2.6a2.125.0,mbany) > > > > and gave it > > > > > a quick try in VW 7.3. All the things I tried worked fine. > > > > > > > > > > Did you load things into a virgin VW image ? > > > > > Usually we get all sort of weird results if you load on top > > > > of older > > > > > versions. > > > > > > > > > > Best luck with SeasideForSwazoo 2.6a2.125.0, Michel > > > > > > > > -- > > > > Ing. Milan Čermák > > > > programátor, analytik > > > > > > > > [hidden email] > > > > > > > > ................................................................ > > > > e-FRACTAL, s.r.o. => e-business driven company nám. Míru > > 15, Praha > > > > 2, http://www.e-fractal.cz > > > > tel: 222 512 000, fax: 222 515 000 > > > > ................................................................ > > > > > > > > > > > > > > > > > > > > -- > > > Ing. Milan Čermák > > > programátor, analytik > > > > > > [hidden email] > > > > > > ................................................................ > > > e-FRACTAL, s.r.o. => e-business driven company nám. Míru > > 15, Praha 2, > > > http://www.e-fractal.cz > > > tel: 222 512 000, fax: 222 515 000 > > > ................................................................ > > > > > > > > > > |
In reply to this post by Petr Štěpánek-2
Bob,
I agree with all you wrote. I think #printText would be a nice method! Petr > -----Original Message----- > From: Jarvis, Robert P. (Bob) (Contingent) > [mailto:[hidden email]] > Sent: Thursday, March 09, 2006 2:13 PM > To: Petr Stepanek > Subject: RE: VW SeasideForSwazoo bundle > > I think the comment to which you referred is outdated. I > believe these selectors are intention-revealing and that > #displayString and #printString should answer a String, not a > Text. If a Text is desired one should either create it from > what is answered by these methods or add the appropriate > methods to String, e.g. #displayText and #printText. The > (draft) ANSI Smalltalk standard says nothing about > #displayString but does have guidelines for #printString, as follows: > > 5.3.1.18 Message: printString > Synopsis > Return a string that describes the receiver. > Definition: <Object> > A string consisting of a sequence of > characters that describe the receiver are returned as the result. > The exact sequence of characters that > describe an object are implementation defined. > Return Value > <readableString> unspecified > Errors > none > > So it appears that #printString should answer something that > conforms to the "readableString" protocol. Hmmm...I don't > know if Text conforms to "readableString" (see > http://minnow.cc.gatech.edu/squeak/uploads/172/standard_v1_9-i > ndexed.pdf for more info), but if it does then one could > reasonably argue that it would be valid to answer a Text from > #printString. > > FWIW my understanding has been that #printString should > answer a String describing the object in a fashion most > useful to a developer (e.g. for display in the debugger), > while #displayString should answer a String describing the > object in a manner most useful to a non-developer. > > YMMV. > > Bob > > -----Original Message----- > From: Petr Stepanek [mailto:[hidden email]] > Sent: Thursday, March 09, 2006 4:55 AM > To: 'VWNC' > Subject: RE: VW SeasideForSwazoo bundle > > Michel, > thanks a lot for explanation. > > Despite its name, I always thought that #displayString is intended to > answer aText for two reasons: > 1) - see method comment > > Allows any Object to be used as the basis for a Label, although the > purpose of displayString is to provide something more suitable than > printString, primarily for use in SequenceViews. > > 2) it's used for SequenceViews, which can show emphasis. > Then, why not have > it answer a Text? > > In 7.4 vanillla.im, I did the following experiment: > 1) browse all implementors of #displayString > 2) select them all > 3) use rewrite tool to rewrite > ^``@stats > > to > > temp := ``@stats. > Transcript show: temp class name; cr. > ^temp > > (not a perfect rewrite - temp is not declared - but a quick > one to create > :-) > > 4) do the rewrite > 5) open system browser and play with it > > .... you'll see a mix of Text and String in the Transcript. > > Therefore, Cincom ("officially") sometimes uses > #displayString to answer > Text, too. > > On Milan's SeaSide problem with result of #displayString > being stored in a > dictionary, in the light that #displayString "officially" uses > #displayString to answer both aText and aString: can we use ... > displayString asString in Seaside? > Please get me right: I don't want to downgrade what Avi > decided with the VW > team, I want to be sure what #displayString should answer. If > this is to be > aString, then, how do we (simply!) make SequenceViews to show > something with > emphasis? (visualBlock or setting it's own > displayStringSelector are not > very simple for new-comers). > > Thanks a lot, > Petr Stepanek > > > > > > > > -----Original Message----- > > From: Milan Čermák [mailto:[hidden email]] > > Sent: Wednesday, March 08, 2006 1:05 PM > > To: Petr Stepanek > > Subject: [Fwd: RE: SeasideForSwazoo bundle] > > > > > > > > -------- Původní zpráva -------- > > Předmět: RE: SeasideForSwazoo bundle > > Datum: Wed, 8 Mar 2006 11:39:32 -0000 > > Od: Bany, Michel <[hidden email]> > > Komu: Milan Cermák <[hidden email]> > > > > This code was automatically ported from Squeak. > > > > Apparently, the count i-var is a value holder for a number, > this needs > > to be converted to a String. > > #displayString does exactly that. > > > > We did not use #asString for this conversion to String > because VW does > > not have Object>>asString > > and has Object>>displayString. > > > > Please note that the use of #displayString rather than #asString for > > converting objects to String > > is the result of an agreement after thourough discussions > > involving Avi > > Bryant and the VW engineering > > team. > > > > We could use #asString in this very specific case because VW has > > Number>>asString and > > we know that we have a number. > > > > However, #displayString is used in many places by Seaside with the > > assumption > > that a String is returned, not a Text. So even if you fix > the #nextKey > > method to > > use #asString, it will probably break in other places. > > > > My conclusion is that you took a big risk overriding #displayString. > > > > HTH, > > Michel. > > > > > > > > > > > -----Original Message----- > > > From: Milan Cermák [mailto:[hidden email]] > > > Sent: Wednesday, March 08, 2006 11:59 AM > > > To: Bany, Michel > > > Subject: Re: SeasideForSwazoo bundle > > > > > > Hi Michel, > > > I made some investigation in my image and found the reason. > > > Now I'm curious about WARenderingContext>>#nextKey method: > > > > > > nextKey > > > ^ count contents displayString > > > > > > I wonder why do you use #displayString for key construction. > > > > > > The problem that arise in my image was that my coleague overrided > > > Object>>#displayString to return Text ('cause it can do better > > > formating). This value you use as a key in dictionary of > > > callbacks. But when the reply comes this callback dictionary > > > is searched with String key. And they don't compare do each other. > > > > > > Thanks, > > > Milan > > > > > > Bany, Michel wrote: > > > > I quickly tried it on VW 7.4 and did not get any of > your symptoms. > > > > > > > > Since VW 7.4 comes with Swazoo 1.0 rather than 0.9.94, I > > > also made the > > > > effort of trying it also in VW 7.3. > > > > I did not get your symptoms either. > > > > > > > > Finally, I published SeasideForSwazoo (2.6a2.125.0,mbany) > > > and gave it > > > > a quick try in VW 7.3. All the things I tried worked fine. > > > > > > > > Did you load things into a virgin VW image ? > > > > Usually we get all sort of weird results if you load on top > > > of older > > > > versions. > > > > > > > > Best luck with SeasideForSwazoo 2.6a2.125.0, Michel > > > > > > -- > > > Ing. Milan Čermák > > > programátor, analytik > > > > > > [hidden email] > > > > > > ................................................................ > > > e-FRACTAL, s.r.o. => e-business driven company nám. Míru 15, > > > Praha 2, http://www.e-fractal.cz > > > tel: 222 512 000, fax: 222 515 000 > > > ................................................................ > > > > > > > > > > > > > > -- > > Ing. Milan Čermák > > programátor, analytik > > > > [hidden email] > > > > ................................................................ > > e-FRACTAL, s.r.o. => e-business driven company > > nám. Míru 15, Praha 2, http://www.e-fractal.cz > > tel: 222 512 000, fax: 222 515 000 > > ................................................................ > > > > > > ----------------------------------------- > This message and any attachments are intended for the individual or > entity named above. If you are not the intended recipient, please > do not forward, copy, print, use or disclose this communication to > others; also please notify the sender by replying to this message, > and then delete it from your system. The Timken Company / The > Timken Corporation > > |
Free forum by Nabble | Edit this page |