3 ms·
Looks like a very interresting language to me. I think it superficially looks a lot like rpython, with way more options to restrict and specify types on top of
by Raphael_Amiard 16y ago
Looks like a very interresting language to me. I think it superficially looks a lot like rpython, with way more options to restrict and specify types on top of it. I'm very eager to see more documentation, specifically on types and memory management.
What is the syntax for pointers for example ?
- kssreeram 16y agoHi. Pointers to type T have the type Pointer[T]. '&' operator is for getting the address of a lvalue, and the '^' operator is for dereferencing. '^' is a better choice than C's '*' for dereferencing because, I can conveniently use the same operator for dereferenced field-access too, whereas C had to invent another operator "->" for that. record Point[T] { x : T; y : T; } updateViaPointer(ptr) { ptr^.x += 1; ptr^.y += 2; } test() { var p = Point(10, 20); // type will be inferred as Point[Int] updateViaPointer(&p); }
- deleted 16y ago[deleted]