This is what the `featurec` constraint is for. David
On Fri, Jan 2, 2015 at 9:47 AM, rogergl <[email protected]> wrote: > I have the following simple core.logic snippet: > > (def my-data [ > {:name 'peter > :some-data { > :some-value: 42 > } > :sales 1200 > :age 32} > {:name 'paul > :sales 200 > :age 42} > {:name 'mary > :sales 200 > :age 32}]) > > > (defn get-result [data max-results] > (run max-results [q] > (fresh [?sales ?name ?age ?pm] > (featurec ?pm {:age ?age :name ?name :sales ?sales} ) > (conde > [(fd/> ?sales 200)] > [(fd/> ?age 32)] > ) > (== q [?name ?age]) > (membero ?pm data)))) > > (get-result my-data 1) > > The question is. How would I access some-value inside some-data ? > > BTW: is it possible to pass the conde arguments as arguments to the > get-result function ? > > Regards > Roger > > -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To post to this group, send email to [email protected] > Note that posts from new members are moderated - please be patient with your > first post. > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/clojure?hl=en > --- > You received this message because you are subscribed to the Google Groups > "Clojure" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to [email protected] Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
