www.digitalmars.com         C & C++   DMDScript  

DMDScript - Proposed Command-line Usage Improvements


I've recently been looking at the DMDScript product as I'd like to use the
same ECMAScript interpreter in both Windows and Linux environments. Whilst
I'm impressed by its current features and performance, it's utility as a
standalone command-line utility is, I believe, slightly hampered because it
[appears to] lack certain features, namely the ability to:

* Extract command-line arguments, something like C's
   'argc' and 'argv', or Java's 'args[]' conventions. Perhaps
   an 'args' function could be implemented that returns
   the tokenised command-line as an array ?

* Return status code to OS, something like C's 'exit'
   library function

* Allow shell access, something like C's 'system' library

* Have 'readln' distinguish between EOF and blank lines.
   Perhaps 'readln' could be altered so that it returns 'null'
   on EOF ?

I realise that such features are normally the province of a DOM
implementation [e.g. MS WSH], and I'm certainly not proposing the building
of such a thing. However, given that a number of non-standard I/O functions
are already in place, I'd venture to say that the above proposals would not
constitute 'radical' change, and would certainly extend the utility of the
DMDScript product.

I'm curious as to whether these things are feasable, and if there is a
possibility of their becoming reality in the near future.


Anthony Borla
Jul 22 2005