Novel Thoughts on Scripting and Languages

Sandy Norton sandskyfly at hotmail.com
Wed Jan 8 10:07:15 EST 2003


judoscript at hotmail.com (James Huang) wrote in message 

> So you went to the whitepaper, searched on "jython" in the browser and
> finished your research (actually, search)? Doing a language is a huge
> undertaking; it would indeed be ludicrous to start one without looking
> around first.

I didn't merely search on 'jython', I actually followed some of the
examples through. Actually, it first reminded me a little bit of rebol
which has some nifty high level commands like "send person at address.com
file.txt". My initial reaction to that was "wow, that's cool... let me
try rebol out". After a few attempts to use the language, I got
somewhat frustrated with the syntax and semantics and decided to write
a module called 'rebol.py' instead, implementing the functionality I
could use on top of the python standard library infrastructure. So now
I can write

>>> from rebol import send
>>> send('person at address.com', 'file.txt')

My approach to your examples would be similar. I would use elements of
the python standard library and implement my 'preferred level' of
abstraction.

so for this particular example:

> -------------------------------------
> copy '*.java, *.jj' in '~/src/' except '*Test*, *test*'
>      recursive
>      into '~/archive/src_' @ date().fmtDate('yyyy-MM-dd') @ '.jar';
> -------------------------------------

>>> from pathlib import Path
>>> from time import strftime, gmtime
>>> src = Path('~/src/', 
            glob=['*.java', '*.jj'], 
            skip=['*Test*', '*test*'], 
            recursive=True)

>>> dst = Path(r'~/archive/src_') + strftime("%y-%m-%d", gmtime()) +
'.zip'
>>> src.copy(dst)

Now your example may be shorter, but I daresay mine is a little bit
more flexible, as I could now do:

>>> src.delete()

I applaud your efforts to develop a language that conforms to your
needs... but somehow, I just prefer Python.

Sandy




More information about the Python-list mailing list