troyhen / neo

Neo Programming Language
https://groups.google.com/forum/#!forum/neo-lang
12 stars 0 forks source link

Add == for equality, === for identity and ~= for match #32

Closed troyhen closed 12 years ago

troyhen commented 12 years ago

Expression a == b is the same as a.equals(b) in Java. Expression a === b is the same as a == b in Java. Expression a ~= b calls the multimethod match~boolean(a, b).

The following need to work:

val a = 'word
val b = 'wo
val c = 'rd
val d = b + c
a == d         # true
a === d        # false
a === d.intern # true
a ~= 'word     # true
a ~= String    # true
a ~= /\w+/     # true
troyhen commented 12 years ago

Done