You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 29, 2018. It is now read-only.
With the following program (tested on SBCL), there seems to be a conflict of some sort between optima's match and rutils' iter:
(ql:quickload :rutilsx)
(ql:quickload :optima)
(defpackage :bug
(:use :cl :rutilsx.iter :optima))
(in-package :bug)
(format t "result: ~a~%"
(iter
(:for i in '(1 2 3))
(:collect
(match i
(1 'x)
(2 'y)
(3 'z)))))
This will raise a condition with error message "Not pattern matching."
From the macroexpand output, it appears that the redefinition of the %fail macro inside each match code block is not working: (IF (EQL I 1) 'X (ERROR "Not pattern matching.")). I'm not very well-versed in Lisp macros; could this have something to do with the use of the symbol macro in fail.lisp, combined with use inside the body of another macro?
In any case, this was very surprising behavior and cost a bit of debugging time for me -- hopefully there's an easy fix! Thanks for the package in any case!
The text was updated successfully, but these errors were encountered:
Optima implements its failure handling (move to the next clause if it exists, or signal an error) with %fail symbol macro and (symbol-macrolet (%fail ...)) ...) which shadows the global %fail.
The problem is that Iterate always expand all macro forms in its subforms in order to find its iterate special clauses. This is done directly by macroexpand which does not consider the outer macrolets and symbol-macrolets. So this is a fundamental implementation conflict.
You can say this is a problem in Iterate. However I encourage you to move to trivia which does not use macrolet, is compatible to optima, is faster, is more extensible, and works perfectly with iterate. I designed it with this problem in mind.
With the following program (tested on SBCL), there seems to be a conflict of some sort between optima's
match
and rutils'iter
:This will raise a condition with error message "Not pattern matching."
From the
macroexpand
output, it appears that the redefinition of the%fail
macro inside each match code block is not working:(IF (EQL I 1) 'X (ERROR "Not pattern matching."))
. I'm not very well-versed in Lisp macros; could this have something to do with the use of the symbol macro infail.lisp
, combined with use inside the body of another macro?In any case, this was very surprising behavior and cost a bit of debugging time for me -- hopefully there's an easy fix! Thanks for the package in any case!
The text was updated successfully, but these errors were encountered: