kssreeram
Joined 17 years ago
Joined 17 years ago
For me, it did replace ChatGPT for one reason: The convenience of a lightweight Iris window being just a hotkey away.
[1]: https://iris.fun/
Early adopters beware. If the idea doesn't work out for them, they'll pull the product from under you.
Quillpad itself predates Clay and hence doesn't use it.
procedure foo;
[T1,T2]
overload foo(a:T1, b:T2) {
// by default, convert both arguments
// to the type of first argument.
foo(T1(a), T1(b));
}
// the following overload specializes for the case
// when both arguments are of the same type.
[T]
overload foo(a:T, b:T) {
...
implement the logic here
...
} 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);
}That's not true.
Generic Programming is about writing re-usable code that is also very efficient. On the whole, it requires the following:
- Static types
- Overloading
- Type-parametric functions (templates)
- Type specialization.
Not all languages have these features.
Generic programming first took off with C++, when it introduced templates. But a few languages before and after C++ have supported generic programming: Ada, Haskell, D, etc.
edit: formatting.
http://www.reddit.com/r/programming/comments/ctmxx/the_clay_...
Follow me at: https://twitter.com/kssreeram