jamiebuilds / ghost-lang

:ghost: A friendly little language for you and me.
302 stars 10 forks source link

Conditional assignment #18

Closed aleclarson closed 6 years ago

aleclarson commented 6 years ago

Thoughts?

let foo: any

# assign if `foo` is null
foo ?= 1

# assign if `foo` is falsy
foo ||= 1

# assign if `foo` is truthy
foo &&= 1
jamiebuilds commented 6 years ago

I don't even have an assignment syntax at this point