Newbie investigating refactoring browser / conceptual typing question.

G.J.Murphy G.J.Murphy at btinternet.com
Sat Nov 1 13:00:10 UTC 2003


Dear Squeak Group,

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've tried two fixes for this, the first was rather nasty and
involved converting the text to a String instance within
RefactoringBrowser>>findNode. I'm not at all convinced that this is
correct in that I get the impression that most of the codebase *is*
expecting to deal with both Text and String instances via the
ArrayedCollection interface, rather than funneling both into String
instances via optional conversion.

The second was to implement Text>>withSqueakLineEndings so that it
delegates to the aggregated String. This seems healthier, but it
does mean that Text and String don't have a common interface that
defines the ability to receive withSqueakLineEndings messages - you
can tell I come from a strongly typed OO background!

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?

If it is a genuine bug, would anybody care to comment on the fix? I
ask this as person who has resumed doing Smalltalk after a thirteen
year stretch of doing hard C++ with a bit of solitary confinement in
CAML. ;-)

I didn't manage to do much with Smalltalk last time round so take it as
read that I'm a novice.

Any advice would be welcome, even if it's just to say: "Learn how
to install the packages correctly.".

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.

I've enclosed the change set with this message.

Regards,

Gerard
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Bug fix for Refactoring Browser.1.cs
Type: application/octet-stream
Size: 638 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20031101/77e57367/BugfixforRefactoringBrowser.1.obj


More information about the Squeak-dev mailing list