Travis,
(eachSelector first: 4) assumes the selector length of at least that much, how about? testSelectorsDo: aBlock self == TestCase ifTrue: [^self]. self selectorsAndMethodsDo: [:eachSelector :eachMethod | ((eachSelector size > 3 and: [(eachSelector first: 4) = 'test']) or: [eachMethod hasAttributeSelector: #test]) ifTrue: [aBlock value: eachSelector]]. superclass testSelectorsDo: aBlock Cheers, -Boris -- +1.604.689.0322 DeepCove Labs Ltd. 4th floor 595 Howe Street Vancouver, Canada V6C 2T5 [hidden email] CONFIDENTIALITY NOTICE This email is intended only for the persons named in the message header. Unless otherwise indicated, it contains information that is private and confidential. If you have received it in error, please notify the sender and delete the entire message including any attachments. Thank you. |
On Oct 4, 2006, at 15:29, Boris Popov wrote:
I'm confused. I checked that case and concluded it shouldn't be to worry about. For example: ('abc' first: 4) --> 'abc' (#abc first: 4) --> 'abc' so one wonders. What version of VW are you using? Maybe this is this something that's changed recently? I'll just inline the min:'ed copyFrom:to: if necessary. Thanks for bringing it up Boris. -- Travis Griggs Objologist "Dying men never wish they'd spent more time at the office" |
You're absolutely right, the faulty version comes with
Squeak-Extensions, first: n "Answer the first n elements of the receiver. Raise an error if there are not enough elements." ^ self copyFrom: 1 to: n I'd have to check with Michel Bany to see whether this is something that's part of each port or maintained separately, if it's the latter he could remove the override, if it's the former I'd be great if SUnitToo could have an extra safeguard. Thanks! -Boris -- +1.604.689.0322 DeepCove Labs Ltd. 4th floor 595 Howe Street Vancouver, Canada V6C 2T5 [hidden email] CONFIDENTIALITY NOTICE This email is intended only for the persons named in the message header. Unless otherwise indicated, it contains information that is private and confidential. If you have received it in error, please notify the sender and delete the entire message including any attachments. Thank you. -----Original Message----- From: Travis Griggs [mailto:[hidden email]] Sent: Thursday, October 05, 2006 8:09 AM To: Boris Popov Cc: VWNC Subject: Re: Issue with latest SUnitToo On Oct 4, 2006, at 15:29, Boris Popov wrote: Travis, (eachSelector first: 4) assumes the selector length of at least that much, how about? testSelectorsDo: aBlock self == TestCase ifTrue: [^self]. self selectorsAndMethodsDo: [:eachSelector :eachMethod | ((eachSelector size > 3 and: [(eachSelector first: 4) = 'test']) or: [eachMethod hasAttributeSelector: #test]) ifTrue: [aBlock value: eachSelector]]. superclass testSelectorsDo: aBlock I'm confused. I checked that case and concluded it shouldn't be to worry about. For example: ('abc' first: 4) --> 'abc' (#abc first: 4) --> 'abc' so one wonders. What version of VW are you using? Maybe this is this something that's changed recently? I'll just inline the min:'ed copyFrom:to: if necessary. Thanks for bringing it up Boris. -- Travis Griggs Objologist "Dying men never wish they'd spent more time at the office" |
The (safe) #first: implementation comes with vw 7.4 for the first time.
Another solution could have been (in parallel to the streams next:/nextAvailable) to introduce a #first: method which raises exceptions like sqeak does and a firstAvailable: which is the current safer version. But maybe it is too late to change this behaviour? Thomas > -----Original Message----- > From: Boris Popov [mailto:[hidden email]] > Sent: Thursday, October 05, 2006 6:18 PM > To: Travis Griggs > Cc: VWNC; [hidden email] > Subject: RE: Issue with latest SUnitToo > > You're absolutely right, the faulty version comes with > Squeak-Extensions, > > first: n > "Answer the first n elements of the receiver. > Raise an error if there are not enough elements." > > ^ self copyFrom: 1 to: n > > I'd have to check with Michel Bany to see whether this is something > that's part of each port or maintained separately, if it's > the latter he > could remove the override, if it's the former I'd be great if SUnitToo > could have an extra safeguard. > > Thanks! > > -Boris > > -- > +1.604.689.0322 > DeepCove Labs Ltd. > 4th floor 595 Howe Street > Vancouver, Canada V6C 2T5 > > [hidden email] > > CONFIDENTIALITY NOTICE > > This email is intended only for the persons named in the message > header. Unless otherwise indicated, it contains information that is > private and confidential. If you have received it in error, please > notify the sender and delete the entire message including any > attachments. > > Thank you. > > -----Original Message----- > From: Travis Griggs [mailto:[hidden email]] > Sent: Thursday, October 05, 2006 8:09 AM > To: Boris Popov > Cc: VWNC > Subject: Re: Issue with latest SUnitToo > > > On Oct 4, 2006, at 15:29, Boris Popov wrote: > > > Travis, > > (eachSelector first: 4) assumes the selector length of at least > that > much, how about? > > testSelectorsDo: aBlock > self == TestCase ifTrue: [^self]. > self selectorsAndMethodsDo: [:eachSelector :eachMethod | > ((eachSelector size > 3 and: [(eachSelector first: 4) = 'test']) > or: > [eachMethod hasAttributeSelector: #test]) ifTrue: [aBlock value: > eachSelector]]. > superclass testSelectorsDo: aBlock > > > I'm confused. I checked that case and concluded it shouldn't > be to worry > about. For example: > > ('abc' first: 4) --> 'abc' > (#abc first: 4) --> 'abc' > > so one wonders. What version of VW are you using? Maybe this is this > something that's changed recently? I'll just inline the min:'ed > copyFrom:to: if necessary. > > Thanks for bringing it up Boris. > > -- > Travis Griggs > Objologist > "Dying men never wish they'd spent more time at the office" > > > |
On Oct 5, 2006, at 6:28 PM, Thomas Brodt wrote: > The (safe) #first: implementation comes with vw 7.4 for the first > time. Nothing ontopic, just as a side note: it would be really nice to have a equivalent to Javadoc's @since tag in VW. Gruss, Adrian K. -- Ceterum censeo that #first: should be named #copyTo: ;) |
Free forum by Nabble | Edit this page |