match   scheme


Defined in:  https://github.com/digego/extempore/tree/v0.8.9/libs/core/pattern.xtm

Implementation

;; returns #f if failed match
;; returns a list of matched variables (or null if no variable names specified.)
(define match
  (lambda (em)
    (lambda (e)
      (let* ((res (match-expr e em))
            (pairs (if (null? res) '()
                      (map (lambda (x) 
                              (if (vector? x)
                                  (vector->list x)
                                  x))
                            res))))
        (if (tree-member MATCH-FAILED res) 
            #f 
            pairs)))))


Back to Index

Similar Entries

  • MATCH-FAILED    scheme
  • MATCH-TRUE    scheme
  • ai_find_matching_node    xtlang
  • check-for-literal-match    scheme
  • custom-match    scheme
  • get-matching-length    scheme
  • get-true-matches    scheme
  • impc:compiler:print-type-mismatch-error    scheme
  • impc:ir:genericfunc-match-closure-types    scheme
  • impc:ir:genericfunc-match-tuple-types    scheme
  • impc:ti:descending-generic-type-match    scheme
  • impc:ti:generic-types-matchup?    scheme
  • impc:ti:nativef-poly-check-match-ftypes    scheme
  • impc:ti:polytype-match?    scheme
  • is-match-multi?    scheme
  • literal-match?    scheme
  • literal-match?    scheme
  • match-check-variable    scheme
  • match-check-variable-predicates    scheme
  • match-expr    scheme
  • match-list    scheme
  • match-number    scheme
  • match-pair    scheme
  • match-result:bind    scheme
  • match-result:get    scheme
  • match-result:make    scheme
  • match-result:variables    scheme
  • match-string    scheme
  • match-symbol    scheme
  • match-vector    scheme
  • match_aiString    xtlang
  • matcher:make    scheme
  • matcher:proc    scheme
  • matcher:type    scheme
  • matcher:variables    scheme
  • p:assert-match    scheme
  • p:if-matches    scheme
  • p:match    scheme
  • p:matcher    scheme
  • p:matches?    scheme
  • regex_match    xtlang
  • regex_match    xtlang
  • regex_match    xtlang
  • regex_match    xtlang
  • regex_matches    xtlang
  • regex_matches    xtlang
  • regex_matches    xtlang
  • regex_matches    xtlang
  • regex_matches    xtlang
  • regex_matches    xtlang