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

The implementation of push and pop need to change to be more easily encapsulated in double quotes #5

Closed
kristopolous opened this issue Dec 9, 2011 · 2 comments
Assignees

Comments

@kristopolous
Copy link
Owner

echo "Stack.pop()" doesn't work as expected.

@kristopolous
Copy link
Owner Author

kristopolous commented Jun 27, 2016

After much consideration I've determined that this isn't possible without a fundamental rearchitecting

@kristopolous
Copy link
Owner Author

it's worth noting that if someone can come up with modifying in-shell variables inside of double quotes I'm open to re-opening this.

A few notes:

  • $(...) doesn't work because () is a subshell. You can't hoist modified variations back up.
  • There may be a coproc way of doing this, where the coproc acts a poor-mans data-store over a unix-pipe. This is quite elaborate for solving such a thing as this.
  • (( )) accepts lists but it is limited to something called the "arithmetic" operators which means you can't do function calls
  • There is a way of doing this with traps but again, hijacking the signalling system is a pretty unusual side-effect for such a feature.
  • As far as I know, there is no ${ ... } syntax that allows arbitrary in-shell code to be run. If this can be figured out that would be great.

Anyway, again if you can find a way that is proportional in complexity and overhead to the feature, I'd be happy to do it.

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

No branches or pull requests

1 participant