Skip to content
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

eval builtin can take a block #1025

Open
andychu opened this issue Nov 28, 2021 · 0 comments
Open

eval builtin can take a block #1025

andychu opened this issue Nov 28, 2021 · 0 comments

Comments

@andychu
Copy link
Contributor

andychu commented Nov 28, 2021

Part of #631

Just realized that the new typed args means that the val builtin can take a (parsed) block directly, in addition to the old string interface.

So instead of eval $mystr, you can be passed a block as a param, and do eval (myblock)

It also means that the literal eval { echo hi } is equivalent to { echo hi } (shell brace group), which makes sense!

This is turning out nicely!


I think we still need functions eval_word() (returns string) and eval_expr() (returns value_t) though

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant