core.logic

Dynamic variables are not seen inside a logic query

Details

  • Type: Defect Defect
  • Status: Open Open
  • Priority: Major Major
  • Resolution: Unresolved
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
  • Environment:
    core.logic version 0.8.6
    clojure version 1.5.1

Description

core.logic does not work correctly with dynamic variables, as illustrated by the following code:

(def ^:dynamic dvar 'original)
(binding [*dvar* 'changed]
(logic/run* [?x] (logic/== ?x dvar)))

;;outputs (original), expected (changed)

To the best of my knowledge this used to work in older versions, although I do not know when the behaviour changed.

Activity

Hide
David Nolen added a comment -

This is because core.logic became lazy (been a year now? . There are now non lazy run variants or you can use doall yourself.

Show
David Nolen added a comment - This is because core.logic became lazy (been a year now? . There are now non lazy run variants or you can use doall yourself.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated: