Promoting to Complex

Moritz Lenz moritz at faui2k3.org
Mon Sep 27 21:26:44 UTC 2010


aul C. Anagnostopoulos wrote:
> Should PMC functions with partial complex ranges promote their result to
> a Complex? For example, should sqrt(negative Float) produce a Complex?
> This issue does not pertain to native numbers, since we never promote
> them to PMCs.

Since parrot users are typically language implementors, I'd recommend to
 see what various dynamic languages do, which are our target.

Perl 5: dies
ruby: dies
tcl: dies
python: dies

Perl 6: NaN
javascript: NaN

common lisp: complex result
matlab: complex result


Given this quick survey, I'd argue against auto promoting - it's not
what the majority of the languages want.

Cheers,
Moritz


More information about the parrot-dev mailing list