Re: Can overloaded '+' return an array? If so, how?



[A complimentary Cc of this posting was sent to
PeterSShenkin
<shenkin@xxxxxxxxx>], who wrote in article <1156956556.295061.69620@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>:
The issue is that "combine", which is the function that '+' maps to,
returns an array. When, in the main program, I say:

my @ar = $ca1 + ca2

I expect the "combine" function to be called in list context.

Some hints: you forgot about cryptocontext. What would you think

myMultiplyArgs($ca1 + $ca2, $ca3 + $ca4, $ca5 + $ca6)

would return if your semantic would hold?

Overloading changes IMPLEMENTATION of operations; the SEMANTIC returns
the same.

(If, instead of what I do in the example, I return a reference to the
array, and alter my main routine correspondingly, then, of course,
everything works.)

Enjoy it. ;-)

Hope this helps,
Ilya
.



Relevant Pages

  • Re: ADSI script for IIS 5.0 can not run in IIS 6.0
    ... The only way to determine "why" is for someone to look at the source code. ... This posting is provided "AS IS" with no warranties, and confers no rights. ... Problem fixed by changing the array for ServerBindings from dynamic array to ...
    (microsoft.public.inetserver.iis)
  • Re: Help calling function from DLL and processing returned value (Can not marshal return value)
    ... array without a '\0' at the end of the array. ... extern "C" __declspecchar* RetAChar() ... private static extern IntPtr RetAChar(); ... This posting is provided "as is" with no warranties and confers no rights. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Comparing value with records in a shell array.
    ... as you're currently posting dsconnected text to usenet. ... the rest of your shell script. ... > exists in my array. ... remove the reference in the array and ...
    (comp.unix.shell)
  • Re: Hashed to death... help needed.
    ... Have you taken the time to read the guidelines for posting to this ... based on variables contained in an array. ... What is the purpose of this loop? ... #my @dsspdata array is now perfect to reformat into a hash analyzing the ...
    (comp.lang.perl.misc)
  • Reply: equals method
    ... Easynews to turn on posting as the Uni doesn't offer a news server, ... // Increment reference by one ... So it should be comparing adic.word with adic.word, then storing ... up until the end of the array. ...
    (comp.lang.java)