Creating missing class within the debugger?

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

Creating missing class within the debugger?

Conrad Taylor
Hi, I'm seeing the following message within the debugger:

UndefinedObject(Object)>>doesNotUnderstand:

Thus, is there an easy way to create the missing class from the debugger screen using VW 7.8nc?  BTW, I'm just experimenting with a possible development work. 

--

Think different and code well,

-Conrad



_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: Creating missing class within the debugger?

Mark Roberts
Hi Conrad,

I'd have to see the context but usually this means the receiver is nil. Either an instance variable didn't get initialized or a previous send unexpectedly returned nil.

If you need to create a class, you can open another System Browser, create your new class, and then resume execution back in the debugger, either from the beginning of the current method, or from the previous one on the stack. These are the standard Debugger features.

HTH,

Mark

On 6/7/2012 10:46 AM, Conrad Taylor wrote:
Hi, I'm seeing the following message within the debugger:

UndefinedObject(Object)>>doesNotUnderstand:

Thus, is there an easy way to create the missing class from the debugger screen using VW 7.8nc?  BTW, I'm just experimenting with a possible development work. 

--

Think different and code well,

-Conrad




_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: Creating missing class within the debugger?

Conrad Taylor
On Wed, Jun 6, 2012 at 7:25 PM, Mark D. Roberts <[hidden email]> wrote:
Hi Conrad,

I'd have to see the context but usually this means the receiver is nil. Either an instance variable didn't get initialized or a previous send unexpectedly returned nil.

If you need to create a class, you can open another System Browser, create your new class, and then resume execution back in the debugger, either from the beginning of the current method, or from the previous one on the stack. These are the standard Debugger features.

HTH,

Mark


Mark, I'm simple driving the creation of new classes and their associated methods through tests.  This works great when I have a class and I test the behavior of a method that doesn't exist.  For example,

testObjectCreation
| foo |
foo := Foo new.
foo should not be: nil

In the above, the class Foo has not be defined and I receive the expected test error but the debugger doesn't allow the creation of the class under test.  It's not too important but it would be a nice enhancement to be able to fix this issue when the test runner provides a 'Debug' button.
 

On 6/7/2012 10:46 AM, Conrad Taylor wrote:
Hi, I'm seeing the following message within the debugger:

UndefinedObject(Object)>>doesNotUnderstand:

Thus, is there an easy way to create the missing class from the debugger screen using VW 7.8nc?  BTW, I'm just experimenting with a possible development work. 

--

Think different and code well,

-Conrad




_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc




--

Think different and code well,

-Conrad



_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: Creating missing class within the debugger?

Mark Roberts
Are you writing the tests in your image or loading unfinished test cases from a file or repository?

If you try to accept #testObjectCreation in the browser, the compiler warns that Foo is undeclared and gives you a "Create Class..." option.

Does that do what you want?

M

On 6/7/2012 12:10 PM, Conrad Taylor wrote:
On Wed, Jun 6, 2012 at 7:25 PM, Mark D. Roberts <[hidden email]> wrote:
Hi Conrad,

I'd have to see the context but usually this means the receiver is nil. Either an instance variable didn't get initialized or a previous send unexpectedly returned nil.

If you need to create a class, you can open another System Browser, create your new class, and then resume execution back in the debugger, either from the beginning of the current method, or from the previous one on the stack. These are the standard Debugger features.

HTH,

Mark


Mark, I'm simple driving the creation of new classes and their associated methods through tests.  This works great when I have a class and I test the behavior of a method that doesn't exist.  For example,

testObjectCreation
| foo |
foo := Foo new.
foo should not be: nil

In the above, the class Foo has not be defined and I receive the expected test error but the debugger doesn't allow the creation of the class under test.  It's not too important but it would be a nice enhancement to be able to fix this issue when the test runner provides a 'Debug' button.
 

On 6/7/2012 10:46 AM, Conrad Taylor wrote:
Hi, I'm seeing the following message within the debugger:

UndefinedObject(Object)>>doesNotUnderstand:

Thus, is there an easy way to create the missing class from the debugger screen using VW 7.8nc?  BTW, I'm just experimenting with a possible development work. 

--

Think different and code well,

-Conrad




_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc




--

Think different and code well,

-Conrad




_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: Creating missing class within the debugger?

Conrad Taylor
On Wed, Jun 6, 2012 at 9:42 PM, Mark D. Roberts <[hidden email]> wrote:
Are you writing the tests in your image or loading unfinished test cases from a file or repository?


Yes, I'm writing all tests within the browser.
 
If you try to accept #testObjectCreation in the browser, the compiler warns that Foo is undeclared and gives you a "Create Class..." option.
 
Does that do what you want?


Yes, it's a way to resolve the issue.  For example, one will receive a dialog with the following when class or method does not exist:

proceed    correct it    cancel

Now, when I click 'proceed', I'm getting another dialog for which I think isn't the correct behavior.  I'm expecting 'proceed' to simple save.  Next, I'm expecting the stuff in 'proceed' would be in the 'correct it'.  Is there anyway to prevent this dialog from being displayed when I hit "Control + S"?

M


On 6/7/2012 12:10 PM, Conrad Taylor wrote:
On Wed, Jun 6, 2012 at 7:25 PM, Mark D. Roberts <[hidden email]> wrote:
Hi Conrad,

I'd have to see the context but usually this means the receiver is nil. Either an instance variable didn't get initialized or a previous send unexpectedly returned nil.

If you need to create a class, you can open another System Browser, create your new class, and then resume execution back in the debugger, either from the beginning of the current method, or from the previous one on the stack. These are the standard Debugger features.

HTH,

Mark


Mark, I'm simple driving the creation of new classes and their associated methods through tests.  This works great when I have a class and I test the behavior of a method that doesn't exist.  For example,

testObjectCreation
| foo |
foo := Foo new.
foo should not be: nil

In the above, the class Foo has not be defined and I receive the expected test error but the debugger doesn't allow the creation of the class under test.  It's not too important but it would be a nice enhancement to be able to fix this issue when the test runner provides a 'Debug' button.
 

On 6/7/2012 10:46 AM, Conrad Taylor wrote:
Hi, I'm seeing the following message within the debugger:

UndefinedObject(Object)>>doesNotUnderstand:

Thus, is there an easy way to create the missing class from the debugger screen using VW 7.8nc?  BTW, I'm just experimenting with a possible development work. 

--

Think different and code well,

-Conrad




_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc




--

Think different and code well,

-Conrad




_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc




--

Think different and code well,

-Conrad



_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: Creating missing class within the debugger?

Mark Roberts
Hi Conrad,

You didn't mention the full context, but I'm guessing you mean you're trying to accept the following:

    testObjectCreation
| foo |
foo := Foo new.
foo should not be: nil

You mention "another dialog" but you don't say what it is, so I can't respond to that.

The proceed     correct it     cancel dialog is for undefined methods. "X is a new method" means just that: it doesn't exist.

When you try to compile this, no class in the system defines #should, so you are getting a dialog that it's new. So, "proceed" means "just ignore this -- I will define it later". Note that once you proceed, #should will be ignored the next time you try to reference it. In this way, you can refer to new methods which don't yet exist, and you won't get an warning each time. This is to avoid annoying you :)

"Correct" presupposes that you made a typo and gives you a chance to correct it. "Cancel" halts the compilation.

"Proceed" cannot do a "simple" save, because what if there other problems? After all, "Foo" is still undeclared. It could be (a) a class that you want to define; (b) a shared variable that you want to define; (c) a global that you want to define; (d) a typo, etc. A "simple" save in this case would have to add "Foo" to the Undeclared name space. Then, if you want to declare it (and the method won't work until you do), you would have to (1) open the class definition dialog; (2) type in the name "Foo"; (3) create the class; (4) go to the Launcher, select Browse -> Inspect -> Undeclared; (5) Remove "Foo" from the Undeclared name space.

Wouldn't it just be simpler to let the code editor prompt you to create the missing class "Foo"? I thought that's what you were looking for in the first place.

The general idea here is that Smalltalk lets you write methods that can reference other methods or classes that don't yet exist. The compiler notices these and gives you a chance to fix typos and create missing classes. You don't have to do this, but it's fewer clicks and keystrokes if you go with the flow :)

HTH,

M




On 6/7/2012 3:13 PM, Conrad Taylor wrote:
On Wed, Jun 6, 2012 at 9:42 PM, Mark D. Roberts <[hidden email]> wrote:
Are you writing the tests in your image or loading unfinished test cases from a file or repository?


Yes, I'm writing all tests within the browser.
 
If you try to accept #testObjectCreation in the browser, the compiler warns that Foo is undeclared and gives you a "Create Class..." option.
 
Does that do what you want?


Yes, it's a way to resolve the issue.  For example, one will receive a dialog with the following when class or method does not exist:

proceed    correct it    cancel

Now, when I click 'proceed', I'm getting another dialog for which I think isn't the correct behavior.  I'm expecting 'proceed' to simple save.  Next, I'm expecting the stuff in 'proceed' would be in the 'correct it'.  Is there anyway to prevent this dialog from being displayed when I hit "Control + S"?

M


On 6/7/2012 12:10 PM, Conrad Taylor wrote:
On Wed, Jun 6, 2012 at 7:25 PM, Mark D. Roberts <[hidden email]> wrote:
Hi Conrad,

I'd have to see the context but usually this means the receiver is nil. Either an instance variable didn't get initialized or a previous send unexpectedly returned nil.

If you need to create a class, you can open another System Browser, create your new class, and then resume execution back in the debugger, either from the beginning of the current method, or from the previous one on the stack. These are the standard Debugger features.

HTH,

Mark


Mark, I'm simple driving the creation of new classes and their associated methods through tests.  This works great when I have a class and I test the behavior of a method that doesn't exist.  For example,

testObjectCreation
| foo |
foo := Foo new.
foo should not be: nil

In the above, the class Foo has not be defined and I receive the expected test error but the debugger doesn't allow the creation of the class under test.  It's not too important but it would be a nice enhancement to be able to fix this issue when the test runner provides a 'Debug' button.
 

On 6/7/2012 10:46 AM, Conrad Taylor wrote:
Hi, I'm seeing the following message within the debugger:

UndefinedObject(Object)>>doesNotUnderstand:

Thus, is there an easy way to create the missing class from the debugger screen using VW 7.8nc?  BTW, I'm just experimenting with a possible development work. 

--

Think different and code well,

-Conrad




_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc




--

Think different and code well,

-Conrad




_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc




--

Think different and code well,

-Conrad




_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc