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

Re: Semantics of vector operations (Damian)

Thread Previous | Thread Next
Luke Palmer
January 22, 2004 14:14
Re: Semantics of vector operations (Damian)
Message ID:
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.


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About