TestFailure: Assertion failed in first practice from Squeak by Example

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

TestFailure: Assertion failed in first practice from Squeak by Example

Eric Eisaman
Hell Squeakers,
 
At home I went through the first half of the Squeak by Example book. The guided practice went without a hitch however, when I worked through the first practice of writing a simple String method at work, on a different image, I ran into this problem. Why am I receiving an 'Assertion failed' message?
 
testShout
 self assert: ('oh no' shout = 'OH NO!')
 
shout 
 ^ self asUppercase , '!'
   
TestFailure: Assertion failed
 
Regards,
 
Eric Eisaman

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

Re: TestFailure: Assertion failed in first practice from Squeak by Example

stephane ducasse
Hi Eric

On 10 déc. 07, at 21:48, Eric Eisaman wrote:

> Hell Squeakers,
>
> At home I went through the first half of the Squeak by Example  
> book. The guided practice went without a hitch however, when I  
> worked through the first practice of writing a simple String method  
> at work, on a different image, I ran into this problem. Why am I  
> receiving an 'Assertion failed' message?
>
> testShout
>  self assert: ('oh no' shout = 'OH NO!')
>

where the shout method is defined?
In String?

> shout
>  ^ self asUppercase , '!'
>
> TestFailure: Assertion failed
>
> Regards,
>
> Eric Eisaman
> _______________________________________________
> Beginners mailing list
> [hidden email]
> http://lists.squeakfoundation.org/mailman/listinfo/beginners

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

Re: TestFailure: Assertion failed in first practice from Squeak by Example

Eric Eisaman
Yes, the shout method is defined in the String object.
 
Eric

On Dec 11, 2007 7:09 AM, stephane ducasse <[hidden email]> wrote:
Hi Eric

On 10 déc. 07, at 21:48, Eric Eisaman wrote:

> Hell Squeakers,
>
> At home I went through the first half of the Squeak by Example
> book. The guided practice went without a hitch however, when I
> worked through the first practice of writing a simple String method
> at work, on a different image, I ran into this problem. Why am I
> receiving an 'Assertion failed' message?
>
> testShout
>  self assert: ('oh no' shout = 'OH NO!')
>

where the shout method is defined?
In String?

> shout
>  ^ self asUppercase , '!'
>
> TestFailure: Assertion failed
>
> Regards,
>
> Eric Eisaman
> _______________________________________________
> Beginners mailing list
> [hidden email]
> http://lists.squeakfoundation.org/mailman/listinfo/beginners

_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners


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

FillInTheBlankMorph

Chris Cunnington-5
In reply to this post by stephane ducasse
Hi Squeakers,

I have a question about passwords and authentication.

In Seaside, if you want to change a password, then you can type:

WADispatcherEditor initialize

And this will call up a little mystery window. I realized I could just ask
the little window what its name was by Command+clicking it, and then
pressing the Viewer button.

My question is how did WADispatcherEditor summon the FillInTheBlankMorph?
FillInTheBlankMorph has no senders, apparently.

It seems clear this morph is used to initialize instance variables. In this
case recording username and password.

The second part of this question is, where in the image is this knowledge
being stored?

If I make my username: uncle and my password: bob, does it not stand to
reason that if I write 'uncle' in the Workspace and then Command+Shift+E,
then shouldn't that string appear in a class side method somewhere? It
doesn't seem to be stored anywhere I can find.

Chris





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

Re: FillInTheBlankMorph

Randal L. Schwartz
>>>>> "Chris" == Chris Cunnington <[hidden email]> writes:

Chris> My question is how did WADispatcherEditor summon the
Chris> FillInTheBlankMorph?  FillInTheBlankMorph has no senders, apparently.

in WAComponent class>>registerAsAuthenticatedApplication:, we see

SeasidePlatformSupport request:
   'Please choose a username for\the application ' withCRs ,
    aString printString.

>From there, you can see that SeasidePlatformClass requestor eventually
finds either a UIManager or FillInTheBlank class.

Chris> The second part of this question is, where in the image is this
Chris> knowledge being stored?

Chris> If I make my username: uncle and my password: bob, does it not stand to
Chris> reason that if I write 'uncle' in the Workspace and then
Chris> Command+Shift+E, then shouldn't that string appear in a class side
Chris> method somewhere? It doesn't seem to be stored anywhere I can find.

Explore downward from "WADispatcher default", and you'll see under
"entryPoints", "config", "configuration", "values" a dictionary with "login"
and "password".  I'm sure there's a way to do this "properly" as well.

--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<[hidden email]> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: FillInTheBlankMorph

Randal L. Schwartz
>>>>> "Randal" == Randal L Schwartz <[hidden email]> writes:

Randal> Explore downward from "WADispatcher default", and you'll see under
Randal> "entryPoints", "config", "configuration", "values" a dictionary with
Randal> "login" and "password".  I'm sure there's a way to do this "properly"
Randal> as well.

Duh.

(WADispatcher default entryPointAt: 'config') login
(WADispatcher default entryPointAt: 'config') password

There ya go.

--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<[hidden email]> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: FillInTheBlankMorph

Chris Cunnington-5
 > in WAComponent class>>registerAsAuthenticatedApplication:, we see
>
> SeasidePlatformSupport request:
>  'Please choose a username for\the application ' withCRs ,
>   aString printString.
>
> From there, you can see that SeasidePlatformClass requestor eventually
> finds either a UIManager or FillInTheBlank class.

Pretty cool. Pretty cool. I see that the the Seaside-Platform class category
is for relating Seaside to the underlying Smalltalk OS, which in this case
is Squeak. FillInTheBlankMorph, when called openInWorld, is a whole lot of
nothing. Just a blank pallet. I guess something is adding the text field and
the buttons.

> Explore downward from "WADispatcher default", and you'll see under
> "entryPoints", "config", "configuration", "values" a dictionary with "login"
> and "password".  I'm sure there's a way to do this "properly" as well.

This explains it. I'm very pleased to understand this. I thought the
Explorer was totally useless. I just didn't get it. It seems that instances
are invisible, and stay invisible. The only way you can "see" an instance is
with the Inspector or Explorer. You see, I thought that storing data in the
image meant that the image would WRITE IT OUT in a class method somewhere. I
thought it would produce a string that I could find with Command+Shift+E.
Frankly, I think I'm only starting to grok what an instance, object, and
class are. Oh, and I used to think morphs were stupid and waste of my time.
Oops.

Chris


"Blood and souls for my Lord Arioch!"
_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: FillInTheBlankMorph

Randal L. Schwartz
>>>>> "Chris" == Chris Cunnington <[hidden email]> writes:

Chris> Pretty cool. Pretty cool. I see that the the Seaside-Platform class
Chris> category is for relating Seaside to the underlying Smalltalk OS, which
Chris> in this case is Squeak. FillInTheBlankMorph, when called openInWorld,
Chris> is a whole lot of nothing. Just a blank pallet. I guess something is
Chris> adding the text field and the buttons.

Try print-it on:

  FillInTheBlank request: 'Do you like Smalltalk?' initialAnswer: 'yes!'

Chris> You see, I thought that storing data in the image meant that the image
Chris> would WRITE IT OUT in a class method somewhere. I thought it would
Chris> produce a string that I could find with Command+Shift+E.  Frankly, I
Chris> think I'm only starting to grok what an instance, object, and class
Chris> are. Oh, and I used to think morphs were stupid and waste of my time.
Chris> Oops.

The image contains all of object memory (plus a few headers).  Object memory
contains all the objects.  Only *some* of those objects are Classes and
Metaclasses, with their associated MethodDictionaries, and that's where you'd
see the related source code.  Other objects are *instances* of Classes (what
you get from "new" and other constructors), and they're just "floating about"
in object memory, although they are saved and restored in the image.

--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<[hidden email]> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners