m2ym/optima

Indigestible pattern

Closed this issue · 3 comments

(defun ouch ()
  (let ((x '(:blue "http://a.b/" :end-color
             :brown "*" :end-color :green "x" :end-color :brown "*" :end-color
             "(+14) "
             :teal "yeah" :end-color)))
    (match x
      (`(:blue ,diff-url :end-color
               :brown "*" :end-color :green ,user-name :end-color :brown "*" :end-color
               ,diff-description
               :teal ,comment :end-color)
        (print diff-description))
      (t
       (print x)))))

Never finishes compiling. This was reduced down from a larger example. If I remove the token :blue it works.

Here are three example backtraces to give somebody in the know a hint as to what got stuck.

  0: (optima::lift-guard-patterns-1 0)
  1: (optima::lift-guard-patterns (cons comment '(:end-color)))
  2: (optima::lift-guard-patterns-1 (cons :teal (cons comment '(:end-color))))
  3: (optima::lift-guard-patterns (cons :teal (cons comment '(:end-color))))
  0: (optima::lift-guard-patterns-1 (cons comment '(:end-color)))
  1: (optima::lift-guard-patterns (cons comment '(:end-color)))
  2: (optima::lift-guard-patterns-1 (cons :teal (cons comment '(:end-color))))
  0: (ccl::some-xx-one #<class-cell for optima::complex-pattern #x30200132964D> nil #<Compiled-function optima::guard-pattern-p #x3020013278AF> (:end-color ..))
  1: (optima::lift-guard-patterns-1 (cons :end-color (cons diff-description (cons :teal (cons comment '#)))))
  2: (optima::lift-guard-patterns (cons :end-color (cons diff-description (cons :teal (cons comment '#)))))
m2ym commented

Can you reproduce with SBCL?

Good news. The problem arises only if the fare-quasiquote readtable is not active. Now of course it still ought not get stuck. But now the problem is less aweful and I think you could close this.

Reguarding your question. If we try this in sbcl (or ccl) with fare's readtable it works. In sbcl without the readtable the sbcl compiler complains about missing functions, with odd names. I didn't investigate further, since my problem is resolved.

m2ym commented

Okay.