core.logic

Locals not available in matche

Details

  • Type: Defect Defect
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Completed
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • Environment:
    clojure 1.2.1, core.logic 0.6.6
  • Patch:
    Code and Test

Description

Ran into an issue with the fix for LOGIC-21. Locals used inside of a matche clause were not recognized as existing and new fresh values were assigned instead.

(defn locals-membero [x l]
  (matche [l]
          ([[x . tail]])
          ([[head . tail]]
             (membero x tail))))

In the above example, x was not found in locals and a new fresh value was assigned, giving incorrect results. A fix for the issue is attached.

Activity

Hide
Ryan Senior added a comment -

Fixed typo on the locals-membero test function

Show
Ryan Senior added a comment - Fixed typo on the locals-membero test function

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: