jamiebuilds / ghost-lang

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

Range comparison #14

Closed aleclarson closed 6 years ago

aleclarson commented 6 years ago

Thoughts?

let foo = 1
if (0 < foo < 100) { log('> 0 && < 100') }
if (foo in 0...2) { log('>= 0 && <= 2') }
jamiebuilds commented 6 years ago

I'd probably just add a method in the Range interface.

assert(0..3.contains(1))