Buddha Buck <[EMAIL PROTECTED]> writes:

> Piers Cawley <[EMAIL PROTECTED]> writes:
> 
> > Buddha Buck <[EMAIL PROTECTED]> writes:
> > 
> > > Bart Lateur <[EMAIL PROTECTED]> writes:
> > > 
> > > > On Wed, 25 Apr 2001 15:52:47 -0600 (MDT), Dan Brian wrote:
> > > > So why not
> > > > 
> > > >         $object!method("foo", "bar");
> > > 
> > > In my opinion, because it doesn't provide sufficient visual
> > > distinction between $object and method().  At a glance, especially on
> > > a crowded page, it's similar in appearance to $objectImethod, for
> > > instance.  $object.method() has a visual separator (although I'd
> > > prefer $object->method()).
> > > 
> > > How about borrowing from Objective C?
> > > 
> > >        [$object method("foo", "bar")];
> > 
> > How do you create an anonymous list now then? Not that I object to
> > borrowing from Objective C you realise.
> 
> I thought ($one, $two, $three) was an anonymous list.

Oops, meant anonymous array.

> Seriously, I hadn't considered that their may be a problem with the
> syntax I gave.
> 
> How would you, under Perl5, interpret the expression I used.  To me,
> it looks like a syntax error.  '$object method("foo","bar")' isn't a
> valid method call, so it can't be a ref to an anonymous list of one
> value.

Hmm... I plead posting late at night.

> Other than severe dependence on the comma, is there any reason why we
> couldn't have the following?
> 
> 
> $foo  = [$one            ];   # array ref
> $baz  = [$obj,funcall()  ];   # array ref
> $quux = [$one,$two,$three];   # array ref
> $bar  = [$obj method()   ];   # method call
> $bat  = [$one $two $three];   # syntax error

Apart from the fact that we're adding one more meaning to [], one
which has no mnemonic relationship with arrays, no reason at all.

-- 
Piers Cawley
www.iterative-software.com

Reply via email to