FAQ
Hi list,

I have a PailTap generating tuples. I'd like to get a generator from it
with individual fields :

(gen ?timestamp ?type ?data)

Of course, I have the following that works :


(defn- deconstruct-datalog [datalog]
   (let [date (.getDate datalog)
         type (.getType datalog)
         map (into {} (.getMap datalog))]
     [date type map]))

(defn make-generator-datalog
   [lines]
   (<- [?timestamp ?type ?data]
       (lines ?line)
       (deconstruct-datalog ?line :> ?timestamp ?type ?data)))


with getDate, getType, etc being implemented in my Pail data type.

BUT, I have now several types of pails and this is becoming very painful tu
manage a make-generator for all my types.

I'd like to implement something like this (this does not work) :

(defn- make-tuple [t]
(.getAsTuple t))

(defn make-generator-anytype
   [lines]
   (<- ?outvars
       (lines ?line)
       (make-tuple ?line :> ?outvars)))


with getAsTuple implemented in my Pail data type, outputting a vector.


Does this make sense ? can I have a dynamic out-vars created depending on
my datatype ?


--
*
Philippe*

--
You received this message because you are subscribed to the Google Groups "cascalog-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cascalog-user+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

Discussion Posts

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 4 | next ›
Discussion Overview
groupcascalog-user @
categoriesclojure, hadoop
postedJun 17, '13 at 12:50a
activeJun 18, '13 at 1:32p
posts4
users3
websiteclojure.org
irc#clojure

People

Translate

site design / logo © 2021 Grokbase