List Info

Thread: Re: NetBSD-3.1 was attacked: Bug of SSHD or cyrus-sasl?




Re: NetBSD-3.1 was attacked: Bug of SSHD or cyrus-sasl?
user name
2007-01-12 06:34:32
On 1/12/07, Daniel Barlow <dantelent.net> wrote:
> Jeff Anderson wrote:
> > What kills me about PHP (i was coding up some
recently) is that an objects
> > attributes and methods have to be called in
different ways:
> >
> > $object->attribute;
> > $object->method();
>
> Not really seeing this is evil, it's just "not
what you're used to".
> If the language parses $object->method as a /call/
to method, you have
> no way to refer to the method object itself.

The method invocation with the trailing parenthesis is
consistent with
the Perlish invocation of subroutines as "fun" or
"fun()". I think
this derives from the similarity with shell languages which
avoids
unnecessary characters, just as the syntax for list
functions:
         print "a ", "b ", "c
", "n"
rather than
         print("a ", "b ", "c
", "n")

> Note that I have no idea whether you /can/ refer to the
method itself
> in PHP and don't care enough about that ridiculous
excuse for a
> language to find out, but you'll find a similar
distinction in Scheme,
> Javascript, and probably quite a lot of languages. 
Even C - although
> obviously there it's about plain old functions, not
methods.

As a matter of fact, you have the ugly

            $object->can('attribute')
and
            $object->can('method')

where there is no difference between attributes and methods
(because
you really didn't need to know it for sure -- it is a matter
of
implementation).

And that does not work all the time because the method can
be
implement by AUTOLOAD.

It is different in Javascript, Scheme and C because these
languages
avoid the kind of many ways to express a thing that Perl is
so fond
of.

Regards,
Adriano.

[1]

about | contact  Other archives ( Real Estate discussion Medical topics )