Rethinking Auto-Gathered SET-WORD! Locals

It's been quite a number of years now since I deemed locals-gathering-FUNCTION to be unfit.

But it has been lingering around.

One reason is because I had never quite figured out how to make LET work in PARSE. Which means I have to change:

foo: function [...] [
    parse [
        alpha: across some ...
        beta: collect ...
        ...
        zeta: try block! ...
   ]
]

into

foo: func [...] [
    let alpha
    let beta
    ...
    let zeta
    parse [
        alpha: across some ...
        beta: collect ...
        ...
        zeta: try block! ...
   ]
]

Besides this, there's also the fact that LET's implementation is still very experimental and sketchy. So it's not quite as robust as <local>...

But With Pure Virtual Binding II, Locals-Gathering Is Finally Dead!

For one thing, there's now a LET in UPARSE.

For another thing, the idea of LET being based on an accrued environment is being committed to. Environments accrue and chain, and so LET is one of the things you should be able to do.

In any case... the eventual idea is that FUNC will just be shorthand for FUNCTION, with the two meaning the same thing. (see Abbreviations as Synonyms)

1 Like