You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently just always separates variadic parameters with the string " ". Now that just has escaping of arbitrary characters, should there be a recipe attribute to customize the variadic separator string for individual recipe?
This could allow shebang recipes to work with variadic parameters as lists where the values may contain spaces: the variadic delimiter string could be set to something vanishingly unlikely, e.g. null character \u{0}, and the shebang recipe's interpreter could split on that and internally work with a list variable.
For linewise recipes, this would make more opportunity for just to have a quote_each function like suggested in the other issue, its signature could be quote_each(string, input_delimiter_string) and it return each quoted string separated by space.
The text was updated successfully, but these errors were encountered:
This is a really interesting thought. We could have a separate function, or we could give quote() an optional second argument, which is an optional input_delimiter. Although, an advantage a separate function like quote_each, would be that if the delimiter is omitted, it could default to \0, so you wouldn't need to specify the separator in multiple places.
This does feel super hacky though. I would really prefer doing what was proposed in #208, which is to allow values which are lists of strings, so that quoting can interact correctly with var args. But, I've been talking about that for a while and still haven't done it 😅
Related to #647 (comment)
Currently
just
always separates variadic parameters with the string" "
. Now thatjust
has escaping of arbitrary characters, should there be a recipe attribute to customize the variadic separator string for individual recipe?This could allow shebang recipes to work with variadic parameters as lists where the values may contain spaces: the variadic delimiter string could be set to something vanishingly unlikely, e.g. null character
\u{0}
, and the shebang recipe's interpreter could split on that and internally work with a list variable.For linewise recipes, this would make more opportunity for
just
to have aquote_each
function like suggested in the other issue, its signature could bequote_each(string, input_delimiter_string)
and it return each quoted string separated by space.The text was updated successfully, but these errors were encountered: