Re: Bind Module for Perl



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Torsten Schoenfeld wrote:
On 31.12.2010 13:38, Jens Luedicke wrote:
use Class::Bind;
$button->signal_connect(clicked =>  bind(\*MyWindow::callback, $self,
_1, _2, _3));

This syntax will of course have to compete with closures:

$button->signal_connect(clicked => sub { $self->callback(@_[0,1,2]) });

The syntax is basically the same. My approach is just a little different
(maybe with a little more overhead). The syntax offered by Class::bind
is probably more readable (which is very important to me).

I recently started to do some Perl hacking again and missed
a few syntactic notations I knew from C++.

Jens

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJNHeeyAAoJEPFZu/9GrBiLJikH/1aUWlsVIZrQXB97zVL8TCgH
Xul6sG8lHgABdyX7p+tIGEiBHD7VRNJiPuFdJRIPJxDPxOnulDWBD1LSBbVu47VP
yMiR9hx0JDu8a8crCgku/qIOdT60c9VzP2dkG9/wHsYYTgD31ZbRyneyrpZkwHfi
2LdKBEMtDY2wNN/IKnHcqZtqSKgItKhobKH7D0fDbqOaCt9rWyweISyLN4/AuzvO
eoGWVqlbwnCwgGFE9kiKcjqA+frDt52WJg4+OpvRhGvjSzmV8LODiqn4yFfbZIM5
oVOA8H3rRxu9sOkypvGLG/+yrB4fV4tQi5yRRidnX9N5D8yEtBwhvEQrb+HB6JU=
=3O3h
-----END PGP SIGNATURE-----



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]