[Info-vax] Evolve, or... (was: Re: 64 bit DCL ?)

Paul Sture nospam at sture.ch
Tue Jan 27 16:02:11 EST 2015


On 2015-01-18, johnwallace4 at yahoo.co.uk <johnwallace4 at yahoo.co.uk> wrote:
>
> Hoff wrote
> " Most languages don't require double- or triple-quoting, nor
> unbalanced single-quoting.   C-like languages tend to use a backslash
> as an escapement and not doubling or tripling the quoting characters,
> too.  "
>
> I can only assume you've never tried to use any of the popular scripting
> languages to write portable code that handles strings where a backslash
> is a valid character in e.g. user input for something more complicated
> than a simple filespec. Or you had better luck than I did.
>
> I tried it a few years back and I can't remember the details but I do
> remember the nightmare.

The nightmare in this area that I recall was trying to escape the apostrophe
in "iWork '09" as part of a path name, using AppleScript.  I did eventually
manage it but about 30 seconds later read a comment from someone who knew
a lot more about AppleScript than I did, indicating that AppleScripts
handling in this area could well change in a future release.

I gave up and wrote what I wanted in Objective-C instead.

OTOH more recently I came across a sed example doing some substitution
in a lengthy *nix pathname which included multiple slashes and the odd
space too.  It was a complete mess of escape backslashes.

My answer was something like this (and thanks to EDT for the hint that
separators don't *have* to be a slash):

s*/some very/long/file name*/new file/name*

> Oddly enough it was in connection with writing yet another diff tool. My
> boss wanted one that was able to provide statistics on adds/moves/changes
> and unfortunately nothing off the shelf at zero cost fitted the
> requirements (there were for-money products that did the job, but...).
>
> In the bigger picture here, I'm mostly with Dave F in general. Specifically...
>
> DCL is a command language, originating as an MCR replacement in the
> PDP11 era, for issuing simple commands to the OS and for building
> simple scripts.
>
> On VMS, DCL grew, maybe because users wanted it to. It grew so much
> that at least one commercially available book exists on the subject
> of Writing Real Programs in DCL. Times appear to have changed. 
>
> Python's got a lot of neat features. Plus some horrible misfeatures
> which are now fundamental to the language. Sensitivity to whitespace
> is A Bad Idea, and the deliberate incompatibilities between Python 2
> and Python 3 don't seem that clever to me either.

I was somewhat dismayed when I discovered that the version of Python
I first tried couldn't round numbers properly.  They did however point
this out in the tutorial section of the manual, suggesting you use the
decimal type instead, and the problem appears to be fixed somewhere in
the 2.7 stream.

I still can't get my head around modulo rounding down to minus
infinity though:

Python 2.7.6 (default, Sep  9 2014, 15:04:36) 

>>> 22 % 5
2
>>> -22 % 5
3
>>> -22 % -5
-2

and yes, the interpreter just bit me because I started the first line of
input with a leading space - grrr, it hadn't seen anything yet so should
IMHO have thrown an error on subsequent lines, not the first.

> In five years time, school leavers will stand a fair chance of being
> as fluent in Python as they are in English, if Raspberry Pi succeeds.

I've got one and I'm quite impressed with the educational materials
available out of the box and on the main website.

> All that said, a proper VMS implementation of Python (2 and/or 3?) would 
> surely go a long way?

Indeed.  Python started out being the glue between applications for data
scientists but has now become a viable alternative to traditional packages
for much of their core work.

-- 
Of dates and times:
%S - Second as decimal number (00–61), allowing for up to two leap-seconds
(but POSIX-compliant implementations will ignore leap seconds)



More information about the Info-vax mailing list