Easy way to define new methods referenced in a method?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Easy way to define new methods referenced in a method?

Tim M
Is there an easy way to define methods when you reference them in a new method?

e.g.
 
renderContentOn: html

  html heading: 'ToDo-List'.
  html div
  class: 'menu';
  with: self menuComponent.


When I save it warns me that menuComponent isn't defined but there is no
option to define a stub method for it? So I simply select that its correct.
Then in the new method there is no refactor operation to implement that method
(in Dolphin I can select the AutoCorrect menu and there is a define method
option - is there some addin for Squeak that does this? Or does everyone
rely on having a test that calls the method and so you let the debugger define
it?)

Tim



_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Easy way to define new methods referenced in a method?

Sophie424
"Tim M" <[hidden email]> wrote in message

> Or does everyone rely on having a test that calls the method and so you
> let the debugger define it?)

I suspect there are smarter options ... but lint will catch many such
errors. The latest dev images has the 'Environment' browser, which lets you
browse just your 1 class, or your 1 class hierarchy, or your 1 package, ...
and scope your lint checks accordingly. Right click in it and Open/Code
Critics. Lukas Renggli's blog has a nice screen-cast demo.

Sophie



_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Easy way to define new methods referenced in a method?

Claus Kick
In reply to this post by Tim M
Tim M wrote:

> Is there an easy way to define methods when you reference them in a new
> method?
>
> e.g.
> renderContentOn: html
>
>  html heading: 'ToDo-List'.
>  html div
>  class: 'menu';
>  with: self menuComponent.
>
>
> When I save it warns me that menuComponent isn't defined but there is no
> option to define a stub method for it? So I simply select that its
> correct. Then in the new method there is no refactor operation to
> implement that method (in Dolphin I can select the AutoCorrect menu and
> there is a define method option - is there some addin for Squeak that
> does this? Or does everyone rely on having a test that calls the method
> and so you let the debugger define it?)

I would be grateful enough if I could tell the browser to ignore this
error because I know what I am doing.
_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners