From: Aredridel Date: 2003-08-16T12:02:27+09:00 Subject: Re: Overloading () --=-3y9vXRkQCZ7it901IjV+ Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Fri, 2003-08-15 at 16:54, Dave Benjamin wrote: > "Austin Ziegler" wrote in message > news:2003814162351.292849@PADD... > > Because () isn't really an operator -- at least not yet, and I don't kn= ow > > whether or not Matz will make it an operator. I'm not sure whether I'd > want > > it to be an operator. Maybe Matz can make it so that the [] syntactic > sugar > > for Proc can work with () as well. >=20 > I think I'm really asking the wrong question here. What I'd really like t= o > know about is "callable objects". The () is a syntactical construct that = has > a different meaning in Ruby than in Python. In Ruby, () is optional. But > this isn't what I'm really asking. I'm asking how one might make an objec= t > in Ruby behave like a method. That's something I'd been wondering -- it came as a surprise to me that all methods aren't first-class objects. Of course, I was used to needing to pass method handles around from all my time spent in PHP, and since using Ruby, haven't needed that even once. I think the biggest thing is that methods-as-objects, or lambdas as objects are a functional programming artifact, which doesn't mesh with OO very well at times. I think this is one of those cases. Ari --=-3y9vXRkQCZ7it901IjV+ Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2 (GNU/Linux) iD8DBQA/PZ6stP09exA3hooRAllpAKCUk2V09VwmVMlKryYAWdLnsi6v3wCgr7wQ E3FZ8VpVKZwf4bP2f3Y2QiU= =CIUf -----END PGP SIGNATURE----- --=-3y9vXRkQCZ7it901IjV+--