<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
On 2/22/2016 6:18 PM, Joe Groff wrote:<br>
<blockquote
cite="mid:A9CEBEB0-7FC7-43D0-A962-269625D36116@apple.com"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
<br>
<div>If I understand the intent of `weakify` correctly, I think
this kind of use case is already pretty severely curtailed by
our removing the tuple splat feature, since you can no longer
make `weakify` generic across multiple method signatures. Like
the tuple splat feature, an explicit variadic splatting feature
ought to make this possible for flattened method signatures:</div>
<div><br class="">
</div>
<blockquote style="margin: 0 0 0 40px; border: none; padding:
0px;" class="">
<div>func weakify<Class: class, Args, Result>(instance:
Class, method: (Class, Args...) -> Result) -> (Args...)
-> Result {</div>
<div> return {[weak instance] args... in method(instance,
args...) }</div>
<div>}</div>
</blockquote>
<br class="">
<div class="">-Joe</div>
</blockquote>
<br>
Agreed on the tuple splat removal point, but the common use cases I
use this for today don't apply weakify to methods with more than one
argument in practice. Even so, your example here is admittedly a
pretty simple change to make to keep existing functionality if the
curried form of this goes away, and this language change would make
it haeder for people who want to do something similar to create a
retain cycle scenario if they don't use something like weakify to
safely pass method references around.<br>
<br>
I do like the current behavior, but given this you've convinced me
that it may be best for it to change :)<br>
<br>
- Kevin<br>
</body>
</html>