The Inbox: Kernel-nice.1200.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

The Inbox: Kernel-nice.1200.mcz

commits-2
Nicolas Cellier uploaded a new version of Kernel to project The Inbox:
http://source.squeak.org/inbox/Kernel-nice.1200.mcz

==================== Summary ====================

Name: Kernel-nice.1200
Author: nice
Time: 9 December 2018, 11:17:42.830548 am
UUID: 4608ee87-5859-4132-918f-df0f71dcc07e
Ancestors: Kernel-eem.1199

Let's make basicInspect robust to crazy numbers.

With http://www.squeaksource.com/ArbitraryPrecisionFl.html
I can create crazy numbers like this:
((1 asArbitraryPrecisionFloatNumBits: 100) timesTwoPower: 1e100)

But then I can't print to decimal form (a bit too many bytes to be allocated....).

The problem when debugging such monster is that basicInspect is not basicEnough: it insists on printing the Number in the inspector title (label)!

If we invoke basicInspect, we generally want something basic. Even if we just inspect, having a label spanning more than 100 chars is vain...

So let's be robust.

=============== Diff against Kernel-eem.1199 ===============

Item was changed:
  ----- Method: Number>>defaultLabelForInspector (in category 'printing') -----
  defaultLabelForInspector
  "Answer the default label to be used for an Inspector window on the receiver."
 
+ ^ super defaultLabelForInspector, ': ', ([self printStringLimitedTo: 100]
+ ifError: ['<error cannot print this number>'])!
- ^ super defaultLabelForInspector, ': ', self printString!


Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: Kernel-nice.1200.mcz

Eliot Miranda-2
Hi Nicolas,

    I think you should move this to trunk.

On Sun, Dec 9, 2018 at 2:17 AM <[hidden email]> wrote:
Nicolas Cellier uploaded a new version of Kernel to project The Inbox:
http://source.squeak.org/inbox/Kernel-nice.1200.mcz

==================== Summary ====================

Name: Kernel-nice.1200
Author: nice
Time: 9 December 2018, 11:17:42.830548 am
UUID: 4608ee87-5859-4132-918f-df0f71dcc07e
Ancestors: Kernel-eem.1199

Let's make basicInspect robust to crazy numbers.

With http://www.squeaksource.com/ArbitraryPrecisionFl.html
I can create crazy numbers like this:
((1 asArbitraryPrecisionFloatNumBits: 100) timesTwoPower: 1e100)

But then I can't print to decimal form (a bit too many bytes to be allocated....).

The problem when debugging such monster is that basicInspect is not basicEnough: it insists on printing the Number in the inspector title (label)!

If we invoke basicInspect, we generally want something basic. Even if we just inspect, having a label spanning more than 100 chars is vain...

So let's be robust.

=============== Diff against Kernel-eem.1199 ===============

Item was changed:
  ----- Method: Number>>defaultLabelForInspector (in category 'printing') -----
  defaultLabelForInspector
        "Answer the default label to be used for an Inspector window on the receiver."

+       ^ super defaultLabelForInspector, ': ', ([self printStringLimitedTo: 100]
+               ifError: ['<error cannot print this number>'])!
-       ^ super defaultLabelForInspector, ': ', self printString!




--
_,,,^..^,,,_
best, Eliot


Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: Kernel-nice.1200.mcz

David T. Lewis
On Sun, Dec 09, 2018 at 10:45:15PM -0800, Eliot Miranda wrote:
> Hi Nicolas,
>
>     I think you should move this to trunk.

+1

Dave


>
> On Sun, Dec 9, 2018 at 2:17 AM <[hidden email]> wrote:
>
> > Nicolas Cellier uploaded a new version of Kernel to project The Inbox:
> > http://source.squeak.org/inbox/Kernel-nice.1200.mcz
> >
> > ==================== Summary ====================
> >
> > Name: Kernel-nice.1200
> > Author: nice
> > Time: 9 December 2018, 11:17:42.830548 am
> > UUID: 4608ee87-5859-4132-918f-df0f71dcc07e
> > Ancestors: Kernel-eem.1199
> >
> > Let's make basicInspect robust to crazy numbers.
> >
> > With http://www.squeaksource.com/ArbitraryPrecisionFl.html
> > I can create crazy numbers like this:
> > ((1 asArbitraryPrecisionFloatNumBits: 100) timesTwoPower: 1e100)
> >
> > But then I can't print to decimal form (a bit too many bytes to be
> > allocated....).
> >
> > The problem when debugging such monster is that basicInspect is not
> > basicEnough: it insists on printing the Number in the inspector title
> > (label)!
> >
> > If we invoke basicInspect, we generally want something basic. Even if we
> > just inspect, having a label spanning more than 100 chars is vain...
> >
> > So let's be robust.
> >
> > =============== Diff against Kernel-eem.1199 ===============
> >
> > Item was changed:
> >   ----- Method: Number>>defaultLabelForInspector (in category 'printing')
> > -----
> >   defaultLabelForInspector
> >         "Answer the default label to be used for an Inspector window on
> > the receiver."
> >
> > +       ^ super defaultLabelForInspector, ': ', ([self
> > printStringLimitedTo: 100]
> > +               ifError: ['<error cannot print this number>'])!
> > -       ^ super defaultLabelForInspector, ': ', self printString!
> >
> >
> >
>
> --
> _,,,^..^,,,_
> best, Eliot

>