Replies: 1 comment
-
I think eval is, sadly, the only current solution here. (see #36 for related discussion) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
My specific encounter was implementing a ghetto switch-case #31 like so:
but this will echo
reached default
because'some*'
won't be expanded inside the tilde-match statement.this is good behaviour of course, but my question is do we have an idiomatic way to override it?
AFAIK there's no
expand
primitive, andeval
would try to run the pattern as a command.Perhaps the only answer is
eval '{~ $match '$case'}'
, but I wonder if there's something more general to expand quoted patterns without necessarily running a command on them undereval
..Beta Was this translation helpful? Give feedback.
All reactions