This is the mail archive of the guile@sourceware.cygnus.com mailing list for the Guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Syntatic sugar and identifier permissivity


Andrew Ho <andrew@tellme.com> writes:


> For another comparison, this "alternate syntax to indicate that the first
> argument is an object" is also used in Perl 5. For that example,
> 
>      method($object, $arg1, $arg2);
> 
> is written in OO-style like this:
> 
>      $object->method($arg1, $arg2);

This makes sense for Perl, but it would not make sense for GOOPS.

The reason is that in Perl, a method is just a function scoped within
a class Package that takes an instance of it's class as the first
argument.  It is not even real method dispatch based on the types of
the arguments.

For GOOPS such a syntax would make sense only for accessors, which is
what Lalo proposed.  This is because in GOOPS methods are not
dispatched on just the first argument.


-- 
Craig Brozefsky                      <craig@red-bean.com>
Free Scheme/Lisp Software  http://www.red-bean.com/~craig
"Hiding like thieves in the night from life, illusions of 
oasis making you look twice.   -- Mos Def and Talib Kweli

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]