Brevity in the Box: When Is It Worth It?

The DOES native no longer... does this. Especially because its meaning is in flux... DOES is being limited to BLOCK! for now.

But here's a bit of code from the tests for DOES+ which has this behavior.

(does+: reframer lambda [f [frame!]] [
    does [eval copy f]
]
ok)

(
    backup: block: copy [a b]
    f: does+ append block [c d]
    f
    block: copy [x y]
    f
    all [
        backup = [a b [c d] [c d]]
        block = [x y]
    ]
)

(
    x: 10
    y: 20
    flag: 'true
    z: does+ all [x: x + 1, true? flag, y: y + 2, <finish>]
    all [
        z = <finish>, x = 11, y = 22
        elide (flag: 'false)
        z = null, x = 12, y = 22
    ]
)

(
    catcher: does+ catch [throw 10]
    catcher = 10
)

But what do people think? Is that cool, or bad? It captures all the variables at the state they are at the time of specialization, so it's different from putting code in a block. That could be rethought, but also it does offer a bit of optimization if it's what you want...and is different from giving a BLOCK!.

I note that this doesn't work with GROUP!s, but it should:

>> code: [print "Hello"]
== [print "Hello"]

>> x: does+ (code)
** Error: Actions made with REFRAMER cannot work with GROUP!s

There isn't any real reason that shouldn't work. It could just implicitly say the action it is reframing is EVAL if it's a GROUP!. Well, I'll get to that someday. :yawning_face: