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
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 Beginners@lists.squeakfoundation.org http://lists.squeakfoundation.org/mailman/listinfo/beginners
Yes, the shout method is defined in the String object.
Eric
On Dec 11, 2007 7:09 AM, stephane ducasse stephane.ducasse@free.fr 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 Beginners@lists.squeakfoundation.org http://lists.squeakfoundation.org/mailman/listinfo/beginners
Beginners mailing list Beginners@lists.squeakfoundation.org http://lists.squeakfoundation.org/mailman/listinfo/beginners
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!
"Chris" == Chris Cunnington cunnington@sympatico.ca 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" == Randal L Schwartz merlyn@stonehenge.com 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.
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!"
"Chris" == Chris Cunnington cunnington@sympatico.ca 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.
beginners@lists.squeakfoundation.org