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

If expressions (a la Rust) #10

Open
Vorlias opened this issue May 25, 2021 · 0 comments
Open

If expressions (a la Rust) #10

Vorlias opened this issue May 25, 2021 · 0 comments
Labels
AST/Parser Abstract Syntax Tree Possibility Runtime/Interpreter Type/Feature New feature or request

Comments

@Vorlias
Copy link
Member

Vorlias commented May 25, 2021

# shorthand
let example = if value: "Hello, I'm true"

Shorthand would evaluate to "Hello, I'm true" (if true) or undefined

# longhand
let example = if value {
    "Hello, I'm true!"
} else {
    "Hello, I'm false!"
}
@Vorlias Vorlias added Type/Feature New feature or request Possibility labels May 25, 2021
@Vorlias Vorlias added AST/Parser Abstract Syntax Tree Runtime/Interpreter labels Jul 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AST/Parser Abstract Syntax Tree Possibility Runtime/Interpreter Type/Feature New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant