metaeducation / ren-c

Library for embedding a Rebol interpreter into C codebases
GNU Lesser General Public License v3.0
127 stars 27 forks source link

Wish: Variadic refinement arguments #848

Open hostilefork opened 6 years ago

hostilefork commented 6 years ago

Currently specifying the same refinement multiple times gives an error. It could be interesting if doing so would be legal if the arguments to the refinement were declared to be variadic.

foo: function [x /y [integer! <...>]] [
    print x
    while [not tail? y] [print take y]
 ]

 >> foo/y/y/y "variadic!" 10 20 30
 variadic!
 10
 20
 30

While a seemingly frivolous feature, this came up as being a potential aspect for making a unified dialect which covered command-line processing as well as function arguments.

BlackATTR commented 6 years ago

Interesting!