Re: Documentation lacking for ns macro

2010-11-05 Thread Paul Barry
(inc) On Thu, Nov 4, 2010 at 2:41 PM, Ken Wesson kwess...@gmail.com wrote: The ns macro seems to be poorly documented as yet. The Namespaces page at the main Clojure site does not go into detail about its syntax; doc ns comes closer, with: (ns foo.bar (:refer-clojure :exclude

Re: pointfree library

2009-10-28 Thread Paul Barry
Would love to see some examples usages of these On Sun, Oct 25, 2009 at 4:16 PM, harrison clarke notall...@gmail.comwrote: so i was using haskell, and the pointfree stuff is fun, so naturally i had to implement some of it in clojure. this is what i have so far. library and examples within:

Re: PeepCode screencast

2009-04-27 Thread Paul Barry
Yeah, I agree that it was pretty good. I like that you have a non-trivial working application at the end of it. My one criticism is that it's too hard to try to follow along and write the code as you go because there are too many changes from each step to step that aren't discussed in the

Re: Got a Clojure user group?

2009-04-11 Thread Paul Barry
Washington DC Clojure Study Group http://groups.google.com/group/clojure-study-dc On Thu, Apr 9, 2009 at 3:00 PM, Rich Hickey richhic...@gmail.com wrote: Got a Clojure user group, meetup etc? Reply to this message and let me know, I'll add them to the Clojure site. Please supply a

Re: how to learn clojure ?

2009-02-18 Thread Paul Barry
I agree with this. Clojure is significantly different than Common Lisp and Scheme, so reading On Lisp and Practical Common Lisp are going to cover a bunch of stuff not relevant to Clojure. The Prag Prog book, Programming Clojure, covers pretty much everything you need to know about Lisp, at

Restarting a transaction with commute?

2009-02-01 Thread Paul Barry
My understanding of commute is that it would not restart the transaction, it would just apply the function. So I wrote this little test program: (defmacro in-thread [ body] `(.start (Thread. (fn [] (println Thread (.getId (Thread/currentThread)) started) ~...@body

Re: Simple Examples of Concurrency?

2009-01-29 Thread Paul Barry
Keith, Are you planning on going to the DC Clojure Study Group on Saturday? Concurrency is the topic and I've got some good exercises planned for us to work on. Also be sure to read Ch 6 in Stuart's book. On Tue, Jan 27, 2009 at 3:06 AM, Keith Bennett keithrbenn...@gmail.comwrote: All -

Re: Alternatives to contains?

2009-01-29 Thread Paul Barry
This is actually the point of this whole debate. You would assume that contains? works like java.util.Collection.contains, but instead it means something completely semantically different. user= (.contains [4 5 6] 4) true user= (contains? [4 5 6] 4) false Even worse, you do this and think it

Re: [DISCUSS] Use an Issue tracker?

2009-01-23 Thread Paul Barry
What's wrong with google code? http://code.google.com/p/clojure/issues/list On Fri, Jan 23, 2009 at 5:29 PM, Howard Lewis Ship hls...@gmail.com wrote: I'm always a fan of using a real issue tracking system; I'd love to see Clojure using JIRA to track what's going on, and what's coming up, in

Re: reader macros

2009-01-23 Thread Paul Barry
Mark, Yes, I think so. My understanding of a reader marco is a character or set of characters that is a shortcut for some other special form/macro that you could use if the reader macro didn't exist. By that definition, I think [...] and {...} are also reader macros. I think \ just part of the

Re: Example Java oriented SWT GUI application in Clojure

2009-01-15 Thread Paul Barry
It's probably this: http://www.eclipse.org/swt/faq.php#carbonapp On Thu, Jan 15, 2009 at 9:20 PM, e evier...@gmail.com wrote: anyone able to get this going on a Mac yet? The main window comes up, but shortly after crashes. On Mon, Jan 12, 2009 at 5:24 PM, BerlinBrown

Re: [ANN] Ring: A Web application library for Clojure.

2009-01-12 Thread Paul Barry
What's does the req object that is passed into the function have in it? On Mon, Jan 12, 2009 at 11:45 PM, Mark McGranaghan mmcgr...@gmail.comwrote: Hi All, I'm happy to announce the alpha release of 'Ring', a library inspired by Python's WSGI and Ruby's Rack for developing web applications

Re: [ANN] Ring: A Web application library for Clojure.

2009-01-12 Thread Paul Barry
function. Great Work! On Tue, Jan 13, 2009 at 1:13 AM, Paul Barry pauljbar...@gmail.com wrote: What's does the req object that is passed into the function have in it? On Mon, Jan 12, 2009 at 11:45 PM, Mark McGranaghan mmcgr...@gmail.comwrote: Hi All, I'm happy to announce the alpha release

Re: Very noob file reading and printing question

2009-01-07 Thread Paul Barry
Here's a little cleaner version using doseq: (use 'clojure.contrib.duck-streams) (with-open [r (reader doc.txt)] (doseq [line (line-seq r)] (println line))) On Wed, Jan 7, 2009 at 7:27 AM, Tom Ayerst tom.aye...@gmail.com wrote: Thanks Brian. I finally nailed it with: (use

Re: Very noob file reading and printing question

2009-01-07 Thread Paul Barry
but it didn't print anything. I had: (with-open [r (reader doc.txt)] (doseq [line (line-seq r)] println line)) so I wasn't evaluating the println. Cheers Tom 2009/1/7 Paul Barry pauljbar...@gmail.com Here's a little cleaner version using doseq: (use 'clojure.contrib.duck-streams

Re: writing bytes to a file

2009-01-07 Thread Paul Barry
clojure.contrib.duck_streams/spit? On Wed, Jan 7, 2009 at 2:14 PM, Brian Doyle brianpdo...@gmail.com wrote: I couldn't find anything in core or contrib that wrote out bytes to a file so I wrote something to do it. Is this functionality already implemented and I just couldn't find it? If

Re: Collecting items in an interface method call

2009-01-06 Thread Paul Barry
I don't see any way to do that without appending to a list of some sort. Based on the way this library is written, that's true of Java or Clojure, since SVNLogClient doesn't appear to have any methods to return a Collection, just these doList methods, which forces you into a side effect style of

Re: quote on side effects

2009-01-05 Thread Paul Barry
I thought that first place I heard it was Rich mentioning it in one of the videos on http://clojure.blip.tv, but I can't find it. On Mon, Jan 5, 2009 at 3:48 PM, Mark Volkmann r.mark.volkm...@gmail.comwrote: I'm trying to recall where I heard a quote that goes something like this. If none of

Re: quote on side effects

2009-01-05 Thread Paul Barry
I didn't think you originated the quote, but did you mention it during one of your presentations? Maybe I'm thinking of someone else. On Mon, Jan 5, 2009 at 6:09 PM, Rich Hickey richhic...@gmail.com wrote: On Mon, Jan 5, 2009 at 5:04 PM, Paul Barry pauljbar...@gmail.com wrote: I thought

Re: clj-backtrace: more readable backtraces for Clojure

2009-01-04 Thread Paul Barry
This is very nice, any chance we could see this added to clojure contrib? On Thu, Jan 1, 2009 at 9:30 PM, Mark McGranaghan mmcgr...@gmail.com wrote: Hi all, I'm happy to announce an alpha release of clj-backtrace, a library for processing backtraces generated by Clojure programs. The

Re: what does - mean?

2008-12-29 Thread Paul Barry
You can look up the documentation for a function/macro interactively from the repl: user= (doc -) - clojure.core/- ([x form] [x form more]) Macro Threads the expr through the forms. Inserts x as the second item in the first form, making a list of it if it is not a

Re: Fibonacci sequence

2008-12-29 Thread Paul Barry
Craig, Something you should be aware of is that this implementation of Fibonacci is very inefficient. For more info as to why, you can read: http://mitpress.mit.edu/sicp/full-text/book/book-Z-H-11.html#%_sec_1.2.2 The short story is doing it this way performs a lot of wasted calculations as n

Re: Lisp/Clojure doesn't have syntax?

2008-12-12 Thread Paul Barry
On Dec 11, 6:19 pm, Rich Hickey richhic...@gmail.com wrote: Yes, the critical point is that the text-based representation of code is completely secondary: (def x (list (list (symbol fn) (vector) Hello World))) (class (second (first x))) - clojure.lang.PersistentVector (class (first

Lisp/Clojure doesn't have syntax?

2008-12-11 Thread Paul Barry
I've been reading the latest chapter from Stuart's book, Chapter 7: Macros, and he makes this statement: Clojure has no special syntax for code. Code is simply Clojure data. This is true for normal functions, but also for special forms and macros. Consider a language with syntax, such as Java.

Re: Lisp/Clojure doesn't have syntax?

2008-12-11 Thread Paul Barry
On Dec 11, 4:44 pm, Randall R Schulz rsch...@sonic.net wrote: All these things are syntactic sugar. Shorthand ways to write things that have vanilla S-Expression counterparts. Again, I would not call them syntax. syntactic sugar is not syntax?

Re: DISCUSS: replace (rand)

2008-12-01 Thread Paul Barry
Looks like the only synchronization is for lazy initialization of the instance of Random used by the static method: public final class Math { private static Random randomNumberGenerator; private static synchronized void initRNG() { if (randomNumberGenerator == null)

quit

2008-11-30 Thread Paul Barry
It's a minor thing, but wouldn't it be a good idea to put (defn quit [] (System/exit 0)) in clojure core, just to make quitting out of the REPL more obvious? Ctrl-C and Ctrl-D work too, and are actually shorter to type, but having a quit function seems to be an idiomatic way of getting out of

Re: (source name)

2008-11-03 Thread Paul Barry
I agree that this would be helpful. On Nov 2, 6:34 pm, Mark McGranaghan [EMAIL PROTECTED] wrote: I really like being able to find and check documentation in the REPL with find-doc and doc, but I often would like to see the source code of a function or macro to be able to understand it better

Re: Testing Clojure (was Re: Bug? Strange set equality (r1075))

2008-10-19 Thread Paul Barry
I like this idea and I would be willing to contribute. On Oct 19, 6:43 pm, Stephen C. Gilardi [EMAIL PROTECTED] wrote: On Oct 19, 2008, at 5:11 PM, J. McConnell wrote: I've been thinking the same thing for awhile now and I'd love to help contribute to an effort like this. Thanks for

Dealing with keyword-keyed maps in Java land

2008-10-13 Thread Paul Barry
Now that clojure maps are Java Maps, it is easier to inter-operate with Java code that has methods that take a Map as one of its arguments, because you can just pass the Map right into the Java code. The problem is that often times, the Java method is expecting the Map to have String values in

Re: Dealing with keyword-keyed maps in Java land

2008-10-13 Thread Paul Barry
I'm thinking about cases where you are using existing java libraries that you don't want to/can't re-write to have Clojure specific code in them. I think the rule for dealing with conflicts would be to give me the value for the String if it's there, if it's not, try to give me the value for the

Re: Dealing with keyword-keyed maps in Java land

2008-10-13 Thread Paul Barry
, Rich Hickey [EMAIL PROTECTED] wrote: On Oct 13, 9:34 am, Paul Barry [EMAIL PROTECTED] wrote: I was thinking this is a little different because the Keyword data type is unique to Clojure.  So once in the Java land, you are never going to want to use Keywords.  In Clojure, I agree

Re: Dealing with keyword-keyed maps in Java land

2008-10-13 Thread Paul Barry
. On Oct 13, 11:22 am, Rich Hickey [EMAIL PROTECTED] wrote: On Oct 13, 10:17 am, Paul Barry [EMAIL PROTECTED] wrote: To give a specific example of what I'm trying to do, I'd like to use velocity templates in Clojure.  So I have this code: (in-ns 'velocity) (clojure/refer 'clojure

Re: Dealing with keyword-keyed maps in Java land

2008-10-13 Thread Paul Barry
I was thinking this is a little different because the Keyword data type is unique to Clojure. So once in the Java land, you are never going to want to use Keywords. In Clojure, I agree, the difference between Keyword and String should be explicit, but in Java, I feel like it's just pragmatic to

Re: regex literal syntax

2008-10-09 Thread Paul Barry
What about having #pattern work like is does now, and then having #/ pattern/ work similarly to Ruby, Python, Perl, etc. regular expression in that they not require double escaping of characters like '\'? So in other words: #/em(.*?)\/em/ instead of: #em(.*?)\\/em The advantage to

Re: slurp is in Clojure, but spit is in Contrib?

2008-10-06 Thread Paul Barry
+1 On Oct 6, 10:43 am, Stephen C. Gilardi [EMAIL PROTECTED] wrote: If this gets traction, please also consider a name change to something   more along the lines of read-file and write-file. --Steve --~--~-~--~~~---~--~~ You received this message because you

Re: true?

2008-10-03 Thread Paul Barry
On Oct 3, 10:26 am, Stuart Halloway [EMAIL PROTECTED] wrote: But somebody is going to need to write a book to explain these odd corners   to people coming from the Java world. Bwa ha ha ha ha. :-) Stuart Seriously, Clojure for Java Developers would be a great book. The biggest topic that I

Re: Clojure at Boston Lisp Meeting videos

2008-10-02 Thread Paul Barry
Another suggestion for Mac users, install Miro, it's free, and it automatically downloads new videos, makes it easy to watch them in fullscreen: http://subscribe.getmiro.com/?url1=http://clojure.blip.tv/rss On Oct 2, 7:51 am, Rich Hickey [EMAIL PROTECTED] wrote: On Oct 2, 3:56 am, scottjad