[squeak-dev] The Inbox: System-dtl.1164.mcz

Eliot Miranda eliot.miranda at gmail.com
Tue Jun 9 16:42:00 UTC 2020

> On Jun 9, 2020, at 7:33 AM, David T. Lewis <lewis at mail.msen.com> wrote:
> On Tue, Jun 09, 2020 at 11:46:00AM +0530, K K Subbu wrote:
>>> On 09/06/20 1:16 am, commits at source.squeak.org wrote:
>>> David T. Lewis uploaded a new version of System to project The Inbox:
>>> http://source.squeak.org/inbox/System-dtl.1164.mcz
>> Suggest splitting the arguments into image, first and rest. If first is 
>> nil, then no further processing is required. If it is a chunk or project 
>> file, then treat it as a startup script or project and pass the rest of 
>> the command line to it.
>> E.g.
>>    squeak.image playmedia.st  $HOME/music/foo.mp3
>>    squeak.image starwars.pr $HOME/background/deathstar.png
>>    squeak.image repl.st 'Beeper beep!'
>> Regards .. Subbu
> That is a good idea, but I think that this kind of argument handling can
> best be accomplished with additional changes in the image after we get
> the basic argument passing stabilized.


> At this point, I am not trying to add any new features. I just want to
> get the existing argument handling to work consistent with the original
> design intent, and also consistently with respect to the various ways in
> which a user might enter a command line from a terminal window.

Bravo Dave!  Thanks for tackling this.  It is a PITA!!

> Once that is done, we can think about adding new features or different
> behavior. But I'm not sure that any new features will be needed. Consider
> your idea of:
>     $ squeak.image playmedia.st  $HOME/music/foo.mp3
> I think you will find that the playmedia.st script can directly reference
> Smalltalk argumentAt 1 to find the value of $HOME/music/foo.mp3 that
> was passed to the image.

+1.  I suspect we want something like “shift” in shell scripts to allow us to consume arguments.

Maybe arguments is an OrderedCollection in a class var, and removeFirst is used to consume arguments.  Then argument processors can arbitrarily edit the arguments, prepending or apending as desired.

> Dave 

More information about the Squeak-dev mailing list