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

Ditch predicates, and let if operate on values #319

Closed
xiaq opened this issue Feb 14, 2017 · 1 comment
Closed

Ditch predicates, and let if operate on values #319

xiaq opened this issue Feb 14, 2017 · 1 comment

Comments

@xiaq
Copy link
Member

xiaq commented Feb 14, 2017

The current boolean/predicate story is a mess:

  1. Boolean outputs are on a separate channel than normal output.

  2. The relationship between predicates and booleans is not straightforward.

  3. If we were to add boolean operators, we perhaps need to make one set for predicates and another set for booleans.

Let's simply ditch predicates and turn them into functions that output booleans.

Now that we don't have predicates, we can rework if as well. Right now if takes a pipeline and expects it to be a predicate; since we don't have predicates, we can make if take a value instead.

The downside is that now we have a totally different if than traditional shells. But nothing is really lost: the current similarity is only syntactical and not semantic.

@xiaq xiaq added the change label Feb 14, 2017
@xiaq
Copy link
Member Author

xiaq commented Feb 14, 2017

The while control structure will also be affected by this change.

@xiaq xiaq added this to the 1.0 milestone Feb 16, 2017
xiaq added a commit that referenced this issue Feb 16, 2017
@xiaq xiaq closed this as completed in b6613d0 Feb 16, 2017
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