Hey Derek- Your datascript query is actually returning a set- syntax is #{}- of array elements, also called "tuples". You can treat the set as a sequence, use doseq to visit each item, and destructuring on the items to assign individual array/tuple members to symbols.
For instance, say that each array item has 2 elements, which semantically you think of as name and value. You can do something like this: (let [results (d/q q-list @conn)] (doseq [[name value] results] (println (str "name: " name " has value: " value)))) Does that help? Jonah On Tue, Feb 16, 2016 at 11:38 AM, Derek Frost <derekfro...@gmail.com> wrote: > I need some advice about return values please. I'm using Datascript on > the console with clojure and I'm doing this to get values from the d/b > (println(d/q q-list @conn)) which gives me a hash-map of arrays. I'm > trying to put values in a text file to convert to pdf - this is a bit mad > but it's just to see if I can move some stuff away from xslt. Well I can > get at individual values doing something like this (def > -main[](println(first(d/q etc...)))) but it seems really messy. When I try > to do this in a let block I get arity problems and I also tried passing > this to a str then to the third argument of spit to create a text file. > Ideally I'm trying to format the output with newlines which I know how to > do but I can't figure out how to nest the d/b results into a variable. > > So my question is, is there a nicer way of putting my bulk return values > into a variable? If I could do that, I think I could figure the rest out. > Many thanks. I'm relatively new to clojure but I have some experience in > scheme and lisp... > > -- > 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 > --- > 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 clojure+unsubscr...@googlegroups.com. > 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 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 --- 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 clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.