1

I've installed the Regina Rexx package (version 3.9.1) in Cygwin on Windows 10. To test it out, I wrote the following code:

caller:

#!/usr/bin/rexx
x = 'callee'() ; say 'callee returned' x ; exit

callee:

#!/usr/bin/rexx
say 'In callee' ; return 42

When I invoke caller, I expect to see:

> ./caller
In callee
callee returned 42

And in fact, this is exactly what I do see when both execs are in my current directory. However, when I move them to a different directory in $PATH and invoke caller, I see:

> ./caller
caller returned In callee

This was ... unexpected. If there's an explanation of the behavior in the Regina Rexx manual, I'm not seeing it. Am I missing something? Thanks.

Denizen
  • 41
  • 7
  • 1
    You may want to ask this on one of the Regina REXX forums on SourceForge; the response may be quicker.(To be fair, this is probably the first Regina question I've seen on SO.) – zarchasmpgmr Jan 11 '19 at 22:34

1 Answers1

3

It turns out that Rexx execs can be used as external functions only if they reside in a directory mentioned in the REGINA_MACROS variable, like so:

export REGINA_MACROS="${HOME}/subdir:/maybe/somewhere/else"

Without this, the called routine is treated as just another executable. The return value is all stdout lines with a space delimiter between them. Any stderr output is sent to the screen (or redirected) as usual.

Denizen
  • 41
  • 7
  • 2
    [Here](https://comp.lang.rexx.narkive.com/G2FTlwd4/regina-win32-regina-macros) are some details. – Polluks Apr 05 '19 at 17:08