and user.clj function wasn't avilable without importing it when I try
to access them if I put a file ina namespace.

On Jan 7, 8:27 pm, "Stephen C. Gilardi" <[email protected]> wrote:
> On Jan 7, 2009, at 12:11 PM, ssecorp wrote:
>
>
>
> > This was going to be a question but I solved it before I finished the
> > post :)
> > Figured I might post the solution then, hopefully it will help someone
> > else.
>
> Very cool.
>
>
>
> > (ns progs.netflix.db
> >    (:require (clojure.contrib [sql :as sql]))
> >    (:require (clojure.contrib.sql [internal :as internal])))
> > (load-file "C:/clojure/user.clj")
>
> > (def db {:classname "org.postgresql.Driver"
> >         :subprotocol "postgresql"
> >         :subname "//localhost/flonk"
> >     :user "postgres"
> >     :password "1234qwer"
> >     })
>
> > (defn drop-deleta []
> >  (try
> >   (sql/drop-table :deleta)
> >   (catch Exception e)))
>
> > (defn create-and-drop-previous []
> >  (sql/with-connection db
> >    (sql/transaction
> >      (drop-deleta))))
>
> The goal is for you not to need "sql.internal". I made a recent change  
> that makes "(connection)" available without it. If you're still using  
> it, please let me know why and I'll try to fix it.
>
> If C:/clojure is in your classpath, user.clj will be loaded at the  
> time you launch the repl or script. You shouldn't need to load it in  
> code you deploy. If you're doing it at the repl, I would prefer to use  
> (require 'user.clj :reload) and avoid load-file in nearly every case.
>
> --Steve
>
>  smime.p7s
> 3KViewDownload
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to