I'd love to see a Belgian Clojure meetup! I'm from Antwerp.
Kind regards,
Frederik
--
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
Hey,
I'm trying to combine maps with finite domains with some odd results.
A simple query using finite domains correctly returns all values:
(run* [q]
(fresh [x]
(infd x (interval 1 3))
(== q x)))
;= (1 2 3)
But putting this result in a map returns only the first value:
(run* [q]
FYI this works with vectors:
(run* [q]
(fresh [x]
(infd x (interval 1 3))
(== q [x])))
;= ([1] [2] [3])
But lcons seems to fail as well:
(run* [q]
(fresh [x]
(infd x (interval 1 3))
(== q (lcons x 'foo
;= ((1 . foo))
Kind regards,
Frederik
--
You received this
I had some trouble because all goals need to take in the list of lvars.
`infd` doesn't take in a list, but your sudoku blog post has `all-infd`
which does the trick:
(defn all-infd
Assign a domain to all vars.
[vars domain]
(if (seq vars)
(all
(domfd
+ 1 for Light Table. The instarepl is a very useful tool for learning and
exploring Clojure.
F
Op zondag 25 november 2012 22:00:36 UTC+1 schreef René Groß het volgende:
You could consider lighttable by chris granger as well. It is at a very
early stage, but pretty much usable for hacking
Using core.logic, I sometimes have the need to create a variable number of
fresh lvars.
For example, I want to create all possible combinations of n numbers
between min and max. Currently the only way I found how to do this was
building the expression and evalling it:
(defn generate-symbols
Hey David,
I don't quite understand how I would apply your suggestion this with my
example.
1. So the all function creates a choice point. How do I create lvars? I
tried:
(run* [q]
(let [vars (repeatedly 3 #(gensym 'x))]
(all
(== q vars
;= ((x4388 x4389 x4390))
Shouldn't I
Just use a different namespace.
Thanks! That did the trick.
Regards,
Frederik
--
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
Hi,
I'm trying to use core.logic using the following namespace expression
(modelled on core.logic's own test file):
(ns user
(:refer-clojure :exclude [==])
(:use clojure.core.logic))
However, this gives the following warning:
WARNING: == already refers to: