The title is literal--I'm really talking about ...
My proposal, which I like and @IngoHohmann liked, is that ...
be a form of interactive breakpoint that triggers the debugger and lets you type in something. More or less like:
>> x: 10
>> print ["The value plus x is" ... + x]
** Encountered `...`, use RESUME/WITH to continue with value
** Debug Break
|0|>> x
== 10
>> resume/with 20
The value plus x is 30
Symbolically, it stands out a bit. And also, this would make it kind of reasonable as a sort of "TBD". If you're working on code and haven't gotten to something yet, you can indicate that pretty easily:
solve-virtual-binding: function [
{Avoid exponential cost from nested binds}
][
...
]
And when people are stubbing in examples on the internet for code snippets, it's good there too. If you ever actually run the code, you'll get something more useful than an error.
But that brings up a question... ... ...
What to use for variadics?
If ...
means "unfinished" or "breakpoint", it seems bad to borrow it as we are today for variadic function arguments. Currently those are with the tag <...>
:
foo: function [args [integer! <...>]] [...]
Right there, juxtaposed against the coolness of the proposed usage, it seems we should pick something better, rather than blindly following along with what C and some other languages use.
So, what are the options? I actually initially used double brackets, when I wanted the system to be avoiding keywords to make it more skinnable:
foo: function [args [[integer!]]] [...]
But that's not necessarily very communicative, and looks a bit more like it's some kind of composition tool, a la composeII.
@gchiu suggests <any>
, syncing up more with the PARSE sense of the word, and that might look good going before, though it might look weird doubling up with ANY-VALUE!:
foo: function [args [<any> integer!]] [...]
foo: function [args [<any> any-value!]] [...] ;-- too weird?
In a PARSE rule you can write [any any-value!], so it's not like it's that bad.
On the one hand, it's bad to make up names when CS agrees on it. So using the word <variadic>
could be argued for over things like <multi>
or somesuch. Then again, if the goal is to be accessible and non-intimidating then variadic and VARARGS! as the name of the type might should be reconsidered.
Either way I think <...>
should be avoided, so as to let the new meaning of ...
take the stage. So, ideas/votes on the fate of variadics?