Peter Kourzanov scripsit: > Extending this to cover (case), i.e., a list of possible patterns > rather than a single pattern is a very Schemey thing to do, in > my opinion.
A match-case is a plausible idea, but it's not an upward compatible extension to case, and so should not be named "case". > eqv? is immaterial here: > > (let ([eqv? equal?]) (case "asd" (("asd") #t))) That does not mean what you think it means, for two reasons. One is that with a proper hygienic macro system, rebinding eqv? does not affect any uses of eqv? in the expansion of the case macro. The second reason is that implementations are free to make literal strings eqv? if they have the same content. > Not necessarily so. One can consider a (case) pattern to be implicitly > quasiquoted (just like traditional case is implicitly quoted). So, if > one needs "extended" (case) capabilities, one would write: > > (case 'b > ((,a) (list a))) Quoting, alas, is incompatible with quasiquoting. (,a) is just syntax sugar for ((unquote a)), which is a perfectly legitimate argument for a case arm that matches on a list eqv? to it. Somewhat unlikely that you will find such a list, but that's still what it means. > From my perspective, (case) is a degenerate case of (match) and should > be merged - we don't need two switch constructs in a simple and small > language. Note that this is a WG2 proposal, ergo not the "simple and small language". -- Real FORTRAN programmers can program FORTRAN John Cowan in any language. --Ed Post co...@ccil.org _______________________________________________ r6rs-discuss mailing list r6rs-discuss@lists.r6rs.org http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss