Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on Is Scheme as good as Common Lisp?. Parent comment
(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)))))
Then you use it like
(string-case= ('("hello" "world") (lambda () (print "match"))))
[Edit: I had completely misunderstood the macro.]
There are no comments on this comment yet.
Then you use it like
I myself wouldn't use a macro for this little gain.[Edit: I had completely misunderstood the macro.]