[IDEA] 'buildNewMethods' Preference

Raab, Andreas Andreas.Raab at disney.com
Wed Nov 24 23:53:14 UTC 1999


Ali,

>  When Squeak accepts a freshly coded method, and it
> comes across a method name which you've typed which is
> undefined, it throws up a menu with some suggestions
> for an existing method, or a cancel. It would be great
> to have an extra key in the Preferences which was
> called 'buildNewMethods' (or something), and if set to
> true, would mean that any undefined methods you type
> in as you're coding would be auto-built for you upon
> accepting the new code. Even if the preference was set
> to false, it could still be an option of the methods
> menu which pops up after accepting a new method.

I do not agree - there are many possible problems. For instance, what's
supposed to happen if one writes:

someMethod: anArgument

	self aMethodIJustThoughtOf.
	anArgument anotherMethodIJustThoughtOf.

How would the system know where to put the second method? One might argue
that a method could only be defined for sends to 'self' but even then it is
unclear in which class the method should go (e.g., the class you're working
or one of its superclasses?!) and it would also be inconsistent (and more
likely to be annoying than helpful). Finally, having such a preference
enabled can result in all sorts of problems when you just slightly misspell
a selector - which is usually a very common case and the reason why the
correction menu is actually put up.

> b) you're not interupted by a
> correction menu for something which was quite
> intentional.

But how should the system know when and when not such a name was
intentional?! I often use partial selectors simply because I know the system
will (hopefully) figure out the right one for me (if not, I can still fix it
but usually it's pretty good at it). I would hate it if Squeak would start
compiling new methods for any of my misspellings simply because I would have
to put *much* more effort in writing down the selectors exactly (yes, I am a
lazy guy...)

> I'm sure this would be a no-brainer, and would only
> take a tiny amount of added code to the Squeak image
> to create a really handy addition to Squeaks code tool
> set. Unfortunately, i don't know enough about the
> where or what to do it...any volunteers?

Not me. And I really don't think we should do it.

  Andreas





More information about the Squeak-dev mailing list