Teaching fork

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

Teaching fork

Annick

        Here is a simple example about fork.

Try the following :

10 timesRepeat: [ (Delay forSeconds: 1) wait. Transcript show: ‘hello’;cr].

Then the following :
[10 timesRepeat: [ (Delay forSeconds: 1) wait. Transcript show: ‘hello’;cr]] fork.

I think this should go in an introduction to Pharo.

Annick
Reply | Threaded
Open this post in threaded view
|

Re: Teaching fork

Luc Fabresse

you can also use:

1 second wait.
2 seconds wait. ;-)

Luc

2014-10-24 14:11 GMT+02:00 Annick Fron <[hidden email]>:

        Here is a simple example about fork.

Try the following :

10 timesRepeat: [ (Delay forSeconds: 1) wait. Transcript show: ‘hello’;cr].

Then the following :
[10 timesRepeat: [ (Delay forSeconds: 1) wait. Transcript show: ‘hello’;cr]] fork.

I think this should go in an introduction to Pharo.

Annick