[BUG] [] storeString goes into a tight infinite loop.

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

[BUG] [] storeString goes into a tight infinite loop.

Jerome Peace
[squeak-dev] [BUG] [] storeString goes into a tight infinite loop.


Dave and Elliot and TWIMC,

Given that you can defend your end of things for not causing the problem. Who should take responsibility for fixing it?

So storeString as written has limitations.
Where does that permit me as a naive users to type two words that will crash my system when executed?

I would expect [] storeString to print '[]'. What else should it print? Why should it try to do more than that?
If it can't do that then why can't it give me an error message?

Who is supposed to take responsibility for the behavior of these two words. Why does the user have to deal with a crashed image?

Where is the documentation explaining what I should do to get what I really wanted?

It is all well and good not to take the blame but where is the one who takes responsibility for this?

Yours in perplexity and service, --Jerome Peace

PS. M7639 [BUG] [] storeString goes into a tight infinite loop.

Reply | Threaded
Open this post in threaded view
|

[BUG] some float truncateTo: x results x !!!

CdAB63
Try:

Transcript show: (3.9438283 truncateTo: 2) asString; cr.

It will print a nice 2 !!!
Change to 3. Then, a nice 3 !!!

SqueakVM,
squeak trunk
Linux
always reproducible.

Guess nobody using truncateTo for a while...

Reply | Threaded
Open this post in threaded view
|

Re: [BUG] some float truncateTo: x results x !!!

Nicolas Cellier
This does not contradict my own expectations.
What do you expect ?

Nicolas

2011/6/3 Casimiro de Almeida Barreto <[hidden email]>:

> Try:
>
> Transcript show: (3.9438283 truncateTo: 2) asString; cr.
>
> It will print a nice 2 !!!
> Change to 3. Then, a nice 3 !!!
>
> SqueakVM,
> squeak trunk
> Linux
> always reproducible.
>
> Guess nobody using truncateTo for a while...
>
>

cbc
Reply | Threaded
Open this post in threaded view
|

Re: [BUG] some float truncateTo: x results x !!!

cbc
Well, based on the name, I would have expected
(3.9438283 truncateTo: 2) to return 2.94
and
(3.9438283 truncateTo: 3) to return 2.938
along the lines of
http://en.wikipedia.org/wiki/Truncation  (i.e., my previous exposure
to truncation).

However, from the definition of Number>>truncateTo:, we have:
  Answer the next multiple of aNumber toward zero that is nearest the receiver.
which is interesting, but not what I would have expected at all.

(3.9438283 truncateTo: 1) to returns 3

-Chris

On Fri, Jun 3, 2011 at 2:54 PM, Nicolas Cellier
<[hidden email]> wrote:

> This does not contradict my own expectations.
> What do you expect ?
>
> Nicolas
>
> 2011/6/3 Casimiro de Almeida Barreto <[hidden email]>:
>> Try:
>>
>> Transcript show: (3.9438283 truncateTo: 2) asString; cr.
>>
>> It will print a nice 2 !!!
>> Change to 3. Then, a nice 3 !!!
>>
>> SqueakVM,
>> squeak trunk
>> Linux
>> always reproducible.
>>
>> Guess nobody using truncateTo for a while...
>>
>>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: [BUG] some float truncateTo: x results x !!!

glenpaling
The Squeak implementation is more general:

    Float pi truncateTo: 0.01 -> 3.14
    Float pi truncateTo: 0.001 -> 3.141
    12345 truncateTo: 10 -> 12340

and:
    (16r3FFF truncateTo: 16r10) hex ->16r3FF0
    (Duration seconds: 123456) truncateTo: (Duration minutes: 15) -> 1:10:15:00

Glen