If succinctness is the criterion, shouldn't everyone be using APL instead of 
COBOL?

Python is not as succinct as it might be. My understanding is that Python uses 
AND and OR rather than the more common & and | or && and ||. Up to two more 
keystrokes each! Is that a bad thing?

For any language I suspect it is easy for an aficionado to pick a task for 
which the language is particularly well suited. 

"99 Bottles of Beer" is more concise in C++ than in Python, and MUCH more 
concise in BASIC. Does that make BASIC a better language? 
https://en.wikipedia.org/wiki/99_Bottles_of_Beer 

Charles

-----Original Message-----
From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On Behalf 
Of David Crayford
Sent: Wednesday, June 29, 2022 2:24 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: Some questions on SYSCALL

On 30/06/2022 4:22 am, Bernd Oppolzer wrote:
>>
> This is an old OS/2 REXX program (from the 1990s, IIRC),
> used to traverse a directory tree recursively and issue a command in 
> every subdirectory found:
>
>
> /* rexx */
>
> arg command
>
> call RxFuncAdd "SysLoadFuncs", "REXXUTIL", "SysLoadFuncs"
> call SysLoadFuncs
>
> dir = directory()
> if right(dir,1) = "\" then
>    dir = left(dir, length(dir) - 1)
>
> call tree dir, command
>
> x = directory(dir)
>
> exit
>
>
> tree: procedure
>
>    arg dir, command
>
>    say "*** Verzeichnis in Bearbeitung: "dir" ***"
>
>    x = directory(dir)
>
>    command
>
>    rc = SysFileTree("*.*", verz, "D")
>    do i = 1 to verz.0
>       dir = word(verz.i, 5)
>       call tree dir, command
>    end
>
>    return
>
>
> you may notice the recursive call of the procedure "tree".
>
> I don't see any justification for your REXX bashing;
> it's just another flavor of scripting language, which allows to do 
> great things,
> once you manage to use it.

Sorry Brend, but I don't consider that snippet to be great! It's a 
perfect example of flabby, verbose REXX code. The only justification for 
using REXX is that you personally favor the language. Python is far more 
succinct.

|for| |root, dirs, files ||in| |os.walk(path_of_the_directory):|
|||for| |i ||in| |files:|
|||print||(os.path.join(root, i))|

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to