[q-lang-users] Q 7.2 RC 1 issue 1: Nomenclature
Brought to you by:
agraef
From: John C. <co...@cc...> - 2006-06-19 18:49:42
|
I am not happy with the names of the syntactic vs. semantic number predicates. Currently it is isint, isrational, isreal, etc. for syntactic (representation) predicates, and isintnum, isratnum, iscompnum etc. for semantic (value) predicates. This is intended to be consistent with isbool, isfile, islist etc., which are syntactic; however, it is only with numbers that this dichotomy between syntactic and semantic types is really necessary. I want to argue two things: that semantic predicates are more fundamental and deserve the shorter names, and that (in the alternative) the particular names "isintnum", "isratnum", etc. are very unfortunate. Fundamentally, a number is a number, and its representation is a low-level issue. What counts is that a number actually is or is not complex, or rational, or an integer; not what its representation may be. Representations matter only when considering efficiency, which is a second-order concern in Q. It is better to use isinteger to determine if something really is an integer rather than to determine if its internal representation is a GMP integer. (By the way, does Q use any sort of fixed-width integer representation internally, or are all integers in GMP format internally? I'm just curious.) In addition, Q's numeric tower is now modeled on that of Scheme, but the names are exactly the opposite of Scheme's. In Scheme, the predicate "rational?" tests for a rational number, not for a (numerator, denominator) representation -- and the nickname for such a representation is "ratnum". So people like me who use both Scheme and Q will need to remember that the names have exactly opposite meanings in the two languages. This is regrettable. -- One Word to write them all, John Cowan <co...@cc...> One Access to find them, http://www.ccil.org/~cowan One Excel to count them all, And thus to Windows bind them. --Mike Champion |