GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing clojure.github.io — clojure.core.match - core.match 1.1.1-SNAPSHOT API documentation API for clojure.core.match - core.match 1.1.1-SNAPSHOT (in development)Full namespace name: clojure.core.match OverviewProject home page is https://github.com/clojure/core.match/
TypesAppPatterntypeFields: [p form _meta] Protocols: clojure.core.match.protocols/ISpecializeMatrix Interfaces: clojure.core.match.protocols.IPseudoPattern, clojure.lang.ILookup, clojure.lang.IObj BindNoderecordFields: [bindings node] Protocols: clojure.core.match.protocols/INodeCompile Interfaces: clojure.lang.IHashEq, clojure.lang.IKeywordLookup, clojure.lang.ILookup, clojure.lang.IObj, clojure.lang.IPersistentMap, java.io.Serializable, java.util.Map FailNoderecordFields: [] Protocols: clojure.core.match.protocols/INodeCompile Interfaces: clojure.lang.IHashEq, clojure.lang.IKeywordLookup, clojure.lang.ILookup, clojure.lang.IObj, clojure.lang.IPersistentMap, java.io.Serializable, java.util.Map GuardPatterntypeFields: [p gs _meta] Protocols: clojure.core.match.protocols/IPatternCompile, clojure.core.match.protocols/ISpecializeMatrix Interfaces: clojure.lang.ILookup, clojure.lang.IObj LeafNoderecordFields: [value bindings] Protocols: clojure.core.match.protocols/INodeCompile Interfaces: clojure.lang.IHashEq, clojure.lang.IKeywordLookup, clojure.lang.ILookup, clojure.lang.IObj, clojure.lang.IPersistentMap, java.io.Serializable, java.util.Map LiteralPatterntypeFields: [l _meta] Protocols: clojure.core.match.protocols/IPatternCompile Interfaces: clojure.lang.ILookup, clojure.lang.IObj MapKeyPatternrecordFields: [p] Protocols: clojure.core.match.protocols/IPatternCompile, clojure.core.match.protocols/ISpecializeMatrix Interfaces: clojure.core.match.protocols.IExistentialPattern, clojure.lang.IHashEq, clojure.lang.IKeywordLookup, clojure.lang.ILookup, clojure.lang.IObj, clojure.lang.IPersistentMap, java.io.Serializable, java.util.Map MapPatterntypeFields: [m _meta] Protocols: clojure.core.match.protocols/IPatternCompile, clojure.core.match.protocols/ISpecializeMatrix Interfaces: clojure.lang.ILookup, clojure.lang.IObj OrPatterntypeFields: [ps _meta] Protocols: clojure.core.match.protocols/ISpecializeMatrix Interfaces: clojure.core.match.protocols.IPseudoPattern, clojure.lang.ILookup, clojure.lang.IObj PatternMatrixrecordFields: [rows ocrs] Protocols: clojure.core.match.protocols/IVecMod Interfaces: clojure.lang.IHashEq, clojure.lang.IKeywordLookup, clojure.lang.ILookup, clojure.lang.IObj, clojure.lang.IPersistentMap, java.io.Serializable, java.util.Map PatternRowtypeFields: [ps action bindings] Protocols: clojure.core.match.protocols/IVecMod Interfaces: clojure.lang.Associative, clojure.lang.IFn, clojure.lang.ILookup, clojure.lang.IPersistentCollection, clojure.lang.ISeq, clojure.lang.Indexed PredicatePatterntypeFields: [p gs _meta] Protocols: clojure.core.match.protocols/IPatternCompile, clojure.core.match.protocols/ISpecializeMatrix Interfaces: clojure.lang.ILookup, clojure.lang.IObj RestPatternrecordFields: [p] Protocols: Interfaces: clojure.lang.IHashEq, clojure.lang.IKeywordLookup, clojure.lang.ILookup, clojure.lang.IObj, clojure.lang.IPersistentMap, java.io.Serializable, java.util.Map SeqPatterntypeFields: [s _meta] Protocols: clojure.core.match.protocols/IPatternCompile, clojure.core.match.protocols/ISpecializeMatrix Interfaces: clojure.lang.ILookup, clojure.lang.IObj SwitchNoderecordFields: [occurrence cases default] Protocols: clojure.core.match.protocols/INodeCompile Interfaces: clojure.lang.IHashEq, clojure.lang.IKeywordLookup, clojure.lang.ILookup, clojure.lang.IObj, clojure.lang.IPersistentMap, java.io.Serializable, java.util.Map VectorPatterntypeFields: [v t size offset rest? _meta] Protocols: clojure.core.match.protocols/IContainsRestPattern, clojure.core.match.protocols/IPatternCompile, clojure.core.match.protocols/ISpecializeMatrix, clojure.core.match.protocols/IVectorPattern Interfaces: clojure.lang.ILookup, clojure.lang.IObj WildcardPatterntypeFields: [sym named _meta] Protocols: Interfaces: clojure.lang.ILookup, clojure.lang.IObj Public Variables and Functions*vector-type*dynamic varDefault vector type. Can be rebound allowing emission of custom inline code for vector patterns, for example type-hinted primitive array operationsSource ->AppPatternfunctionUsage: (->AppPattern p form _meta) Positional factory function for class clojure.core.match.AppPattern.Source ->BindNodefunctionUsage: (->BindNode bindings node) Positional factory function for class clojure.core.match.BindNode.Source ->FailNodefunctionUsage: (->FailNode) Positional factory function for class clojure.core.match.FailNode.Source ->GuardPatternfunctionUsage: (->GuardPattern p gs _meta) Positional factory function for class clojure.core.match.GuardPattern.Source ->LeafNodefunctionUsage: (->LeafNode value bindings) Positional factory function for class clojure.core.match.LeafNode.Source ->LiteralPatternfunctionUsage: (->LiteralPattern l _meta) Positional factory function for class clojure.core.match.LiteralPattern.Source ->MapKeyPatternfunctionUsage: (->MapKeyPattern p) Positional factory function for class clojure.core.match.MapKeyPattern.Source ->MapPatternfunctionUsage: (->MapPattern m _meta) Positional factory function for class clojure.core.match.MapPattern.Source ->OrPatternfunctionUsage: (->OrPattern ps _meta) Positional factory function for class clojure.core.match.OrPattern.Source ->PatternMatrixfunctionUsage: (->PatternMatrix rows ocrs) Positional factory function for class clojure.core.match.PatternMatrix.Source ->PatternRowfunctionUsage: (->PatternRow ps action bindings) Positional factory function for class clojure.core.match.PatternRow.Source ->PredicatePatternfunctionUsage: (->PredicatePattern p gs _meta) Positional factory function for class clojure.core.match.PredicatePattern.Source ->RestPatternfunctionUsage: (->RestPattern p) Positional factory function for class clojure.core.match.RestPattern.Source ->SeqPatternfunctionUsage: (->SeqPattern s _meta) Positional factory function for class clojure.core.match.SeqPattern.Source ->SwitchNodefunctionUsage: (->SwitchNode occurrence cases default) Positional factory function for class clojure.core.match.SwitchNode.Source ->VectorPatternfunctionUsage: (->VectorPattern v t size offset rest? _meta) Positional factory function for class clojure.core.match.VectorPattern.Source ->WildcardPatternfunctionUsage: (->WildcardPattern sym named _meta) Positional factory function for class clojure.core.match.WildcardPattern.Source emit-matrixfunctionUsage: (emit-matrix vars clauses)
(emit-matrix vars clauses default)
Take the list of vars and sequence of unprocessed clauses and return the pattern matrix. The pattern matrix contains the processed pattern rows and the list of vars originally specified. Inserts a last match - :else if provided by the user or a default match that throws.Source emit-patternmultimethodNo usage documentation available Returns the corresponding pattern for the given syntax. Dispatches on the class of its argument. For example, `[(:or 1 2) 2]` is dispatched as clojure.lang.IPersistentVectorSource emit-pattern-for-syntaxmultimethodNo usage documentation available Handles patterns wrapped in the special list syntax. Dispatches on the first or second keyword in the list. For example, the pattern `(:or 1 ...) is dispatches as :or, and `(1 :as a)` is dispatched by :as.Source empty-rows-casefunctionUsage: (empty-rows-case) Case 1: If there are no pattern rows to match, then matching always failsSource first-column-chosen-casefunctionUsage: (first-column-chosen-case matrix col ocrs) Case 3a: The first column is chosen. Compute and return a switch/bind node with a default matrix caseSource first-row-empty-casefunctionUsage: (first-row-empty-case rows ocr) Case 2: If the first row is empty then matching always succeeds and yields the first action.Source first-row-wildcards-casefunctionUsage: (first-row-wildcards-case rows ocrs) Case 2: If the first row is constituted by wildcards then matching matching always succeeds and yields the first action.Source group-keywordsfunctionUsage: (group-keywords pattern) Returns a pattern with pattern-keywords (:when and :as) properly grouped. The original pattern may use the 'flattened' syntax. For example, a 'flattened' pattern row like [a b :when even?] is grouped as [a (b :when even?)].Source groupable?multimethodNo usage documentation available Determine if two patterns may be grouped together for simultaneous testing.Source map->BindNodefunctionUsage: (map->BindNode m#) Factory function for class clojure.core.match.BindNode, taking a map of keywords to field values.Source map->FailNodefunctionUsage: (map->FailNode m#) Factory function for class clojure.core.match.FailNode, taking a map of keywords to field values.Source map->LeafNodefunctionUsage: (map->LeafNode m#) Factory function for class clojure.core.match.LeafNode, taking a map of keywords to field values.Source map->MapKeyPatternfunctionUsage: (map->MapKeyPattern m#) Factory function for class clojure.core.match.MapKeyPattern, taking a map of keywords to field values.Source map->PatternMatrixfunctionUsage: (map->PatternMatrix m#) Factory function for class clojure.core.match.PatternMatrix, taking a map of keywords to field values.Source map->RestPatternfunctionUsage: (map->RestPattern m#) Factory function for class clojure.core.match.RestPattern, taking a map of keywords to field values.Source map->SwitchNodefunctionUsage: (map->SwitchNode m#) Factory function for class clojure.core.match.SwitchNode, taking a map of keywords to field values.Source matchmacroUsage: (match vars & clauses) Pattern match a row of occurrences. Take a vector of occurrences, vars.
Clause question-answer syntax is like `cond`. Questions must be
wrapped in a vector, with same arity as vars. Last question can be :else,
which expands to a row of wildcards. Optionally may take a single
var not wrapped in a vector, questions then need not be wrapped in a
vector.
Example:
(let [x 1
y 2]
(match [x y 3]
[1 2 3] :answer1
:else :default-answer))
Source
matchmmacroUsage: (matchm vars & clauses) Same as match but supports IMatchLookup when matching maps.Source other-column-chosen-casefunctionUsage: (other-column-chosen-case matrix col) Case 3b: A column other than the first is chosen. Swap column col with the first column and compile the resultSource process-varsfunctionUsage: (process-vars vars) Process the vars for the pattern matrix. If user provides an expression, create a var and annotate via metadata with the original expression.Source to-pattern-rowfunctionUsage: (to-pattern-row pat action) Take an unprocessed pattern expression and an action expression and return a pattern row of the processed pattern expression plus the action epxression.Source to-sourcemultimethodNo usage documentation available Returns a Clojure form that, when executed, is truthy if the pattern matches the occurrence. Dispatches on the `type` of the pattern. For instance, a literal pattern might return `(= ~(:pattern pattern) ~ocr)`, using `=` to test for a match.Source wildcards-and-duplicatesfunctionUsage: (wildcards-and-duplicates patterns) Returns a vector of two elements: the set of all wildcards and the set of duplicate wildcards. The underbar _ is excluded from both.Source clojure.core.match.javaPublic Variables and Functionsbean-matchmacroUsage: (bean-match class) Generate an implementation of match.core/IMatchLookup for a Java bean. Accessor method names are mapped to keys like this: isVisible -> :visible? getText -> :text getAbsolutePath -> :absolute-path isFUD -> :fud? getFUDFactor -> :fud-factorSource clojure.core.match.protocolsProtocolsIMatchLookupProtocolAllows arbitrary objects to act like a map-like object when pattern matched. Avoid extending this directly for Java Beans, see `match.java/bean-match`.Known implementations: clojure.lang.ILookup, java.util.Date val-atfunctionUsage: (val-at this k not-found) clojure.core.match.regexTypesRegexPatternrecordFields: [regex] Protocols: Interfaces: clojure.lang.IHashEq, clojure.lang.IKeywordLookup, clojure.lang.ILookup, clojure.lang.IObj, clojure.lang.IPersistentMap, java.io.Serializable, java.util.Map Public Variables and Functions->RegexPatternfunctionUsage: (->RegexPattern regex) Positional factory function for class clojure.core.match.regex.RegexPattern.Source map->RegexPatternfunctionUsage: (map->RegexPattern m#) Factory function for class clojure.core.match.regex.RegexPattern, taking a map of keywords to field values.Source Copyright 2007-2023 by Rich Hickey and the various contributors
Logo & site design by Tom Hickey.
Clojure auto-documentation system by Tom Faulhaber. |
| You are visitor 01402520 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |