News for hackers. Stuff that matters.
Re:Is Scheme as good as Common Lisp? by euccastro on Friday August 31, 2007 @07:32PM (#49042)
That only saves you one quote and one lambda for each clause, right?

  (define (string-case= my-string . clauses)
    (cond ((null? clauses) 'whatever)
          ((string-member? my-string (caar clauses))
             ((cadar clauses)))
          (else (apply string-case= 
                       my-string 
                       (cdr clauses)))))
Where string-member? is trivial to define as a procedure too.

Then you use it like

  (string-case=
    ('("hello" "world")
       (lambda () (print "match"))))
I myself wouldn't use a macro for this little gain.

[Edit: I had completely misunderstood the macro.]

There are no comments on this comment yet.