Presenter<<name:as: , Development vs Deployed Image Nuance...



I noticed a development image vs a deployed image nuance in the method
Presenter<<name:as: a week ago, and I wanted to mention it here for further
consideration. I suppose it could be considered a bug. I encountered the
issue described bellow in Dolphin 5, but it looks like the same code is used
in Dolphin 6 and the same issue seems to apply.

The method (Presenter<<name:as:) endeavors to ensure that the same name is
not used for multiple sub-presenters. However because the message
#keyAtValue:ifAbsent: is used instead of the message
#keyAtEqualValue:ifAbsent: equivilent, but not identical strings will not be
considered to be duplicates. The effect of this is that a duplicate
presenter name will not raise an error when the presenter is opened in the
development environment, because the strings are probably not identical.
However, when one deploys the application and enables duplicate string
folding the duplication is detected because the strings are now identical
and an error is raised. This is exactly what happened to me. I had a
dialog that worked in my development image, but raise this error after I
deployed it.

If this is deemed to be a bug then one fix would be to use
#keyAtEqualValue:ifAbsent:, however I am not sure if this would be
considered too slow. I will leave this for OA to ponder.

Here is a workspace example of this issue.
=====
s := Shell show.
tpname := 'tpname'.
"First time, should not complain."
s add: TextPresenter new name: tpname.
"This time it does complain since the names are identical."
s add: TextPresenter new name: tpname.
"This does not complain even though the names are equal because they are not
identical."
s add: TextPresenter new name: tpname copy.
=====

Chris


.



Relevant Pages

  • Re: A note on computing thugs and coding bums
    ... Here's my response including a bug fix. ... to make "modern strings" possible was designed and first implemented ... contents to strings, to compare them, and to duplicate them. ... while the Pike code will NEVER work...for international strings. ...
    (comp.programming)
  • IExplorer
    ... these strings fail miserably? ... Or maybe the bug isnt exactly that easily ... program filename or pre-existing CLSID definition in the target ...
    (Vuln-Dev)
  • Re: Most Interesting Bug Track Down
    ... I was writing usable which dealt with strings. ... I had to read through the code in detail before the bug ... legitimate character, not a string terminator. ... Anything involving a stack overrun with stack checking turned off. ...
    (comp.lang.c)
  • RE: Administrivia: List Announcement
    ... The first example is 'just a bug'. ... Ops can be reduced if your compiler could optmize it. ... character strings, which is sort of implied as I read it, then it is pretty ... can express that optimization in vanilla C, ...
    (Vuln-Dev)
  • Community Nugget 3-12-2007 Implementing sets with variant attributes
    ... Sets are like arrays with no duplicate values and where order of the elements is ignored. ... as a new attribute name to a variant using Set ... automatically guarantees that there are no duplicate strings in the set. ... attributes in a set as a alphabetically sorted array. ...
    (comp.lang.labview)