ISSUE: Numeric AS unspecified REVISION HISTORY: Rob MacLachlan, 18 February 94 STATUS: open RELATED ISSUES: CATEGORY: clarification PROBLEM DESCRIPTION: The book says that AS may be used to convert between numeric types, but many numeric type conversions have no obvious definition. For example, how is the result rounded on conversion from to . No numeric AS methods are specified, which might lead some readers to suppose that any type can be coerced to any other. Some implementors might not implement all these methods, or since there is no natural semantics, might implement different semantics. PROPOSAL: Only these numeric coercions are defined by Dylan: Generalized instances of: To these classes: Generalized instances of: To these classes: In other words, AS only coverts to floats and between float formats. RATIONALE: AS should not be redundant with explicit coercion functions such as TRUNCATE, especially where it is apt to be ambiguous, such as coercing ratios or floats to integers. to conversion is not allowed since this is redundant with RATIONALIZE. Coercion of a non-float to will coerce the number to an implementation-defined subclass of . AMENDMENT: Delete RATIONALIZE, require an AS method that converts generalized instances of to rationals. EXAMPLES: These examples are now clearly illegal: as(, 42e0) as(, some-ratio) These examples are now clearly legal: as(, 42) as(, some-ratio) COST TO IMPLEMENTORS: COST TO USERS: PERFORMANCE IMPACT: none BENEFITS: Defines an excessively vague part of the language. Improves portability. AESTHETICS: FUTURE FEATURES: If additional integer types with overlapping ranges are ever added, they would probably also be coerced by AS.