Proposal: overhaul System.Process

Jules Bean jules at jellybean.co.uk
Wed May 14 09:58:46 EDT 2008


Simon Marlow wrote:
> Duncan Coutts wrote:
>> On Tue, 2008-04-22 at 16:35 -0700, Simon Marlow wrote:
>>> Duncan Coutts wrote:
>>>
>>>> Do you suppose we can rename the system/rawSystem given that we're
>>>> already moving them from one module to another?
>>>>
>>>> Just off the top of my head, how about "runShellCommand" & 
>>>> "runProgram",
>>>> better suggestions welcome.
>>> Well, ideally we'd do a complete renaming sweep, e.g. runProcess 
>>> should be spawnProcess (or just removed entirely), then we could use 
>>> runProcess for what is currently called rawSystem.  But I've got 
>>> enough flak for changing APIs in the past so I wimped out this time :-)
>>
>> Ah but this isn't a change, it's a new api, so we have complete freedom.
>> We're adding a new replacement for system/rawSystem and deprecating the
>> old module.
> 
> I can't think of a good naming scheme that doesn't break backwards 
> compatibility.  Suggestions welcome.
> 
> Ideally we'd change runProcess to spawnProcess, and similarly for 
> runCommand, runInteractiveCommand etc.  But then what do we use for 
> 'system' and 'rawSystem'?  Good names for these are 'runCommand' and 
> 'runProcess' respectively, but we can't re-use those names without 
> breaking the API (we want to leave the old versions in place deprecated 
> for a while).

Surely you can put the nicest new names in another module

System.Process.RunCommand

(or whatever)

programs which use the old versions will still work. Programs which want 
the nicely named new versions can import from the new module.

One day, in a later version, you can move them out to the main namespace.

Jules


More information about the Libraries mailing list