Feature request
It would be useful to have an enclose string function that prepends a prefix
and appends a suffix to every whitespace-separated string in its argument.
The function could be defined as:
enclose(prefix, suffix, s) := prepend(prefix, append(suffix, s))
For example:
enclose('systemd/', '.service', 'foo bar baz')
# → 'systemd/foo.service systemd/bar.service systemd/baz.service'
This would be a convenient shorthand for the common pattern:
prepend(prefix, append(suffix, s))
It would complement the existing prepend() and append() functions while
making it clearer that each item is being enclosed by a prefix and suffix.
The function name may be: enclose, warp, surround, etc.
Feature request
It would be useful to have an
enclosestring function that prepends a prefixand appends a suffix to every whitespace-separated string in its argument.
The function could be defined as:
For example:
This would be a convenient shorthand for the common pattern:
It would complement the existing
prepend()andappend()functions whilemaking it clearer that each item is being enclosed by a prefix and suffix.
The function name may be:
enclose,warp,surround, etc.