The goal of getter/setter tearoffs is lazy (delayed) property access, right? C++ has this feature, and therefore a syntax for it: references.
This concept could either be copied directly, introducing reference types:
var l = ["hello", "world"];
var& len = l.length; // read/write reference
final& lst = l.last; // read-only reference
The setter would be invoked by applying the assignment operator to the reference variable:
len = 1;
print(lst); // "hello"
Alternatively, you could just borrow the address-of operator `&` to access the getter method:
var l = ["hello", "world"];
int Function() lst = &l.last;
l.length = 1;
print(lst()); // "hello"
Now, what would be the signature of `&l.length`? `int Function()` or `void Function(int)` or `int Function([int])`?
So maybe use the get/set keywords as prefix operators, instead of `&`?
int Function() getLen = get l.length;
void Function(int) setLen = set l.length;
I'm well aware that pointer arithmetics (and everything that might look like it) is a topic that is discussed with great passion, and I don't want to abuse this thread for a debate about its place in Dart. The point I wanted to make was: I think the problem that is unique to property tearoff is the distinction between getter and setter, which will require unique syntax anyways. Once you solve that, you can treat it as a normal variable/function, and apply established language mechanisms to it. So I'd argue that getter/setter tearoff shouldn't block the other features discussed in this thread :-)
Now bear with me while I give my thoughts about the original topic, currying.
What do you think of a "delayed call operator" `{}`? This operator looks like a function call with curly braces, but it always returns a function:
String doTheFoo(int n, String s, bool b) {
return "$n $s $b";
}
String Function(String, bool) withFirstArg = doTheFoo{42}; // binds `42` as first argument
print(withFirstArg("is", true));
List Function([int]) constructor = new List{};
Obviously, it suffers from the same problem as the `.call` tearoff of functions (discussed
here): `f == f{} == f{}{} == f{}{}{}`