-
Notifications
You must be signed in to change notification settings - Fork 16
Open
Description
We should implement casting operations. The suggested syntax is:
x = Type(value);
There are some ideas of implementations of that:
- Internally on
init()(where we haveaddMethod()) we could have:
addCast(CLEVER_INT, method_int_cast_name); // Method that casts an Int to the current type
addCast(CLEVER_STR, method_str_cast_name); // Same with String
...
- User classes (we could replace @ with cast):
class Foo {
function @Int(x) {
}
// ... or
cast std:collection:Set(x) {
}
}
What do you think?
Reactions are currently unavailable