Mantis Bugtracker
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0005707 [Squeak] Kernel minor always 01-07-07 19:47 09-18-08 00:57
Reporter Keith_Hodges View Status public  
Assigned To
Priority normal Resolution open  
Status new   Product Version 3.9
Summary 0005707: 'hello' copyFrom: 6 to: 5 returns ''
Description see summary.

Additional Information
Attached Files

- Relationships
child of 0007194new  copyReplaceFrom:to:with: strange behavior with ill bounds 

- Notes
(0008849 - 553 - 637 - 637 - 637 - 637 - 637)
wiz
01-08-07 02:54

Hi Keith,

I don't understand.
Why is this a bug?
There are no characters between the 6th and 5th.
But there is an insertion point.
So it is not out of range.

What hapeens if you ask about character between 7th and 6th position?

If you are asserting it should be then be useful and add test code to the report.

[OT] I find a lot of your thinking obscure (to me) because of your terseness. It would help if you hold off writing a report until you have time to write enough to bring the reader along.

Yours in ser vice, --Jerome Peace
 
(0012673 - 65 - 77 - 77 - 77 - 77 - 77)
nicolas cellier
09-16-08 21:40

Maybe you'll prefer this one:

'hello' copyFrom: -3/2 to: -5/2.
 
(0012674 - 75 - 85 - 85 - 85 - 85 - 85)
Keith_Hodges
09-16-08 22:15

Jerome, think about it... I am not being terse... its obviously an "rorre".
 
(0012675 - 111 - 129 - 129 - 129 - 129 - 129)
nicolas cellier
09-16-08 22:41

Taking this to the limit, which one would you accept as valid?

'' copyFrom: 1 to: 0.
'' copyFrom: 0 to: -1.
 
(0012676 - 191 - 230 - 230 - 230 - 230 - 230)
Keith_Hodges
09-16-08 22:51

I would consider both should raise exceptions.

copyFrom: lowerIndex to: higherIndex

where lowerIndex <= higherIndex.

but then perhaps I am just Na´ve? (you don't need to answer that)
 
(0012677 - 580 - 666 - 666 - 771 - 771 - 771)
nicolas cellier
09-16-08 23:19

Whether good or not, this is a feature used in existing code base.

It enables for example to write (aSequenceableCollection copyFrom: 1 to: self size) even ifEmpty...

I see some relationship with copyReplaceFrom:to:with:
  'hello' copyReplaceFrom: 6 to: 5 with: ' world'.
  'hello' copyReplaceFrom: 1 to: 0 with: 'world '.
You cannot copyReplaceFrom: 0 to: -1, nor from: 7 to: 6.
However, you can copyFrom:to: with these bounds, and that might be arguable.
I imagine Jerome had some kind of similar idea in mind, thus the questions.

Hehe, that made me test for 0007194
 
(0012678 - 35 - 35 - 35 - 165 - 165 - 165)
nicolas cellier
09-16-08 23:43

There is also a relation with 0006535
 
(0012679 - 912 - 1032 - 1032 - 1032 - 1032 - 1032)
wiz
09-18-08 00:55

Ha,

Now that this has risen to the top of the pile again, I notice I have neglected to reply.

This report needs someone to say what the user story should be. The report w/o that lacks clarity. Which is why I said it was terse. Good minds deserve to give good explainations. So slower minds can catch up quickly.

When are the arguments in range and when are they outside the range?

There are other messages that find meaning in the range 6..5 using it to indicate an insertionPoint.

When the message #copyFrom:to: is sent what are legit arguments and what are not?

Nicolas has come up with some good use cases.

There should be some sunit tests that incorperate them and then those tests should be made to work or modified to work.

So
1) What is the user story?
2) Where are the tests to check if the user story has been implemented?

Yours in curiosity and service, --Jerome Peace
 

- Issue History
Date Modified Username Field Change
01-07-07 19:47 Keith_Hodges New Issue
01-08-07 02:54 wiz Note Added: 0008849
09-16-08 21:40 nicolas cellier Note Added: 0012673
09-16-08 22:15 Keith_Hodges Note Added: 0012674
09-16-08 22:41 nicolas cellier Note Added: 0012675
09-16-08 22:51 Keith_Hodges Note Added: 0012676
09-16-08 23:19 nicolas cellier Note Added: 0012677
09-16-08 23:43 nicolas cellier Note Added: 0012678
09-18-08 00:55 wiz Note Added: 0012679
09-18-08 00:57 wiz Relationship added child of 0007194


Mantis 1.0.8[^]
Copyright © 2000 - 2007 Mantis Group
67 total queries executed.
45 unique queries executed.
Powered by Mantis Bugtracker