Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #38473
| Path | csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder2.hal-mli.net!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <python-python-list@m.gmane.org> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.000 |
| X-Spam-Evidence | '*H*': 1.00; '*S*': 0.00; 'python.': 0.02; '+++': 0.03; 'syntax': 0.03; 'value,': 0.03; 'indicated': 0.07; 'matches': 0.07; 'executes': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'scripting': 0.09; 'that).': 0.09; 'translations': 0.09; 'worse': 0.09; 'language,': 0.11; 'language': 0.14; '(note:': 0.16; 'command,': 0.16; 'command;': 0.16; 'editor,': 0.16; 'keywords.': 0.16; 'nightmare': 0.16; 'pipes': 0.16; 'preprocess': 0.16; 'processor,': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'unquoted': 0.16; 'value),': 0.16; 'wrote:': 0.17; 'basically': 0.17; 'found,': 0.17; 'fri': 0.17; 'processor': 0.17; 'string,': 0.17; '(in': 0.18; 'shell': 0.18; '(or': 0.18; 'windows': 0.19; 'feb': 0.19; '(not': 0.20; 'variable': 0.20; 'equivalent': 0.20; 'file.': 0.20; 'explicit': 0.22; 'parse': 0.22; 'programming': 0.23; 'originally': 0.23; "python's": 0.23; 'external': 0.24; 'command': 0.24; 'script': 0.24; 'common': 0.26; 'recognized': 0.27; '(as': 0.27; 'ibm': 0.27; 'mix': 0.27; "doesn't": 0.28; 'header:X-Complaints-To:1': 0.28; 'lines': 0.28; 'run': 0.28; "d'aprano": 0.29; 'finds': 0.29; 'implicitly': 0.29; 'invoke': 0.29; 'parent': 0.29; 'statements': 0.29; 'steven': 0.29; "skip:' 10": 0.30; 'fri,': 0.30; 'keyword': 0.30; 'push': 0.30; 'function': 0.30; 'error': 0.30; 'stuff': 0.30; 'code': 0.31; 'file': 0.32; 'switch': 0.32; 'quotes': 0.33; 'url:home': 0.33; 'to:addr:python-list': 0.33; 'text': 0.34; 'done': 0.34; 'whatever': 0.35; 'replaced': 0.35; 'similar': 0.35; 'next': 0.35; 'received:org': 0.36; 'created': 0.36; 'except': 0.36; 'but': 0.36; "didn't": 0.36; 'too': 0.36; 'charset:us-ascii': 0.36; 'editor': 0.37; 'execute': 0.37; 'being': 0.37; 'late': 0.37; 'passed': 0.37; 'data': 0.37; 'subject:: ': 0.38; 'files': 0.38; 'object': 0.38; 'some': 0.38; 'to:addr:python.org': 0.39; 'called': 0.39; 'where': 0.40; 'skip:" 10': 0.40; 'header:Received:5': 0.40; 'end': 0.40; 'easy': 0.60; 'real': 0.61; 'first': 0.61; 'between': 0.63; 'different': 0.63; 'subject:...': 0.63; 'more': 0.63; '2013': 0.84; 'processor.': 0.84; 'dennis': 0.91 |
| X-Injected-Via-Gmane | http://gmane.org/ |
| To | python-list@python.org |
| From | Dennis Lee Bieber <wlfraed@ix.netcom.com> |
| Subject | Re: Opinion on best practice... |
| Date | Fri, 08 Feb 2013 13:29:48 -0500 |
| Organization | > Bestiaria Support Staff < |
| References | <5111b826$0$29969$c3e8da3$5496439d@news.astraweb.com> <CAPTjJmo6yvH6xySfDCK3T7MtwinzDPe6KDwOR+Wusb3WfsD+kQ@mail.gmail.com> <mailman.1423.1360172253.2939.python-list@python.org> <5112eb4a$0$29965$c3e8da3$5496439d@news.astraweb.com> <mailman.1438.1360214905.2939.python-list@python.org> <51134e9f$0$21812$c3e8da3$76491128@news.astraweb.com> <mailman.1455.1360263294.2939.python-list@python.org> <511431a3$0$29966$c3e8da3$5496439d@news.astraweb.com> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=us-ascii |
| Content-Transfer-Encoding | 7bit |
| X-Gmane-NNTP-Posting-Host | adsl-76-253-106-181.dsl.klmzmi.sbcglobal.net |
| X-Newsreader | Forte Agent 3.3/32.846 |
| X-No-Archive | YES |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.15 |
| Precedence | list |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> |
| List-Archive | <http://mail.python.org/pipermail/python-list/> |
| List-Post | <mailto:python-list@python.org> |
| List-Help | <mailto:python-list-request@python.org?subject=help> |
| List-Subscribe | <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.1518.1360348201.2939.python-list@python.org> (permalink) |
| Lines | 105 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1360348201 news.xs4all.nl 6863 [2001:888:2000:d::a6]:51896 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:38473 |
Show key headers only | View raw
On Fri, 08 Feb 2013 09:58:42 +1100, Steven D'Aprano
<steve+comp.lang.python@pearwood.info> declaimed the following in
gmane.comp.python.general:
> Dennis Lee Bieber wrote:
>
>
> > Line 3 has unquoted "echo" which is not a REXX command; it is
> > considered an external command and is passed the /result/ of calling
> > REXX time() -- where Windows executes it
>
> Good lord, that's even worse than I feared. So it's not just unparsable
> non-REXX code that is implicitly sent to the shell, but the equivalent to
> Python's NameErrors. And you can implicitly mix calls to the shell and REXX
> function calls in the same line.
>
You have to remember -- REXX was not created to be a stand-alone
programming language, as Python. It was created (in the late 70s early
80s) to be a "better" "shell" scripting language on IBM mainframes in
place of JCL and similar ("shell" in quotes as neither the interactive
command line nor submitted batch files were considered to run in
"shells"). Being able to transparently make use of the parent command
processor (or switching to a different command processor -- have the
script preprocess some data files, for example, then invoke the system
editor, switch to the editor as command processor, and edit a file based
upon what contents are in the preprocessed data).
Common practice is to quote the first word of any thing being sent
to the command processor -- to make it more explicit and to avoid
conflicts with REXX keywords. Hypothetically, if "DO" were the command
to invoke some system command (dump object file?):
DO sourcefile
would generate a syntax error as it doesn't match the REXX "DO" loop
syntax (as I recall, I originally indicated that stuff that doesn't
parse as a REXX /statement/ was sent to the command -- this parses as a
REXX loop with a syntax error); whereas
'DO' sourcefile
is a string, and will be sent to the command processor. The emphasis is
on "statement". Statements basically fall into
keyword blah blah blah
or
variable = blah blah blah
E:\UserData\Wulfraed\My Documents>type test.rx
/* */
operation.1 = 'date'
operation.3 = 'time'
do i = 1 to 4
say operation.i
operation.i '/t'
end
call operation
E:\UserData\Wulfraed\My Documents>type operation.4
/* */
say inside "operation.4"
E:\UserData\Wulfraed\My Documents>type operation.rx
/* */
say inside "operation.rx"
E:\UserData\Wulfraed\My Documents>regina test.rx
date
Fri 02/08/2013
OPERATION.2
'OPERATION.2' is not recognized as an internal or external command,
operable program or batch file.
6 *-* operation.i '/t'
+++ RC=1 +++
time
01:28 PM
OPERATION.4
INSIDE operation.rx
E:\UserData\Wulfraed\My Documents>
(Note: OPERATION.4 brings up a Windows requester that it doesn't know
how to execute that file type -- but the file was found, so no REXX
error; the CALL operation finds operation.rx, and executes it as a
subprogram)
If the line doesn't begin with a keyword or of the form "variable
=", then first translations are done for any word in the line that
matches a variable or function name (variables are replaced by their
value, functions are called and replaced by their return value), and
whatever is left of the line is passed to the command processor.
If you want the real nightmare -- look into the IBM "queue" scheme
(not many REXX implementations except on IBM mainframes support that).
One can push lines onto the queue, such that when the script exits, the
command processor reads those lines first before reading from
keyboard... Or push lots of text in a way that the next script to start
reads it without using a temporary file. IBM mainframes didn't
"multitask" too well <G>; no easy creation of processes with pipes
between them.
--
Wulfraed Dennis Lee Bieber AF6VN
wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Opinion on best practice... Anthony Correia <akcorreia@gmail.com> - 2013-02-04 20:14 -0800
Re: Opinion on best practice... Michael Torrie <torriem@gmail.com> - 2013-02-04 23:04 -0700
Re: Opinion on best practice... Terry Reedy <tjreedy@udel.edu> - 2013-02-05 02:56 -0500
Re: Opinion on best practice... Grant Edwards <invalid@invalid.invalid> - 2013-02-05 13:23 +0000
Re: Opinion on best practice... Ulrich Eckhardt <ulrich.eckhardt@dominolaser.com> - 2013-02-05 08:56 +0100
Re: Opinion on best practice... Peter Otten <__peter__@web.de> - 2013-02-05 11:35 +0100
Re: Opinion on best practice... Ulrich Eckhardt <ulrich.eckhardt@dominolaser.com> - 2013-02-05 14:05 +0100
Re: Opinion on best practice... Grant Edwards <invalid@invalid.invalid> - 2013-02-05 13:22 +0000
Re: Opinion on best practice... Walter Hurry <walterhurry@lavabit.com> - 2013-02-05 21:01 +0000
Re: Opinion on best practice... Neil Cerutti <neilc@norwich.edu> - 2013-02-05 21:39 +0000
Re: Opinion on best practice... Ethan Furman <ethan@stoneleaf.us> - 2013-02-05 14:07 -0800
Re: Opinion on best practice... Grant Edwards <invalid@invalid.invalid> - 2013-02-05 23:00 +0000
Re: Opinion on best practice... Chris Angelico <rosuav@gmail.com> - 2013-02-06 10:35 +1100
Re: Opinion on best practice... Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-02-06 12:55 +1100
Re: Opinion on best practice... Dan Stromberg <drsalists@gmail.com> - 2013-02-05 18:14 -0800
Re: Opinion on best practice... Chris Angelico <rosuav@gmail.com> - 2013-02-06 17:16 +1100
Re: Opinion on best practice... rusi <rustompmody@gmail.com> - 2013-02-05 23:32 -0800
Re: Opinion on best practice... Grant Edwards <invalid@invalid.invalid> - 2013-02-06 15:18 +0000
Re: Opinion on best practice... Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2013-02-06 12:37 -0500
Re: Opinion on best practice... Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-02-07 10:46 +1100
Re: Opinion on best practice... Chris Angelico <rosuav@gmail.com> - 2013-02-07 16:28 +1100
Re: Opinion on best practice... Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-02-07 06:50 +0000
Re: Opinion on best practice... Chris Angelico <rosuav@gmail.com> - 2013-02-07 18:49 +1100
Re: Opinion on best practice... Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-02-08 09:49 +1100
Re: Opinion on best practice... Chris Angelico <rosuav@gmail.com> - 2013-02-08 17:54 +1100
Re: Opinion on best practice... Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2013-02-08 12:41 -0500
Re: Opinion on best practice... Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2013-02-07 13:54 -0500
Re: Opinion on best practice... Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-02-08 09:58 +1100
Re: Opinion on best practice... Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2013-02-08 13:29 -0500
Re: Opinion on best practice... Chris Angelico <rosuav@gmail.com> - 2013-02-09 11:28 +1100
Re: Opinion on best practice... John Ladasky <john_ladasky@sbcglobal.net> - 2013-02-08 19:10 -0800
Re: Opinion on best practice... Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2013-02-06 00:33 -0500
Re: Opinion on best practice... Anssi Saari <as@sci.fi> - 2013-02-06 15:30 +0200
Re: Opinion on best practice... Grant Edwards <invalid@invalid.invalid> - 2013-02-05 22:59 +0000
Re: Opinion on best practice... Ian Kelly <ian.g.kelly@gmail.com> - 2013-02-05 17:05 -0700
Re: Opinion on best practice... Grant Edwards <invalid@invalid.invalid> - 2013-02-06 15:04 +0000
Re: Opinion on best practice... Neil Cerutti <neilc@norwich.edu> - 2013-02-06 14:20 +0000
Re: Opinion on best practice... Grant Edwards <invalid@invalid.invalid> - 2013-02-06 15:11 +0000
Re: Opinion on best practice... Nobody <nobody@nowhere.com> - 2013-02-06 03:32 +0000
Re: Opinion on best practice... Michael Torrie <torriem@gmail.com> - 2013-02-05 22:07 -0700
csiph-web