Created
March 28, 2011 03:04
-
-
Save anonymous/889943 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<amalloy> (doc condp) ; no truncation! | |
<sexpbot> ⟹ "Macro ([pred expr & clauses]); Takes a binary predicate, | |
an expression, and a set of clauses. Each clause can take the form of | |
either: test-expr result-expr test-expr :>> result-fn Note :>> is an | |
ordinary keyword. For each clause, (pred test-expr expr) is evaluated. | |
If it returns logical true, the clause is a match. If a binary clause | |
matches, the result-expr is returned, if a ternary clause matches, its | |
result-fn, which must be a unary function, is called with the result | |
of the predicate as its argument, the result of that call being the | |
return value of condp. A single default expression can follow the | |
clauses, and its value will be returned if no clause matches. If no | |
default expression is provided and no clause matches, an | |
IllegalArgumentException is thrown." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment