Re: Some code review for clj-record?

2009-01-11 Thread John D. Hume
Hi Emeka, Sorry for the slow response. I don't get that message with the latest clojure, clojure-contrib, and clj-record. (load-file just returns nil.) What version of clojure are you running? Do you have the base directory of clj-record on your classpath? Also, that file just contains the

Re: Some code review for clj-record?

2009-01-08 Thread Emeka
user= (load-file clj_record/core.clj) I got clj_record/util not in system path. Why is it so? Emeka --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to

Re: Some code review for clj-record?

2009-01-04 Thread John D. Hume
Brian, I incorporated your changes and then made changes to load and run all clj_record/test/*-test.clj files. Thanks again. -hume. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Clojure group. To post to this

Re: Some code review for clj-record?

2009-01-04 Thread Brian Doyle
Looks good. I didn't know about the *file* var. On Sun, Jan 4, 2009 at 11:22 AM, John D. Hume duelin.mark...@gmail.comwrote: Brian, I incorporated your changes and then made changes to load and run all clj_record/test/*-test.clj files. Thanks again. -hume.

Re: Some code review for clj-record?

2009-01-04 Thread Brian Doyle
John, I was looking at the validates method and I had a thought I'd bounce off you. Instead of just returning a hash of errors what about returning the record with the errors hash in the metadata? That way you just have the data and the errors in one object similar to an ActiveRecord model.

Re: Some code review for clj-record?

2009-01-03 Thread John D. Hume
Hi Brian, On Sat, Jan 3, 2009 at 12:53 AM, Brian Doyle brianpdo...@gmail.com wrote: I changed the end of the clj-record/test/main.clj script to this: main.clj (def files [core-test validation-test associations-test]) (doseq [file files] (load file)) (def base-ns (re-find #^\w*.*\.

Re: Some code review for clj-record?

2009-01-02 Thread Brian Doyle
John, I was looking around at your tests just to get a feel for using the test-is stuff in the contrib library. I noticed that when I ran main.clj it would run not only the tests in clj-record, but all of the tests in the clojure.contrib as well. I was curious so I attempted to figure out what

Re: Some code review for clj-record?

2008-12-31 Thread John D. Hume
Hi Brian, On Tue, Dec 30, 2008 at 11:41 AM, Brian Doyle brianpdo...@gmail.com wrote: (ns com.example.user) (clj-record.core/init-model) but when I do that I get the error: java.lang.ClassNotFoundException: clj-record.core ... (first (reverse (re-split #\. (name (ns-name *ns*) and

Re: Some code review for clj-record?

2008-12-30 Thread Brian Doyle
I see what you are doing with the validations and defining them in the init-modelcall. I think that's a good idea actually and like it better than my solution to putting the callbacks in the model namespace. A couple of small things that I noticed when starting to play around with clj-record. In

Re: Some code review for clj-record?

2008-12-29 Thread Brian Doyle
That seems to be working better now John. I looked over most of the code and it seems like a good start. I'm no expert when it comes to functional programming or Clojure, so I'm not sure how to critic the code exactly. If I was doing the porting I would prolly do it in very OO way, since

Re: Some code review for clj-record?

2008-12-29 Thread John D. Hume
On Mon, Dec 29, 2008 at 7:15 PM, Brian Doyle brianpdo...@gmail.com wrote: I noticed that in the init-model macro you are creating a 'defn table [] ...' function in the model namespace and was wondering why you didn't just make it a def instead, since it doesn't take any args? That didn't

Re: Some code review for clj-record?

2008-12-28 Thread Brian Doyle
Having used Rails myself I wanted to check this out and play with it. I'm having some trouble just loading the clj_record/core.clj file though: 1:1 user= (load-file clj_record/core.clj) java.lang.Exception: Unable to resolve symbol: db in this context (core.clj:19) I'm sure it's something I'm

Re: Some code review for clj-record?

2008-12-28 Thread John D. Hume
The db configuration isn't reasonable at the moment. You can run clj_record/test/main.clj as a script but not load it from the REPL. Let me see if I can get it to work both ways and push an update. On Sun, Dec 28, 2008 at 6:28 PM, Brian Doyle brianpdo...@gmail.com wrote: Having used Rails

Re: Some code review for clj-record?

2008-12-28 Thread John D. Hume
Ok, please pull the latest and try again. git clone git://github.com/duelinmarkers/clj-record.git The problem was due to something I've seen a couple other messages about: When running a file as a script, it starts out in the clojure.core namespace. I was doing (def db {...}) before any (ns ...)