Newbie investigating refactoring browser / conceptual typing
question.
Ned Konz
ned at bike-nomad.com
Sat Nov 1 16:04:30 UTC 2003
On Saturday 01 November 2003 5:00 am, G.J.Murphy wrote:
> I've downloaded a brand new image for Squeak 3.6, updated the
> Package Loader, installed MCInstaller and then installed the latest
> version of the Refactoring Browser off the SqueakMap.
>
> If I open a system / refactoring browser, select a method and select
> some arbitrary text in the lower pane, doing a yellow button click
> results in an unimplemented message (withSqueakLineEndings) being
> sent to an instance of Text that corresponds to the contents of the
> lower pane.
> I could hoist withSqueakLineEndings up into ArrayedCollection to
> workaround not having multiple interface inheritance, but that feels
> very wrong indeed - I'd rather take the view that the system is
> completely untyped and have two disjoint interfaces that happen to
> understand the same message, rather then trying to emulate a
> strongly typed design.
>
> Before going any further, is this is genuine bug, or did I simply
> not install the packages correctly?
I think that had you installed the SqueakMap 1.09 package things probably
would have worked better, since it would have loaded Monticello, which has a
(broken) version of this method. This would have also upgraded your Package
Loader as a side effect.
> If it is a genuine bug, would anybody care to comment on the fix?
Yes. It's broken in the same way that my first fix (which is in Monticello)
was: if your string shrinks in size as a result of having its LFs stripped,
your run array no longer corresponds to the string.
I had posted this on 9/16:
withSqueakLineEndings
"Answer a copy of myself in which all sequences of <CR><LF> or <LF>
have been changed to <CR>"
| newText |
(string includes: Character lf)
ifFalse: [^ self copy].
newText _ self
copyReplaceAll: String crlf
with: String cr
asTokens: false.
(newText asString includes: Character lf)
ifFalse: [^ newText].
^ newText
copyReplaceAll: String lf
with: String cr
asTokens: false
I will post my version of this with a test for it.
> FYI, I ran the system SUnit tests before and after the fix:-
>
> BEFORE:
>
> 351 run, 230 passed, 4 failed, 117 errors.
>
> AFTER:
>
> 351 run, 278 passed, 5 failed, 68 errors.
That's interesting. I find it surprising that any of those were even testing
Text>>withSqueakLineEndings.
Were these the RefactoringBrowser tests that you refer to?
--
Ned Konz
http://bike-nomad.com
GPG key ID: BEEA7EFE
More information about the Squeak-dev
mailing list
|