Revisiting a Maybe-Not-So-Weird Old Idea: <- as IDENTITY

I was editing an old post and saw this:

Being able to use ALL in this way is a neat trick. Though it doesn't make a ton of sense with only one condition anymore... because IF returns NULL now when it doesn't take the branch.

So this is the same, and clearer:

post-build-commands: if not cfg-symbols [
    reduce [
        make rebmake.cmd-strip-class [
            file: join output ? rebmake.target-platform.dll-suffix
        ]
    ]
]

But let's say you have more than one condition, and want to use the trick that the last expression falls out of an ALL.

I think it doesn't jump right off the page what's going on. If you used the identity arrow:

post-build-commands: all [
    not cfg-symbols

    ; ...imagine more conditions here...

    <- reduce [
        make rebmake.cmd-strip-class [
            file: join output ? rebmake.target-platform.dll-suffix
        ]
    ]
]

I've not 100% committed to this as the meaning of leftward arrow yet. But when I see things like this I think "it really does help code comprehension".

2 Likes