develooper Front page | perl.perl6.language | Postings from January 2004

Re: Semantics of vector operations (Damian)

Thread Previous | Thread Next
From:
Luke Palmer
Date:
January 22, 2004 14:14
Subject:
Re: Semantics of vector operations (Damian)
Message ID:
20040122221344.GA16526@babylonia.flatirons.org
Luke Palmer writes:
> >      (1,2,3,4,5)  +« foo()   # Maybe the same as above? What does infix:+(@list,$scalar) do?
> 
> Well, what does a list return in scalar context?  In the presence of the
> C comma, it returns 5 for the last thing evaluated.  In its absence, it
> returns 5 for the length.
> 
> >      (1,2,3,4,5)  +  foo()   # foo() in list context? What does infix:+(@list, @list2) do?
> 
> Same deal, 5 + $(foo())

And of course I forgot to read you comments.  So you want to add two
lists, as in:

    [1,2,3,4,5] + [foo()]

Well, that's an error, I think.  That or it adds the lengths.

Luke
à

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About