Skip to content

Make if/else :? return the entire stack, allow blocks as conditions#160

Merged
nick-paul merged 2 commits intoaya-lang:masterfrom
BlazingTwist:of_ifelse_return_multiple
Nov 19, 2025
Merged

Make if/else :? return the entire stack, allow blocks as conditions#160
nick-paul merged 2 commits intoaya-lang:masterfrom
BlazingTwist:of_ifelse_return_multiple

Conversation

@BlazingTwist
Copy link
Copy Markdown
Contributor

I was caught by surprise by if/else twice:

  • conditions cannot be blocks (always evaluated as true)
  • actions cannot return more than one value

I changed both of these things.

Allowing blocks seems useful to me. It's an adjacent idea to #149

Returning multiple values is what I intuitively expected.
Though it may break existing code if it relies on the stack being cleared.

@nick-paul
Copy link
Copy Markdown
Collaborator

Thanks, this change makes sense to me! I wasn't thinking about it when I added it originally

@nick-paul nick-paul merged commit a239da7 into aya-lang:master Nov 19, 2025
1 check passed
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

Successfully merging this pull request may close these issues.

2 participants