troyhen / neo

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

Add type cast operator ~ #28

Closed troyhen closed 12 years ago

troyhen commented 12 years ago

This needs to work:

10~float == 10f      # (float) 10
10~String == "10"    # String.valueOf(10)
`10~int == 10        # Integer.parseInt("10")
(1..10)~List         # new Range(1, 10).toList()
[1 2 4 7 10]~Set     # new HashSet(Arrays.asList(new int[] {1, 2, 4, 7, 10}))
troyhen commented 12 years ago

Done, but not all of the above will compile until the list literals are added.