>> my $plain = $c - $d : Math::Complex # 3.0 + 0i
>> sqrt(2 : Math::Integers) # -> exception or not-a-number
>Not a bad idea,. I beleive that the perl6 adjective operator
>(for functions) will be a semicolon, not a colon. I'm not
>sure how it is planned to apply it to operators.
>
>Its a
: This might be even more "Complex" than that - what if Complex can be
: reduced? Should it? for instance:
:
: my Complex $c = 3+4i;
: my Complex $d = 4i;
: my $plain = $c / $d;
:
: Does $plain (which is actually '3' after reducing) get promoted to Complex,
: or does the result from the division
> In a related matter, computer languages with Symbolic Mathematics
> capabilities, like Mapple, let you explicitly demand where do
> you want the operation to take place.
>
> This could be done naturally in perl6 using the colon meta-operator:
>
> my $plain = $c - $d : Math::Complex # 3.0 + 0
> my Complex $c = 3+4i;
> my Complex $d = 4i;
> my $plain = $c / $d;
>
> Does $plain (which is actually '3' after reducing) get promoted to
> Complex, or does the result from the division get demoted?
In a related matter, computer languages with Symbolic Mathematics
capabilities, like Mapple, le
> "W" == Wizard <[EMAIL PROTECTED]> writes:
>> my Complex $c = 3+4i;
>> my $plain = 1.1;
>> $plain = $c;
W> This might be even more "Complex" than that - what if Complex can be
W> reduced? Should it? for instance:
W> my Complex $c = 3+4i;
W> my Complex $d = 4i;
W> my $plain
"Wizard" <[EMAIL PROTECTED]> writes:
> This came up on perl6-internals, and Dan liked the "try" suggestion and
> suggested That I post it here for comments. I'm not subscribed to
> p6-language, so you'll need to include me in any replies where you want a
> response from me.
> =
This came up on perl6-internals, and Dan liked the "try" suggestion and
suggested That I post it here for comments. I'm not subscribed to
p6-language, so you'll need to include me in any replies where you want a
response from me.
=
Dave M