Making CALL Raise a (definitional) Error For Bad Exit Codes

So I twisted the bootstrap executable to this notion of CALL waiting-by-default...and also treating a non-zero exit code as an error unless you said CALL/RELAX.

This made me wonder though: what should the result of CALL be if you don't say /RELAX ?

If it's still going to be a status, it will always be 0. But this suggests you might have something to learn by testing the result.

A misguided person might write:

if 1 = call ["something.exe" (filename)] [
   print "This could never happen since CALL would error on non-0 exit code"
]

This is where we might argue that using NOTHING as the "useless success result" could be beneficial... if nothing wasn't something you could use plain comparison on. That was the case in Rebol2 with unsets:

rebol2>> #[unset!] = #[unset!]
** Script Error: Operator is missing an argument

But Red and R3-Alpha allow it...

r3-alpha>> #[unset] = #[unset]
== true

red>> #(unset) = #(unset)  ; yes, a third trivially different notation
== true

Ren-C has thus far followed suit, without backing away from the idea that you can compare nothing to itself (or other values).

ren-c>> ~ = ~
== ~true~  ; anti

But is this progress?

I just posted a challenge to the value of considering nothing to be neither truthy nor falsey. Note that conditional orneryness is somewhat pointless, as it provides a protection that wouldn't help the case you're supposedly distinguishing from: if CALL returned an integer unconditionally a blind conditional check would be a bug, since all integers (including zero) are truthy in the language.

If equality tests to nothing were ornery that seems it would help something. So I think it's worth asking what would be broken if you couldn't.

In any case...I didn't change plain CALL without /RELAX to return nothing yet, but I might do so. It has the benefit of omitting an "==" output as well due to the console suppression of nothing.

>> call/shell "dir"
 Volume in drive C has no label.
 Volume Serial Number is 72AF-4302

 Directory of C:\Projects\ren-c\prebuilt

03/09/2024  08:32 AM    <DIR>          .
04/26/2024  03:36 PM    <DIR>          ..
11/07/2014  02:53 PM           563,560 r3-alpha
04/27/2019  04:01 PM         1,363,856 r3-linux-x64-8994d23
10/20/2023  01:23 PM         1,298,055 r3-windows-x86-8994d23.exe
10/20/2023  01:20 PM             1,656 README.md
10/22/2023  01:37 AM           864,256 rebol2.exe
03/09/2024  08:30 AM         1,607,680 red.exe
               6 File(s)      5,699,063 bytes
               2 Dir(s)  1,592,278,437,888 bytes free

>>

If 0 was left as the result, that would say "== 0" before the ">>"