HELP - I need help 
Author Message
 HELP - I need help

I hope this isn't too primitive a question but I'm doing a course on
Smalltalk and I cant find the answers to these 3 questions anywhere and I'm
hoping someone will help me out.

ifTrue: ifFalse: ( I need to find the Class of the receiver, Class of
argument 1 and Class of argument 2)
timesRepeat:   ( I need to find the Class of the receiver and Class of  the
argument )
whileTrue:       ( I need to find the Class of the receiver and Class of
the argument )

Any help or pointers to a solution will be gratefully received. If you want

Thanks.



Mon, 13 Oct 2003 03:41:51 GMT  
 HELP - I need help
Here's what you do -

1) Download either Squeak (http://www.squeak.org) or VisualWorks NC
(http://www.cincom.com/smalltalk)

2) Search for implementors of these methods

        That will tell you the answers.

Also, you can try this in a workspace and get the answers:

((1+2) > 3)
        ifTrue: [Transcript show: 'yes']
        ifFalse: [Transcript show: 'no'].

10 timesRepeat: [Transcript show: 'hello'; cr].

i := 1.
i < 10 whileTrue: [Transcript show: i printString; cr.
                        i := i + 1].

In VisualWorks, highlight these one at a time, and using the operate
(right mouse) menu, select 'debug it'.  

Quote:

> I hope this isn't too primitive a question but I'm doing a course on
> Smalltalk and I cant find the answers to these 3 questions anywhere and I'm
> hoping someone will help me out.

> ifTrue: ifFalse: ( I need to find the Class of the receiver, Class of
> argument 1 and Class of argument 2)
> timesRepeat:   ( I need to find the Class of the receiver and Class of  the
> argument )
> whileTrue:       ( I need to find the Class of the receiver and Class of
> the argument )

> Any help or pointers to a solution will be gratefully received. If you want

> Thanks.

--
James A. Robertson
Product Manager (Smalltalk), Cincom

<Talk Small and Carry a Big Class Library>


Mon, 13 Oct 2003 04:00:38 GMT  
 HELP - I need help
Just a minor thing:
Quote:
> i := 1.
> i < 10 whileTrue: [Transcript show: i printString; cr.
> i := i + 1].

should be
i := 1.
[i < 10] whileTrue: [Transcript show: i printString; cr.
i := i + 1].

i.e. you should send the message whileTrue: to a block.

Bj?rn



Mon, 13 Oct 2003 04:34:45 GMT  
 HELP - I need help
Oh wow, did I post that?  

(wipes egg off face....)

Quote:

> Just a minor thing:
> > i := 1.
> > i < 10 whileTrue: [Transcript show: i printString; cr.
> > i := i + 1].

> should be
> i := 1.
> [i < 10] whileTrue: [Transcript show: i printString; cr.
> i := i + 1].

> i.e. you should send the message whileTrue: to a block.

> Bj?rn

--
James A. Robertson
Product Manager (Smalltalk), Cincom

<Talk Small and Carry a Big Class Library>


Mon, 13 Oct 2003 05:17:38 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Help Files, Need Help

2. help i need help

3. HELP I NEED HELP !! PCX FILES DECODER NEEDED!

4. ***HELP***HELP***NEED INFORMATION***HELP***HELP

5. help! f90.help help help help

6. HELP HELP HELP HELP

7. HELP HELP HELP HELP

8. Ord Function HELP Please HELP HELP HELP

9. help help help help!!!!!!!!!!!

10. (HELP (HELP (HELP (HELP))))

11. HELP: HELP: HELP: HELP: Online-manual on Expect

12. Please Help - NetTools Help File needed

 

 
Powered by phpBB® Forum Software