<div dir="ltr"><div class="gmail_default" style="font-size:small"><br><br><div class="gmail_quote">On Mon, Mar 4, 2013 at 11:01 AM, Graeme Geldenhuys <span dir="ltr"><<a href="mailto:graeme@geldenhuys.co.uk" target="_blank">graeme@geldenhuys.co.uk</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On 2013-03-04 01:47, Boian Mitov wrote:<br>
> vast improvements of the code and the readability.<br>
<br>
</div>They are unreadable to me.<br>
<div class="im"><br>
> I recently started<br>
> rewriting our libraries with anonymous methods and that alone allowed for<br>
> cutting over 20000 lines of code<br>
<br>
</div>Just my dropping method names? I doubt that.<br></blockquote><div><br></div><div><div style="font-size:small" class="gmail_default">It's not removing method names that cut all those lines, but whole class declarations. Imagine situation where you want to call specific method as callback but you also want to pass some parameters to that method. Your options would be:</div>
<div style="font-size:small" class="gmail_default"><br></div><div style="font-size:small" class="gmail_default">- declare callback interface as class, and call specific method in that class (Java-style); you will need to set some fields of callback object with specific parameters</div>
<div style="font-size:small" class="gmail_default">- declare callback interface as method pointer, and call it (similar to previous solution); again, you will need to set some fields of callback objects</div><div style="font-size:small" class="gmail_default">
- declare callback interface as class or method pointer, and in advance add parameter with type 'array of const' for user-defined parameters; would work, but you would loose type-safety</div><div style="font-size:small" class="gmail_default">
- declare callback interface as function pointer, and pass closure/anonymous method to it; let the compiler do all the magic, wrap-up local variables for you and "send" appropriate values to specific function call</div>
</div><div><br></div><div>There are definitely benefits from this feature, but they require different architecture/design of your application.</div><div><br></div><div>Regards,</div><div>Aleksa</div><div><br></div></div>
</div>
</div>