Re: newbie question about ns and :require

2010-01-28 Thread DanL
Hello! On 27 Jan., 22:49, Raoul Duke rao...@gmail.com wrote: On Wed, Jan 27, 2010 at 1:41 PM, Matt Revelle mreve...@gmail.com wrote: In general, if you see a form that looks like it's a special language and wouldn't evaluate its contents before executing the form then it's a macro. but

Re: newbie question about ns and :require

2010-01-28 Thread Raoul Duke
On Thu, Jan 28, 2010 at 11:50 AM, DanL leidis...@gmail.com wrote: which to me seems somewhat antithetical to didactic purposes. i'm much more in the TOOWTDI camp than the TMTOWTDI when it comes to design. What if the OWTDI starts to get in your way? Is there anyone capable to define a OWTD

Re: newbie question about ns and :require

2010-01-27 Thread Raoul Duke
Thus the only time you need to use a non-vector is the map for rename, which makes sense to me. now if i only knew when to use ' or : or nothing, and which in (ns) vs. inline in the repl. ugh. -- You received this message because you are subscribed to the Google Groups Clojure group. To post

Re: newbie question about ns and :require

2010-01-27 Thread Richard Newman
now if i only knew when to use ' or : or nothing, and which in (ns) vs. inline in the repl. Simple: ns is a macro, so you don't need to quote. use and require are functions, so you need to quote their symbol arguments. ns uses keywords to identify its directives (:use), and functions

Re: newbie question about ns and :require

2010-01-27 Thread Raoul Duke
On Wed, Jan 27, 2010 at 11:27 AM, Richard Newman holyg...@gmail.com wrote: Simple: ns is a macro, so you don't need to quote. use and require are functions, so you need to quote their symbol arguments. ns uses keywords to identify its directives (:use), and functions (use) don't, because

Re: newbie question about ns and :require

2010-01-27 Thread Matt Revelle
On Jan 27, 2:32 pm, Raoul Duke rao...@gmail.com wrote: ok, thanks, i will try to internalize that :-) i am not somebody who can point to languages i have defined and implemented, so i don't have any cred, but i think the requirement that the programmer know such details (like i have to know

Re: newbie question about ns and :require

2010-01-27 Thread Raoul Duke
On Wed, Jan 27, 2010 at 1:41 PM, Matt Revelle mreve...@gmail.com wrote: In general, if you see a form that looks like it's a special language and wouldn't evaluate its contents before executing the form then it's a macro. but that is a chicken-egg thing where i have to experiment and fiddle

Re: newbie question about ns and :require

2010-01-26 Thread Steven E. Harris
Raoul Duke rao...@gmail.com writes: so, like, this means i /not/ the only one who finds the whole (whatever you want to call it) include/import syntax kinda crazy? I was expecting even more of a backlash from those who already get it. For now, I only understand it as, There are a lot of

Re: newbie question about ns and :require

2010-01-26 Thread ataggart
On Jan 25, 5:40 pm, Steven E. Harris s...@panix.com wrote: Justin Kramer jkkra...@gmail.com writes: You may find this ns cheatsheet helpful: http://gist.github.com/284277 That is most helpful. What's not helpful is the weird mix of lists and vectors used by these forms. When I finally

Re: newbie question about ns and :require

2010-01-25 Thread Justin Kramer
You may find this ns cheatsheet helpful: http://gist.github.com/284277 Justin On Jan 24, 10:28 am, Manfred Lotz manfred.l...@arcor.de wrote: Hi all, I'm stumbling about the very basics. Calling clojure like this: rlwrap java -cp

Re: newbie question about ns and :require

2010-01-25 Thread Manfred Lotz
Hi, On Sun, 24 Jan 2010 17:07:23 +0100 Meikel Brandmeyer m...@kotka.de wrote: But why does this fail? my= (classpath) java.lang.Exception: Unable to resolve symbol: classpath in this context (NO_SOURCE_FILE:2) Because you used require. Try clojure.contrib.classpath/classpath

Re: newbie question about ns and :require

2010-01-25 Thread Manfred Lotz
On Sun, 24 Jan 2010 12:28:16 -0800 (PST) Justin Kramer jkkra...@gmail.com wrote: You may find this ns cheatsheet helpful: http://gist.github.com/284277 Justin A good pointer. -- Thanks, Manfred -- You received this message because you are subscribed to the Google Groups Clojure

Re: newbie question about ns and :require

2010-01-25 Thread Steven E. Harris
Justin Kramer jkkra...@gmail.com writes: You may find this ns cheatsheet helpful: http://gist.github.com/284277 That is most helpful. What's not helpful is the weird mix of lists and vectors used by these forms. When I finally made it to :rename accepting a map, I had to take a break. --

Re: newbie question about ns and :require

2010-01-25 Thread Raoul Duke
What's not helpful is the weird mix of lists and vectors used by these forms. When I finally made it to :rename accepting a map, I had to take a break. so, like, this means i /not/ the only one who finds the whole (whatever you want to call it) include/import syntax kinda crazy? phew. -- You

newbie question about ns and :require

2010-01-24 Thread Manfred Lotz
Hi all, I'm stumbling about the very basics. Calling clojure like this: rlwrap java -cp /home/manfred/clojure/clojure.jar:/home/manfred/clojure/clojure-contrib.jar clojure.main I try: user= (ns my (:require clojure.contrib.classpath)) nil my= which to me looks fine. But why does this

Re: newbie question about ns and :require

2010-01-24 Thread Gabi
Maybe try (ns my (:require [clojure.contrib.classpath :as cp])) (cp.classpath) On Jan 24, 5:28 pm, Manfred Lotz manfred.l...@arcor.de wrote: Hi all, I'm stumbling about the very basics. Calling clojure like this: rlwrap java -cp

Re: newbie question about ns and :require

2010-01-24 Thread Gabi
Sorry, I meant (cp/classpath) .. On Jan 24, 6:06 pm, Gabi bugspy...@gmail.com wrote: Maybe try (ns my (:require [clojure.contrib.classpath :as cp])) (cp.classpath) On Jan 24, 5:28 pm, Manfred Lotz manfred.l...@arcor.de wrote: Hi all, I'm stumbling about the very basics. Calling

Re: newbie question about ns and :require

2010-01-24 Thread David Nolen
On Sun, Jan 24, 2010 at 10:28 AM, Manfred Lotz manfred.l...@arcor.dewrote: user= (ns my (:require clojure.contrib.classpath)) nil my= which to me looks fine. But why does this fail? my= (classpath) java.lang.Exception: Unable to resolve symbol: classpath in this context

Re: newbie question about ns and :require

2010-01-24 Thread .Bill Smith
Manfred, The (:require clojure.contrib.classpath) tuple tells the ns function to load the clojure.contrib.classpath library if it has not already been loaded. Clojure looks for clojure/contrib/classpath.clj (or the equivalent class file) somewhere in your classpath, which in your case would be