Uploaded image for project: 'core.match'
  1. MATCH-125

Keyword literal as function apply(:<<) result

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Labels:
      None
    • Environment:

      [org.clojure/clojure "1.9.0-beta2"]
      [org.clojure/core.match "0.3.0-alpha5"]

      Description

      Fails:

      (let [x [:k1 :k2 :k3]]
        (m/match [x]
                 [(:k1 :<< first)] :first))
      
      Invalid list syntax :<< in (:k1 :<< first). Valid syntax:
         [[:default :guard] [:or :default] [:default :only] [:default :seq]
         [:default :when] [:default :as] [:default :<<] [:default
         :clojure.core.match/vector]]
      

      Work:

      (let [k1 :k1
            x [:k1 :k2 :k3]]
        (m/match [x]
                 [(k1 :<< first)] :first))
      

      Is it a bug or a feature?
      How to match keywords correctly?

        Attachments

          Activity

            People

            • Assignee:
              dnolen David Nolen
              Reporter:
              alex+import import
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated: