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

make v is T and v or e imply not-T for expression e #894

Merged
merged 1 commit into from
Jan 4, 2025

Conversation

hishamhm
Copy link
Member

@hishamhm hishamhm commented Jan 3, 2025

Only for "truthy types" (i.e. all except boolean and nil).

Closes #878.

@hishamhm
Copy link
Member Author

hishamhm commented Jan 3, 2025

@euclidianAce what do you think? worthy or too hacky?

Copy link

github-actions bot commented Jan 3, 2025

Teal Playground URL: https://894--teal-playground-preview.netlify.app

Only for "truthy types" (i.e. all except boolean and nil).

Closes #878.
@euclidianAce
Copy link
Member

Looks good to me! 👍

worthy or too hacky?

I think small special cases like this are worth it to support some existing Lua idioms.

@hishamhm hishamhm merged commit 5631a99 into master Jan 4, 2025
8 checks passed
@hishamhm hishamhm deleted the and-or-inference branch January 4, 2025 19:38
@hishamhm
Copy link
Member Author

hishamhm commented Jan 4, 2025

Merged — hopefully we'll be able to remove this once we handle nils separately.

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.

is should imply truthiness for non-boolean non-nil types
2 participants