You were right again. I left a code snippet from the book in
charge.clj and forgot to remove it later.

Now everything seems to work fine, even when importing the active-
record.user namespace as 'user':

----------------------------------------------------------------
(ns active-record.program.core
   (:require [active-record.user :as user])
   (:require [active-record.charge :as charge]))

(user/create
 {:login "my-login"
  :first_name "Stefan"
  :last_name "Rohl"
  :password "secret"
  :email_address "ste...@example.com"})

;; {:email_address "ste...@example.com", :password "secret",
;;  :last_name "Rohl", :first_name "Stefan", :login "my-login",
;;  :id 8}

(charge/create
 {:user_id 8,
  :amount_dollars 27
  :amount_cents 91
  :category "meals"
  :vendor_name "Metro"
  :date "2010-01-15"})

;; {:date "2010-01-15", :vendor_name "Metro", :category "meals",
;;  :amount_cents 91, :amount_dollars 27, :id 7,
;;  :user_id 8}

----------------------------------------------------------------

Thank you so much for your help! I really learned at lot about dealing
with namespaces today.

Stefan


On Oct 20, 5:45 pm, Meikel Brandmeyer <m...@kotka.de> wrote:
> Hi,
>
> On 20 Okt., 11:35, Stefan Rohlfing <stefan.rohlf...@gmail.com> wrote:
>
> > Evaluating your suggested declaration:
>
> >  (ns active-record.program.core
> >    (:require [active-record.user :as u])
> >    (:require [active-record.charge :as charge]))
>
> > I get the following error message:
>
> > ;; Unable to resolve symbol: user=> in this context
> > ;;   [Thrown class java.lang.Exception]
>
> You copy'n'pasted a clojure prompt somewhere or your repl is messed
> up. Please check your files thoroughly and (if necessary) start with a
> fresh repl.
>
> 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

Reply via email to