[Cuis-dev] [IMPROV] Re: I think i found a bug in the debugger

Hernan Wilkinson hernan.wilkinson at 10pines.com
Sat Aug 7 13:10:40 PDT 2021


I just checked the code and that behavior was introduced in the last
version of that method, before it behaved as Nicola wanted, so thank you
Nicola for pointing this out!

Juan, I think we should get that method back to its previous version. I did
not look for when the change was made and I do not know who jpb is...

On Sat, Aug 7, 2021 at 4:54 PM Juan Vuletich via Cuis-dev <
cuis-dev at lists.cuis.st> wrote:

> I don't think the preference is needed. What about simply:
>
> selectionPrintString
>      "Returns the current selection as a string"
>      ^ self safelyPrintWith: [
>          self selection printTextLimitedTo: self printStringLimit ].
>
> ?
>
> Thanks,
>
> --
> Juan Vuletich
> www.cuis-smalltalk.org
> https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev
> https://github.com/jvuletich
> https://www.linkedin.com/in/juan-vuletich-75611b3
> @JuanVuletich
>
>
> On 8/6/2021 2:17 PM, Gerald Klix via Cuis-dev wrote:
> > Nicola,
> >
> > I always thought this is on purpose, but did
> > not like it.
> > If you look at Inspector>>#selectionPrintString
> >
> > --- snip ---
> > selectionPrintString
> >     "Returns the current selection as a string"
> >     ^self safelyPrintWith: [
> >         | selectedValue |
> >         selectedValue _ self selection.
> >         (selectedValue is: #String)
> >             ifTrue: [ selectedValue ]
> >             ifFalse: [ selectedValue printTextLimitedTo: self
> > printStringLimit]]
> > --- snap ---
> > it has a special case for strings, confirming my suspicion.
> >
> > If you use this method implementation instead
> > --- Schnipp ---
> > selectionPrintString
> >     "Returns the current selection as a string"
> >     ^self safelyPrintWith: [
> >         | selectedValue |
> >         selectedValue _ self selection.
> >         (selectedValue is: #String) and: [ Preferences
> > inspectStringsLiteraly ] ::
> >             ifTrue: [ selectedValue ]
> >             ifFalse: [ selectedValue printTextLimitedTo: self
> > printStringLimit]]
> > --- Schnapp ---
> > we will get the behavior you desired.
> > Please note the inspectStringsLiteraly-method, that
> > defaults to false when not implemented, by virtur
> > of Preferences DNU logic.
> >
> > The attached change set makes the inspector configurable
> > but retains the old behavior.
> > Maybe we can convince Juan to integrate that improvement.
> >
> > HTH and Best Regards,
> >
> > Gerald
> >
> >
> > On 8/6/21 6:14 PM, Nicola Mingotti via Cuis-dev wrote:
> >>
> >> Hi guys,
> >>
> >> I hit a stupid bug today ... to find it was nasty, i think because
> >> the debugger does not show what (at least I) would expect.
> >>
> >> Please see the attached picture here:
> >> https://pasteboard.co/KeEwgAy.png
> >>
> >> If you look at the debugger bottom right pane you think
> >> that 'aStringRepr' is nil, right? Well, it is not so,
> >> If you inspect it, see inspector in the middle of the screen,
> >> you see it actually is 'nil', that is a String containing a 3 letter
> >> value.
> >>
> >> This happens also for numbers, if they are inside Strings the debugger
> >> does not show eg: '123', but 123. That is some kind of "print
> >> representation".
> >>
> >> I think this is very much undesirable and an unexpected behavior,
> >> at least for a beginner;)
> >>
> >> bye
> >> Nicola
> >>
> --
> Cuis-dev mailing list
> Cuis-dev at lists.cuis.st
> https://lists.cuis.st/mailman/listinfo/cuis-dev
>


-- 
<https://10pines.com/>Hernán WilkinsonSoftware Developer, Teacher & Coach

Alem 896, Floor 6, Buenos Aires, Argentina

+54 11 6091 3125

@HernanWilkinson
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20210807/d2b6bd08/attachment.htm>


More information about the Cuis-dev mailing list