Peter Kourzanov <peter.kourza...@gmail.com> writes: >> > * matching numbers: we need to use (=) to match them, not equal? >> > (or eqv? and eq?) >> >> Do we? :) >> > > Typing. A good example: 42+0.0 should match both 42.0 and 42.
Note that (R6RS) syntax-case is defined to use equal? for literal pattern data: * P is a pattern datum (any nonlist, nonvector, nonsymbol datum) and F is equal to P in the sense of the equal? procedure. which reduces to `=' for two exact or two inexact values, but #f otherwise. R6RS also notes that `=' is not required to be reliable for inexact numbers. The Wright pattern-matching library uses equal? for literal pattern data, as well, as do the Racket, Chicken, and match.scm implementations. This has the advantage of providing a single rule for literal data. What is the use case for special-casing numbers? -- Jim Wise jw...@draga.com
pgppTcbeAaAiu.pgp
Description: PGP signature
_______________________________________________ r6rs-discuss mailing list r6rs-discuss@lists.r6rs.org http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss