Alright, that makes sense.  I suppose that since facts are represented 
under the hood as relations, anyways, that this might work.  Thanks.

On Saturday, 28 July 2012 21:52:46 UTC-4, David Nolen wrote:
>
> On Sat, Jul 28, 2012 at 8:53 PM, JvJ <kfjwhee...@gmail.com> wrote: 
> > I'm having trouble translating some Prolog code to core.logic. 
> > 
> > In particular, I'd like to do something like this: 
> > 
> >> 2 ?- assert(a(b)). 
> >> true. 
> >> 3 ?- assert(a(a(b))). 
> >> true. 
> >> 4 ?- a(X). 
> >> X = b ; 
> >> X = a(b). 
> >> 5 ?- a(a(X)). 
> >> X = b. 
>
> While there is no direct translation as far as I can see, something 
> like the following accomplishes pretty much the same thing: 
>
> (defne foo [x] 
>   ([[:a :b]]) 
>   ([[:a [:a :b]]])) 
>
> (run* [q] 
>   (foo [:a q])) 
> ;; => (:b [:a :b]) 
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to