2016-11-28 14:28 GMT+01:00 Dimitris Chloupis <kilon.al...@gmail.com>:

>
>
> On Mon, Nov 28, 2016 at 2:13 PM Thierry Goubier <thierry.goub...@gmail.com>
> wrote:
>
>> The GitFileTree-MergeDriver is a good place for that since it has a
>> Makefile[1] with smalltalk scripting inside ("eval"), and a command line
>> handler[2] to handle being used on the command line[3] by git.
>>
>>
> yeah problem is eval works fine for me too.
>
> " I have been doing like this:
>
> #!/bin/bash
> ./pharo Pharo.image save Builder
> ./pharo Builder.image LoadBuilder.st --quit
>
> and LoadBuilder.st contains
>
> <code to load configurations and other thing>
> Smalltalk saveSession.
>
> Worked for me in a 3.0, so should still be fine.
>
> I could then to a set of images with various names and builders so one
> could have all the prerequisites and the last step just loaded my code fast
> on my CI."
>
> Yeap that works but I found a nasty bug, pharo has issues when ! is
> contained inside a string so this code works
>
> ```Smalltalk
>
> Object subclass:#HelloWorld.
> HelloWorld class compile:
> 'run
> Transcript show: ''Hello World'' ;cr.
> Transcript show: ''Yes we did it again'' ;cr.
> ^self ' classified: #run.
> HelloWorld run.
> Smalltalk saveSession.
>
> ```
>
> but this code produces an error if contained in a st file
>
> ```Smalltalk
>
> Object subclass:#HelloWorld.
> HelloWorld class compile:
> 'run
> Transcript show: ''Hello World'' ;cr.
> Transcript show: ''Yes we did it again!'' ;cr.
> ^self ' classified: #run.
> HelloWorld run.
> Smalltalk saveSession.
>
> ```
> if the code is passed as eval it works fine. I assume here is because ! is
> used to define metadata inside a st file.
>

Yes, I'd guess that you are triggering the !! delimited reading when you
give a .st. In short, giving a .st file as an argument triggers a FileIn
operation, not an execute smalltalk script.

It just happens that FileIn is an executable format (sort of), so you can
use it as a script engine until you reach such issues.

Thierry

Reply via email to