is there a way to pass a script to a vm without passing via a file?

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

is there a way to pass a script to a vm without passing via a file?

Stéphane Ducasse
Hi

I would like to know if there is a way (may be with OSProcess to pass a script to a image or starting image)
without creating a file?

Stef
Reply | Threaded
Open this post in threaded view
|

Re: is there a way to pass a script to a vm without passing via a file?

Camillo Bruni-3
is that enough?

cogVM foo.image evaluate "FileStream stdout nextPutAll: 'fubu'; crlf"



On 2012-06-23, at 22:11, Stéphane Ducasse wrote:

> Hi
>
> I would like to know if there is a way (may be with OSProcess to pass a script to a image or starting image)
> without creating a file?
>
> Stef


Reply | Threaded
Open this post in threaded view
|

Re: is there a way to pass a script to a vm without passing via a file?

Sven Van Caekenberghe
In reply to this post by Stéphane Ducasse

On 23 Jun 2012, at 22:11, Stéphane Ducasse wrote:

> Hi
>
> I would like to know if there is a way (may be with OSProcess to pass a script to a image or starting image)
> without creating a file?
>
> Stef

Yes, there should be something like -eval or even better -doit
I believe Camillo added some extra vm options at one time…

Sven
Reply | Threaded
Open this post in threaded view
|

Re: is there a way to pass a script to a vm without passing via a file?

Camillo Bruni-3

On 2012-06-23, at 22:23, Sven Van Caekenberghe wrote:

>
> On 23 Jun 2012, at 22:11, Stéphane Ducasse wrote:
>
>> Hi
>>
>> I would like to know if there is a way (may be with OSProcess to pass a script to a image or starting image)
>> without creating a file?
>>
>> Stef
>
> Yes, there should be something like -eval or even better -doit
> I believe Camillo added some extra vm options at one time…

no no all in the image :), see BasicCodeLoader
Reply | Threaded
Open this post in threaded view
|

Re: is there a way to pass a script to a vm without passing via a file?

philippeback
In reply to this post by Camillo Bruni-3
How do you make that work on Windows? Here, I do get the system opening its window and that's all.

/Phil

2012/6/23 Camillo Bruni <[hidden email]>
is that enough?

cogVM foo.image evaluate "FileStream stdout nextPutAll: 'fubu'; crlf"



On 2012-06-23, at 22:11, Stéphane Ducasse wrote:

> Hi
>
> I would like to know if there is a way (may be with OSProcess to pass a script to a image or starting image)
> without creating a file?
>
> Stef





--
Philippe Back
Dramatic Performance Improvements
Mob: +32(0) 478 650 140 | Fax: +32 (0) 70 408 027 Mail: [hidden email] | Web: http://philippeback.eu | Blog: http://philippeback.be

High Octane SPRL
rue cour Boisacq 101
1301 Bierges
Belgium
Reply | Threaded
Open this post in threaded view
|

Re: is there a way to pass a script to a vm without passing via a file?

Camillo Bruni-3

On 2012-06-23, at 22:42, [hidden email] wrote:

> How do you make that work on Windows? Here, I do get the system opening its
> window and that's all.
>
> /Phil

igor has been working on that.
It seems that it is super hard to get window + stdin working at the same time under windoze

btw I just fixed the commandline handling to support the stdin pipe

> echo "1 + 2" | cogVM pipeIt.image eval
> 3
Reply | Threaded
Open this post in threaded view
|

Re: is there a way to pass a script to a vm without passing via a file?

Camillo Bruni-3
Reply | Threaded
Open this post in threaded view
|

Re: is there a way to pass a script to a vm without passing via a file?

philippeback
This Pharo thing is becoming seriously cool stuff :-)


Reply | Threaded
Open this post in threaded view
|

Re: is there a way to pass a script to a vm without passing via a file?

Sven Van Caekenberghe
In reply to this post by Camillo Bruni-3

On 23 Jun 2012, at 22:25, Camillo Bruni wrote:

> no no all in the image :), see BasicCodeLoader

Very nice, but you mean EvaluateCommandLineHandler is guess ?

If I understand it correctly, it will always quit the image after evaluating something.
Furthermore is print the results of the evaluation to stdout, no ?

Sven
Reply | Threaded
Open this post in threaded view
|

Re: is there a way to pass a script to a vm without passing via a file?

Camillo Bruni-3

On 2012-06-23, at 23:50, Sven Van Caekenberghe wrote:

>
> On 23 Jun 2012, at 22:25, Camillo Bruni wrote:
>
>> no no all in the image :), see BasicCodeLoader
>
> Very nice, but you mean EvaluateCommandLineHandler is guess ?
>
> If I understand it correctly, it will always quit the image after evaluating something.
> Furthermore is print the results of the evaluation to stdout, no ?

yes, I think that default behavior is pretty consistent with what I know from other languages.
but yeah, maybe should add a default option --no-quit or so to keep the image open.

otherwise there is still the st handler that keeps the image open
(which I do not like that much either :/)

at least both should work the same way IMO
Reply | Threaded
Open this post in threaded view
|

Re: is there a way to pass a script to a vm without passing via a file?

Stéphane Ducasse
In reply to this post by Camillo Bruni-3
Ok I will have a look.

What I want is an image that launch other images with instructions
I just want to know if I always have to pass scripts around and if I could instead pass code via any other means (socket…)
I have to see.



> BasicCodeLoader