Hi,
Minor update - StepTalk 0.9.1 was released.
What is StepTalk?
-----------------
Language independent scripting framework for GNUstep.
More information: http://mediawiki.gnustep.org/index.php/StepTalk
Intro:
http://stefan.agentfarms.net/Download/GNUstep/Documents/StepTalk-intro.pdf
What is new in 0.9.1
--------------------
* Actor class - STActor. For more information see attached example or
Examples/Smalltalk/stactor.st
* fixes after GNUstep-base fixes of NSUnknownKey
Note to rIO and perhaps others interested: I would like to remove all
add/remove methods from the STActor and move them to STActorBuilder
class. What do you think?
Get it from ftp://ftp.gnustep.org/pub/incoming or later from
ftp://ftp.gnustep.org/pub/gnustep/libs/
Any patches, comments and questions are more than welcome.
Enjoy,
Stefan Urbanek
--
http://stefan.agentfarms.net
First they ignore you, then they laugh at you, then they fight you, then
you win.
- Mahatma Gandhi
| actor engine source method |
actor := STActor actorInEnvironment:Environment.
"Set ivars"
ivars := NSMutableDictionary dictionary.
ivars setObject:1 forKey:'number'.
actor setInstanceVariables:ivars.
" Get the proper engine "
engine := STEngine engineForLanguageWithName:'Smalltalk'.
" This is the source of new method "
source := 'increment
number := number + 1. ^self'.
" Create method "
method := engine methodFromSource:source
forReceiver:actor
inEnvironment:Environment.
" Add the method to the actor "
actor addMethod:method.
" Add another method with an argument "
source := 'setNumber:i number := i. ^self'.
method := engine methodFromSource:source
forReceiver:actor
inEnvironment:Environment.
actor addMethod:method.
source := 'print
Transcript showLine: (\'The number is \',
(number description)). ^self'.
method := engine methodFromSource:source
forReceiver:actor
inEnvironment:Environment.
actor addMethod:method.
" Send it! "
actor print.
actor increment.
actor print.
actor increment.
actor print.
actor setNumber:10.
actor print.
_______________________________________________
Info-gnustep mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/info-gnustep