So, I've been looking more closely at Perl's native value types and associated roles, and there are a few matters of their naming or availability that I have questions or suggestions on.

1. As a general observation, I note that it is a common pattern for basic Perl 6 value types that a role for the concept is written out as the whole name, such as "Boolean" or "Rational" or "Integral" or "String" etc, and the primary Perl type composing that is an abbreviation thereof, "Bool" or "Rat" or "Int" or "Str" etc.

2. There doesn't seem to be a role for "complex" as there is for "integer" or "rational" or "real" or "numeric". So, if the boxed Perl complex number is called "Complex" and the machine native one is called "complex" or "complex128" or whatever, what would one name the role that is common to all of these?

Note that I wouldn't necessarily consider "Numeric" to be the answer because I would consider "Numeric" more broad, such as to include anything that might conceivably be called a number, probably user-defined, that isn't representable by a "complex".

So, is current thinking that "Numeric" is supposed to fill the role I mentioned, or is it meant to be broader than that, in which case do we need a "complex" role.

If we should have a "complex" role, then what would we name it?

Following the above pattern, you'd think that "Complex" would be best used as th role name and so something else is needed for the type, either as some abbreviation, or alternately with additions.

Conceivably one could have a complex type defined in terms of any combination of the various real or rational or integer types, such as "NumComplex" or "RatComplex" (and "FatRatComplex") and "IntComplex" etc.

So I suggest making a "Complex" role and splitting the old "Complex" type at least into the distinct "[Num|Rat|FatRat]Complex" types I mentioned.

For the integer version, my understanding is that number theory already provides a suitable term, "Gaussian integer", which is a complex number whose real and imaginary parts are both integers.

So I suggest using "Gaussian" as the name option for an "IntComplex".

Or maybe better yet for completion sake, make "Gaussian" a role and something like "Gaus" the type or something.

Alternately, while we would still need a Complex-specific role, we could possibly avoid a need to explicitly declare some of the composing types if Complex is parameterizable, as AFAIK Rational et al are parameterizable.

What do you think?

3. I notice that some roles that are longer forms of type names look like nouns, while others look like adjectives. I suppose that adjectives are what you're going after, and the ones that look like nouns such as "Boolean" and "Rational" and "Real" are also adjectives. On the other hand, lots of roles are surely just nouns, such as "Failure" and "Routine".

So a question I have is, given the context, is "Integral" the best name for that role, or would "Integer" be better?

From some quick searching around, the term "integral" doesn't seem to be used a lot in literature for the meaning you're ascribing, and "integer" seems to be much more common, when referring to these things.

That is, unless you're specifically going for "integral domain" as what Integral is meant to cover. Is that it?

So is there a specific reason or three that Integral is better than Integer or is it really a wash? Is anyone opposed to renaming Integral to Integer?

Besides my inclination to think that some roles are better off looking like nouns when possible, it seems that most literature searches for the term "integral" bring up calculus operations, such as integration is seemingly a much more commonly used interpretation of the term "integral", and so "integer" may lessen confusion there. Maybe.

-- Darren Duncan

Reply via email to