core.match

Exception thrown when matching using :seq when there is a seq call in the tail of the occurrences

Details

  • Type: Defect Defect
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Completed
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
  • Environment:
    with Clojure 1.3

Description

The following match throws:

(let [q '(a) y '(b) z '(c)]
  (match [q (seq y) z]
    [([_] :seq) _ _] 'a
    [_ _ _] 'b))

Looking at the macro expansion there's something clearly wrong simply with the fact that the seq expression occurs in multiple places instead of just at the beginning of the macro expansion.

Activity

Hide
Emma Tosch added a comment -

https://gist.github.com/626088b01817ac638fae
Two expressions, macro-expanded. The only difference between the expressions is that the second occurrence in the second expression is seq'ed. The second let is the one throwing the exception; it's the one with the binding

(clojure.core/let [q_tail_3472 q_tail_3472
q_head_3471 q_head_3471
ocr-3470 (seq y)
z z]
...)

Show
Emma Tosch added a comment - https://gist.github.com/626088b01817ac638fae Two expressions, macro-expanded. The only difference between the expressions is that the second occurrence in the second expression is seq'ed. The second let is the one throwing the exception; it's the one with the binding (clojure.core/let [q_tail_3472 q_tail_3472 q_head_3471 q_head_3471 ocr-3470 (seq y) z z] ...)

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: