About using squeak to script...
stéphane ducasse
ducasse at iam.unibe.ch
Sat Aug 12 20:29:25 UTC 2006
For the moment I would like to have the possibility to launch the vm
with a script and see the results on the command line
like ruby.
So OSProcees seems good for my goal. I will wrap it into Stdoutput to
have the same as in VW :)
and play with it.
Stef
On 12 août 06, at 15:53, David T. Lewis wrote:
> On Sat, Aug 12, 2006 at 10:38:14AM +0200, st?phane ducasse wrote:
>> Hi
>>
>> I would like to use I would like to pass a file as argument, I know
>> that this is possible
>> and I should read the manual. ;) any hints is welcome.
>>
>> What I do not know is how can I print on stdoutput?
>> Should I create a primitive (argh) for that?
>> Would be neat to have that per default (may be this is the time for
>> me to learn something new writing
>> a primitive)
>
> Hi Stef,
>
> I'm not sure what you mean by "using Squeak to script", but did you
> have in mind something like the following in CommandShell:
>
> script: aScriptString onFailureDo: aBlockWithOneParameter
> "A script is a String containing a list of commands separated
> by Character cr. Evaluate each command in aScriptString until
> a failure is encountered. On failure, answer the result of
> evaluating aBlockWithOneParameter with the last proxy to have
> been evaluated as its parameter. Otherwise, answer the last
> process proxy to have been evaluated."
>
> "CommandShell new open;
> script: 'who
> help
> ls -l NOSUCHFILE
> help'
> onFailureDo: [:p | 'the proxy that failed was ', p printString]"
>
>
>
More information about the Squeak-dev
mailing list
|