[squeak-dev] Direct implementation of shift/reset in Smalltalk

Balázs Kósi rebmekop at gmail.com
Fri Apr 22 21:17:48 UTC 2011


Hi,
> I'm very happy to hear that, Balázs!
Thanks for the code!

> Can you post some snippets of your code that demonstrates how you use it?
You find a little example attached. Here is some code to try it:

CEResource start.
	" Start the resources.
	Now we have three of them a, b and c.
	Each of them produce a sequence of numbers.
	They need two seconds to produce the next number after a request. "
[ Transcript show: [ :k | CEResource request: k from: #a ] shift;
space ] reset.
	" With the snippet above you can write the next number on the Transcript.
	Press repeatedly, and watch as a number appears every two seconds. "
CEJob new.
	" The Job makes ten requests to the resources, and collects their answers.
	Explore this expression. (Alt-Shift-i).
	And refresh the results collection by opening and closing it."
CEResource stop.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ControlExample.st
Type: application/octet-stream
Size: 2253 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20110422/e2e77ebf/ControlExample.obj


More information about the Squeak-dev mailing list