On Mon, Apr 18, 2005 at 12:15:34PM +0200, Leopold Toetsch wrote:
> Below is some stuff, which I'm unsure of how it should be implemented 
> eventually. Input is highly welcome.


> TODO items and design issues
> 
> 1) bitwise or, and, xor
> 
> We currently have two distinct sets of opcodes and MMD functions for
> numeric (i.e. integer) and string bitwise functionality. E.g.
> 
>   bor Px, Py        # $x +|= $y
>   bors Px, Py, Pz   # $x = $y ~| $z
> 
> It now depends on the Perl6 code generator how the Parrot
> implementation should behave (or vice versa :)
> 
> a) just do MMD
> 
>   Px = Px.__as_number()    # numeric context
>   $P1 = Py.__as_number()
>   bor Px, $P1              # MM dispatch on <Int, Int>
> 
>   $P0 = Py.__as_string()   # string context
>   $P1 = Pz.__as_string()
>   bor Px, $P0, $P1         # MM dispatch on <Str, Str>
> 
> b) use current distinct opcodes
> 
>   bor Px, Py               # call get_integer() internally
> 
>   bors Px, Py, Pz          # call get_string() internally
> 
> If a) is true, we would have just one set of bitwise MMD functions.
> If b) is true, then there is no MMD needed as the functionality is
> always the same: make numeric/string and do the bitwise operation.
> This would be better implemented with a vtable method.

This all got Warnocked, didn't it?

Having read it twice, I don't think I'm going to get closer to a decent
response than "er, this is really a call for the designer to make, isn't it?"

Nicholas Clark

Reply via email to