Re: Error running Clojure 1.3 on OSX 10.6.8

2011-11-28 Thread Chris Perkins
It looks like those instructions are a bit out of date.  The download does 
not contain a clojure.jar - it contains clojure-1.3.0.jar.

Just put that after -cp, and it should work.

- Chris

-- 
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

Re: Clojure on PyPy

2011-11-28 Thread Timothy Baldridge
 IMO better to hack on VMKit (llvm) than to start a new one atop of PyPy.

Seeing as VMkit is a method level jit, and PyPy creates tracing JITs,
basing a JVM off of VMKit to run clojure on it kindof defeats the
whole purpose.

Timothy

-- 
“One of the main causes of the fall of the Roman Empire was
that–lacking zero–they had no way to indicate successful termination
of their C programs.”
(Robert Firth)

-- 
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


Re: Problem with Korma and clj-soap

2011-11-28 Thread Dennis Crenshaw
Eeyup, that seems to do the trick! It complains about proper initialization
and Axis2 no longer logs to stdout, but I can serve soap again!

I now just need to find a way to harmonize the logging from Korma and the
logging that Axis2 provides. But that's an exercise left to the OP. :)

Thanks for your help everyone, I hope your holidays are pleasant!

-- 
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

Re: Problem with Korma and clj-soap

2011-11-28 Thread Dennis Crenshaw
For the for the record and in case anyone has run into something similar,
I've fixed my problem and come to an understanding of it's nature...

First, the why:

As it turns out, Axis2, et. al defaults to yelling on the DEBUG log4j level
for it's activity logs. Thus, if the root appender says DEBUG is the
default log level, Axis2 proceeds to constantly dump logs out to console.
It seems broken in that state and no programmer in their right mind will go
and try to digest a WSDL when the console is filling up with hundreds of
lines of DEBUG spewing out with what looks like stack-traces. So the real
answer was, I should have ignored the screaming logs and tried things
anyway.

You can fix it two ways, both of which involve providing your own log4j.xml:

1) You can set root log level to anything above DEBUG (INFO, for example.)

2) You can add two new loggers to contain the screaming server logs:
org.apache.axis2 and org.apache.axiom at, again at any log level above
DEBUG.

Hope this helps!

-- 
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

Can we make implements? public

2011-11-28 Thread Brent Millare
I need to verify if an object implements a protocol. Looking at the source 
code, I noticed that protocol objects act as a map, and has the key :impls. 
From this is a map I can look up a class to see if there are functions. The 
resulting code is:

(defn implements? [protocol obj]
  (boolean ((:impls protocol) (class obj

The problem with this is this relies on implementation details. I would 
like to do this safely. I noticed that in clojure.core there is a private 
function implements?. This appears to do what I want. Is it possible to 
make this public? What is the motivation for keeping it private?

-- 
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

Re: Using Clojure on a Mac

2011-11-28 Thread Kula
i recommend the brew tool

you can try it on website https://*github*.com/mxcl/home*brew*


and try to brew install clojure .

then you got it.


On Sun, Nov 27, 2011 at 14:15, Clojure NewB cappy2...@gmail.com wrote:


 Hi,

 I've just installed Clojure 1.3 on a MBP, OSX  10.6.8.

 After unzipping the download, I'm left with a directory with a few .jar
 files and two subdirectories.
 (I'm also a Java newb too)

 How do I run Clojure?


 Thanks


  --
 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 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

Re: Can we make implements? public

2011-11-28 Thread Meikel Brandmeyer
Hi,

Am 28.11.2011 um 20:10 schrieb Brent Millare:

 I need to verify if an object implements a protocol. Looking at the source 
 code, I noticed that protocol objects act as a map, and has the key :impls. 
 From this is a map I can look up a class to see if there are functions. The 
 resulting code is:
 
 (defn implements? [protocol obj]
   (boolean ((:impls protocol) (class obj
 
 The problem with this is this relies on implementation details. I would like 
 to do this safely. I noticed that in clojure.core there is a private function 
 implements?. This appears to do what I want. Is it possible to make this 
 public? What is the motivation for keeping it private?

You want satisfies? ?

Sincerely
Meikel

-- 
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


Re: Currying + function in Clojure

2011-11-28 Thread Stuart Sierra
Hi Leandro,

Clojure does not curry functions automatically like Haskell or some
other functional languages. Instead, you can use the partial
function to create partially-applied functions:

Clojure 1.3.0
user= (def add3 (partial + 3))
#'user/add3
user= (add3 5)
8

Regards,
-Stuart Sierra
clojure.com

-- 
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


Re: contrib.duck-streams or contrib.io?

2011-11-28 Thread Stuart Sierra
Use clojure.java.io, included in Clojure since release 1.2.0.

Regards,
-Stuart Sierra
clojure.com

-- 
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



Re: Using Clojure on a Mac

2011-11-28 Thread Sean Corfield
On Mon, Nov 28, 2011 at 4:22 AM, Kula kulas...@gmail.com wrote:
 i recommend the brew tool
 you can try it on website https://github.com/mxcl/homebrew

I see people recommend against brew because the packages are out of date?
-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

Perfection is the enemy of the good.
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
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


Re: Using Clojure on a Mac

2011-11-28 Thread Sean Corfield
On Mon, Nov 28, 2011 at 11:16 AM, Stuart Sierra
the.stuart.sie...@gmail.com wrote:
 You can run Clojure with:

  java -cp clojure.jar clojure.main

No, actually you can't. The download does not include clojure.jar. It
includes clojure-1.3.0.jar now. Perhaps the Getting Started page on
clojure.org can be updated to correct that?

 OR you can install Leiningen, which is a convenient build tool for
 Clojure projects:
 https://github.com/technomancy/leiningen

Given that cake and lein are joining forces to create the One True
Build Tool(tm) for Clojure, perhaps we can see official blessing of
Leiningen and its recommendation by Clojure/core as the best /
simplest route to get Clojure installed and running? As noted in this
thread and other similar threads, the current approach on
clojure.org's Getting Started page is still not accurate and is far
from optimal.
-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

Perfection is the enemy of the good.
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
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


Re: Using Clojure on a Mac

2011-11-28 Thread Daniel Glauser
I recommend A and B, used to do C.  That is install Clojure with
Homebrew so you can quickly pull up a REPL to try things.  To start
the REPL you run clj as in /usr/local/bin/clj.  I was expecting it
to be called clojure and that threw me off a bit.

When doing a project of any size whatsoever Leiningen is great, super
simple, get's out of your way, manages classpath and dependency issues
and let's you focus more on the problem you are trying to solve and
less on managing your project.  If you want a REPL that loads the
projects dependencies it's as simple as lein repl.  I know of a
handful of hardcore Clojure folks who only interact with Clojure
through Leiningen.

What Chris mentioned is the traditional way to execute Clojure since
the runtime is simply a jar that needs to be on the classpath when
invoking the Java Virtual Machine.  I used to wrap that call in a
shell script but now Homebrew does that for me.  Less management
around upgrades.

Cheers,
Daniel

-- 
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


Re: Can we make implements? public

2011-11-28 Thread Alan Malloy
On Nov 28, 11:14 am, Meikel Brandmeyer m...@kotka.de wrote:
 Hi,

 Am 28.11.2011 um 20:10 schrieb Brent Millare:

  I need to verify if an object implements a protocol. Looking at the source 
  code, I noticed that protocol objects act as a map, and has the key :impls. 
  From this is a map I can look up a class to see if there are functions. The 
  resulting code is:

  (defn implements? [protocol obj]
    (boolean ((:impls protocol) (class obj

  The problem with this is this relies on implementation details. I would 
  like to do this safely. I noticed that in clojure.core there is a private 
  function implements?. This appears to do what I want. Is it possible to 
  make this public? What is the motivation for keeping it private?

 You want satisfies? ?

 Sincerely
 Meikel

satisfies? is more correct than his implementation, too. :impls
doesn't contain an entry for classes which actually implement the
generated interface, only for those which extend the protocol after
definition.

-- 
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


Re: Clojure 1.3 head holding bug

2011-11-28 Thread Alan Malloy
Interesting. It seems to me like locals-clearing should take care of
this for you, by preparing a call to trampoline, then setting the
locals to nil, then calling trampoline. But you can solve this easily
enough yourself, in this particular case, by splitting the strings up
into chunks before you open any files (you can do this lazily so it's
not a head-holding issue). Then inside the loop body, you open up a
part file, write all the strings you planned to write, close the file,
and recur with the next chunk of strings. Such a chunking function
would look a bit like:

(defn chunk-strings [size strs]
  ((fn chunk [pending strs written]
 (lazy-seq
  (if (= written size)
(cons pending (chunk [], strs, 0))
(when-let [ss (seq strs)]
  (let [s (first ss)
len (count s)]
(chunk (conj pending s)
   (rest ss)
   (+ len written)))
   [], strs, 0))

I'm sure it can be done more cleanly with reductions, adding up length
as you go, but I had trouble holding that in my head, so primitive
recursion won out.

On Nov 26, 5:59 pm, Gerrard McNulty gerrard.mcnu...@gmail.com wrote:
 Hi,

 I've a head holding problem that I believe is a bug in clojure 1.3.  I
 wrote the following function to split a a lazy seq of strings across
 files of x size:

 (defn split-file
   ([path strs size]
      (trampoline split-file path (seq strs) size 0))
   ([path strs size part]
      (with-open [f (clojure.java.io/writer (str path . part))]
        (loop [written 0, ss strs]
          (when ss
            (if (= written size)
              #(split-file path ss size (inc part))
              (let [s (first ss)]
                (.write f s)
                (recur (+ written (.length s)) (next ss)

 If I call the 3 arg version of the function:
 (split-file foo (repeat 1 blah blah blah) 1)

 I see memory usage increases as I'm writing each file with the usual
 gc slow down, then memory usage goes back down again as I get to a new
 split file.

 Memory usage is fine if I call the 4 arg version (which only writes
 one part of the split file):
 (split-file foo (repeat 1 blah blah blah) 1 0)

 I can also avoid the head holding problem by removing trampoline and
 recursively calling split-file directly, but then those recursive
 calls use up stack and don't close files until all calls complete

-- 
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


Re: [lein] Depending on tools.jar

2011-11-28 Thread Walter van der Laan
You can add something like this to project.clj:
:resources-path /usr/lib/jvm/java-6-sun/lib/tools.jar

Walter

-- 
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

Re: Clojure 1.3 head holding bug

2011-11-28 Thread Juha Arpiainen
On Nov 27, 3:59 am, Gerrard McNulty gerrard.mcnu...@gmail.com wrote:
 Hi,

 I've a head holding problem that I believe is a bug in clojure 1.3.  I
 wrote the following function to split a a lazy seq of strings across
 files of x size:

 (defn split-file
   ([path strs size]
      (trampoline split-file path (seq strs) size 0))
   ([path strs size part]
      (with-open [f (clojure.java.io/writer (str path . part))]
        (loop [written 0, ss strs]
          (when ss
            (if (= written size)
              #(split-file path ss size (inc part))
              (let [s (first ss)]
                (.write f s)
                (recur (+ written (.length s)) (next ss)

The Clojure compiler can't in general clear closed-over variables such
as
'ss in in #(split-file path ss ...) because the closure could be
called more
than once.

You could  try using  an (undocumented, compiler internal) feature
to give more information: (^:once fn* [] (split-file path ss size (inc
part)))
instead of #(split-file ...) and change the call to trampoline to
(trampoline (^:once fn* [] (split-file path (seq strs) size 0))) since
the multi-argument version of trampoline doesn't appear to use ^:once.

--
Juha Arpiainen

-- 
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


Re: How can we Laucnh REPL from java Swing application?

2011-11-28 Thread Stuart Sierra
You can certainly run a REPL in a Swing GUI app. I'm not aware of any
standalone Swing widgets to do this, but you could look at Clooj for
an example:
https://github.com/arthuredelstein/clooj

-Stuart Sierra
clojure.com

-- 
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


Re: Want some books or issues about ClojureCLR

2011-11-28 Thread Stuart Sierra
Hi Adam,

Clojure CLR is a community effort without official support. I am not
aware of any books specifically about ClojureCLR.

However, Clojure the *language* should be nearly identical between the
JVM and CLR versions. Only interop with the host platform will be
different. So any Clojure language book will be helpful in learning
the language.

Regards,
-Stuart Sierra
clojure.com

-- 
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


Re: *print-dup* and struct maps

2011-11-28 Thread Stuart Sierra
StructMaps are not print/readable. I wouldn't consider it a bug, but a
missing feature.

This was fixed for defrecord in 1.3. StructMaps should probably be
considered deprecated in favor of defrecord.

-Stuart Sierra
clojure.com

-- 
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


Re: Why no anonymous record types, or (defstruct, create-struct) vs (defrecord, ???)

2011-11-28 Thread Stuart Sierra
There are other possibilities:

* using interned Strings as keys will prevent duplicate storage of the
keys
http://docs.oracle.com/javase/6/docs/api/java/lang/String.html#intern%28%29

* you could make a custom data structure that stores the keys / rows
as vectors and generates a sequence of maps when you want to iterate
over the rows

Type hinted record fields only matter for memory usage when you're
hinting to primitive types. Everything else in Java, including
Strings, is an object, with the same memory overhead.

-Stuart Sierra
clojure.com

-- 
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


Re: Clojure 1.3 head holding bug

2011-11-28 Thread Alan Malloy
On Nov 28, 1:55 pm, Juha Arpiainen jarpi...@gmail.com wrote:
 On Nov 27, 3:59 am, Gerrard McNulty gerrard.mcnu...@gmail.com wrote:
  Hi,

  I've a head holding problem that I believe is a bug in clojure 1.3.  I
  wrote the following function to split a a lazy seq of strings across
  files of x size:

  (defn split-file
    ([path strs size]
       (trampoline split-file path (seq strs) size 0))
    ([path strs size part]
       (with-open [f (clojure.java.io/writer (str path . part))]
         (loop [written 0, ss strs]
           (when ss
             (if (= written size)
               #(split-file path ss size (inc part))
               (let [s (first ss)]
                 (.write f s)
                 (recur (+ written (.length s)) (next ss)

 The Clojure compiler can't in general clear closed-over variables such
 as
 'ss in in #(split-file path ss ...) because the closure could be
 called more
 than once.

 You could  try using  an (undocumented, compiler internal) feature
 to give more information: (^:once fn* [] (split-file path ss size (inc
 part)))
 instead of #(split-file ...) and change the call to trampoline to
 (trampoline (^:once fn* [] (split-file path (seq strs) size 0))) since
 the multi-argument version of trampoline doesn't appear to use ^:once.

But it doesn't need to clear those, because the closure goes out of
scope after being called once, and thus its locals are out of scope as
well. Am I missing something?

-- 
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


Baltimore Functional Programming

2011-11-28 Thread Gary Trakhman
Any Baltimore guys around?  I'm interested in starting a FP meetup where we 
can give talks and learn together and such.

-- 
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

Re: Want some books or issues about ClojureCLR

2011-11-28 Thread dmiller
The wiki on the github repo has some information about getting started
and how to accomplish some interop that is special to CLR.

https://github.com/richhickey/clojure-clr/wiki

and make sure to look at

https://github.com/richhickey/clojure-clr/wiki/_pages

for the complete list.

Rob Rowe (http://rob-rowe.blogspot.com/, @rippinrobr) has been
blogging recently on getting started with ClojureCLR.

-David


On Nov 28, 4:03 pm, Stuart Sierra the.stuart.sie...@gmail.com wrote:
 Hi Adam,

 Clojure CLR is a community effort without official support. I am not
 aware of any books specifically about ClojureCLR.

 However, Clojure the *language* should be nearly identical between the
 JVM and CLR versions. Only interop with the host platform will be
 different. So any Clojure language book will be helpful in learning
 the language.

 Regards,
 -Stuart Sierra
 clojure.com

-- 
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


Re: Baltimore Functional Programming

2011-11-28 Thread Brent Millare
I'm in the B'more area.

-- 
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

Re: Baltimore Functional Programming

2011-11-28 Thread Gary Trakhman
Sweet, man.  I'm looking to see if any of these guys might be interested, 
http://beehivebaltimore.org/ 

They have a javascript meetup there and their mailing list shows some 
interest in clojure, haskell and erlang.  So we would need to find at least 
like 5 people that'd be interested and a place to meet.  Baltimore's lack 
of stuff has been making me sad :-).  

Would you be interested in something like that or know any others that 
might be?

-- 
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

Re: Can we make implements? public

2011-11-28 Thread Brent Millare
satisfies? is the solution. Thanks.

-- 
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

Re: [ANN] Drift DB

2011-11-28 Thread Luc Prefontaine
Hi Matt,

working with this stuff... pretty sure I can make rake obsolete pretty soon :)

However I am struggling with the auto increment column attribute...

(create-table
  :meta-entities
  (integer :id {:not-null true :auto-increment true :primary-key true})
  (string :name {:not-null true :unique true })
  (date-time :created_at)
  (date-time :updated_at))

which looks to me compliant with what your code does in the mysql flavor lib.

It yields in MySql:

CREATE TABLE meta_entities  ( 
id  int(11) NOT NULL,
namevarchar(255) NOT NULL,
created_at  datetime NULL,
updated_at  datetime NULL,
PRIMARY KEY(id)
)
ENGINE = InnoDB
AUTO_INCREMENT = 0

According to the AquaStudio tool I use to reverse engineer the DDL.

The trace message:

DEBUG   Thread-51 2028 234732,063 drift-db-mysql.flavor ] 
Create table: :meta-entities with specs: ({:not-null true, :primary-key true, 
:spec-type :column, :type :integer, :name :id} {:not-null true, :spec-type 
:column, :type :string, :name :name} {:spec-type :column, :type :date-time, 
:name :created_at} {:spec-type :column, :type :date-time, :name :updated_at})

Looks like the :auto-increment is dropped. drift_db/core.clj at line 155 is not 
selecting
it as a potential attribute of an integer field.

I'll patch it locally so I can continue to play with it.

Any reason why the id type does not accept optional attributes ? I use id auto 
incremented keys
everywhere :)

Thank you,

Luc

On Thu, 24 Nov 2011 14:58:43 -0800 (PST)
Matt macourt...@gmail.com wrote:

 Drift DB is a clojure database library focused on migration functions.
 
 With Drift DB you can create tables, drop tables, add columns to
 tables, remove columns from tables, query tables, and, though it is
 not the focus of Drift DB, you can insert, update, delete and select
 rows from tables.
 
 The only databases currently supported are H2 and Mysql. However,
 Drift DB uses a protocol to abstract out database specific code. All
 you would have to do to support other databases is implement the Drift
 DB protocol for it.
 
 Drift DB, like Drift, was originally a part of Conjure. However, I had
 several requests to separate out the function into their own library.
 
 Drift DB is not supposed to be a replacement for ClojureQL or Korma.
 Instead, Drift DB is focused on table altering and other tasks usually
 done in Drift migrations. Such tasks are currently not well supported
 in any other Clojure database library.
 
 All of the code for Drift DB can be found on github at:
 http://github.com/macourtney/drift-db
 
 Drift DB on Clojars:
 
 Drift DB Core: http://clojars.org/org.drift-db/drift-db
 Drift DB H2: http://clojars.org/org.drift-db/drift-db-h2
 Drift DB Mysql: http://clojars.org/org.drift-db/drift-db-mysql
 



-- 
Luc P.


The rabid Muppet

-- 
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