-
Notifications
You must be signed in to change notification settings - Fork 314
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feed variables into other variables (limit scope of variables) #3433
Comments
I anticipate that sometimes authors will want a variable insertion to occur dynamically, and other times will want the value captured as at time of declaration. |
Wasn't this already discussed pretty heavily when designing the specs for variables? I feel like we decided to avoid this exact thing for a specific reason, but I can't recall at the moment. In any case, something like this would involve basically a full rewrite of the Variables extension. I would put this at low priority for now. |
Done for two main reasons: 1) to avoid recursion hell, and 2) to facilitate imperative interpreting. Both are still good reasons. The functionality suggested by Whether these are called template variables, or madlib variables, or function variables .. eh, whatever works. In any case, I agree .. we should let variables sit for a while before attempting to extend it. Let the bugs shake out. And remain open to a possible rewrite as a solution. |
Yeah, I felt this was likely discussed heavily but I just couldn’t point to where, and I wasn’t really involved in variables discussion (by choice). |
Your idea:
I'm opening this on behalf of a discord user so hopefully I have the request right-- could variables somehow have their scope limited to some degree, such that a variable could be reassigned throughout the brew?
The idea is to be able to do something like this:
and get output like this:
So the
Name
variable could be reused within another variable template. To more precisely show the thinking of the requesting user, theTraitMagicResistance
could take in another variable to fill slots, like this:called like this
And I suppose with this latter syntax the trailing variables would just fill in from beginning to end if there were multiple. Sort of like regex
The $1 has magic resist
substitution.The text was updated successfully, but these errors were encountered: