Skip to content

Using core.logic with ClojureScript

swannodette edited this page Mar 30, 2012 · 5 revisions

Differences from core.logic in Clojure

Basic core.logic works with ClojureScript. Some things that work in Clojure have not yet been implemented for ClojureScript including the following:

  • disequality constraints
  • tabling
  • facts / rels
  • simple unifier

Using core.logic from ClojureScript

Using core.logic from ClojureScript requires doing a little bit more work as there are a large number of macros in addition to runtime functionality.

(ns example
  (:require-macros [cljs.core.logic.macros :as m])
  (:use [cljs.core.logic :only [membero]]))

(m/run* [q]
  (membero q '(:cat :dog :bird :bat :debra)))