I've got a situation where I want an equivalence, such that:
[
{Foo}
http://example.com/some/stuff.html
separator
]
...is handled just as if you had written:
[
[{Foo}]
[http://example.com/some/stuff.html]
[separator]
]
Adding a little to the complexity is that if you put the item in a block, then it can have arguments:
[
[{Foo} /some-refinement]
[http://example.com/some/stuff.html {stuff caption} 3]
[separator dashed-line]
]
I'd like a PARSE-based engine that can run the same handler for {Foo}
, [{Foo}]
, and [{Foo} /some-refinement]
(let's call it STRING-HANDLER), and have it merely invoked with the right number of parameters.
To write this without PARSE is easy... a single element is wrapped in a temporary block (in the case it's not a block). Then the first item is tested in a CASE statement. But I'd like to convert this to be PARSE-based, where one branch uses INTO while another does not, without repeating code.
It will need to support nesting, so you might wind up processing something like:
[http://example.com/some/stuff.html [{Foo} /some-refinement] 3]