(inc)
On Thu, Nov 4, 2010 at 2:41 PM, Ken Wesson 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 [ancestors printf])
Would love to see some examples usages of these
On Sun, Oct 25, 2009 at 4:16 PM, harrison clarke wrote:
>
> 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:
> http://github
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
screenc
Washington DC Clojure Study Group
http://groups.google.com/group/clojure-study-dc
On Thu, Apr 9, 2009 at 3:00 PM, Rich Hickey 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 primary URL for gett
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 least
Ketih,
I think what you have done, at least at the JVM level, is create 100,000
lists, with basically each list containing an element and a pointer to the
next element. Because one list points to the next, none of them can be
garbage collected. It seems to me that this would be roughly equivalen
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
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 wo
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 wrote:
>
> All -
>
> I'm trying to wrap my
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 l
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 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 a public and
It's probably this:
http://www.eclipse.org/swt/faq.php#carbonapp
On Thu, Jan 15, 2009 at 9:20 PM, e 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 wrote:
>
>>
>> Here is an example SW
to your function. Great Work!
On Tue, Jan 13, 2009 at 1:13 AM, Paul Barry 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 wrote:
>
>>
>> Hi All,
>>
>> I'm
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 wrote:
>
> 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 in
> Clojure.
clojure.contrib.duck_streams/spit?
On Wed, Jan 7, 2009 at 2:14 PM, Brian Doyle 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 there isn't anythi
t 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
>
> Here's a little cleaner version usin
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 wrote:
> Thanks Brian.
>
> I finally nailed it with:
>
> (use '[clojure.contrib.duck-strea
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 p
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 wrote:
>
> On Mon, Jan 5, 2009 at 5:04 PM, Paul Barry wrote:
> > I thought that first pla
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 wrote:
>
> I'm trying to recall where I heard a quote that goes something like this.
>
> "If none of your functions have
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 wrote:
>
> Hi all,
>
> I'm happy to announce an alpha release of clj-backtrace, a library for
> processing backtraces generated by Clojure programs. The library works
> by s
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
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
On Dec 11, 6:19 pm, Rich Hickey 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 (first x)))
On Dec 11, 4:44 pm, Randall R Schulz 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?
--~--~-~--~~~---~--~~
You recei
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. .
Since this is just pure java, shouldn't it be the same on all 1.5
JVMs? Would it be different on other JVM implementations? Just to
verify, I checked on my Mac OS X 10.5 and in the Sun JDK 1.5 on
Windows XP, and it does appear to be the same.
On Dec 2, 9:17 am, Stuart Halloway <[EMAIL PROTECTED
Ah, I didn't see the call to next. The java docs do say that is the
implementation for that method, but they are lying:
protected int next(int bits) {
long oldseed, nextseed;
AtomicLong seed = this.seed;
do {
oldseed = seed.get();
nextseed = (o
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)
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 the
I just watched Jim Weirich's talk from RubyConf. He does a good job
of showing the basics of why concurrent programming is hard, and
briefly talks about Erlang and Clojure at the end. I recommend it to
anyone interested in Clojure:
http://rubyconf2008.confreaks.com/what-all-rubyist-should-know-
Sure, I'd be interested in porting it, would give me a reason to learn
Scala :). Just post the code to github or something and let us know
where it's at.
On Nov 20, 10:42 pm, islon <[EMAIL PROTECTED]> wrote:
> I gave up, the resulting code would be a lot more complex than the
> scala version.
>
I would prefer to see this not become a convention in Clojure. The
reason why is the first part of your domain is unimportant and
possibly likely to change. The hibernate project was a good example
of this. They were first hosting it on sourceforge, so they made all
their packages net.sf.hibern
In Common Lisp and Scheme, if you have an expression that evaluates a
symbol, it doesn't evaluate it until you call the function, not when
you define it. So you can do this:
Common Lisp:
[1]> (defun b () a)
B
[2]> (defvar a 5)
A
[3]> (b)
5
Scheme:
1 ]=> (define (b) a)
;Value: b
1 ]=> (define a
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 bet
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 f
Krukow,
I agree, it would help to have a resource for learning Clojure. For
now, my best advice is to pick a real project to start working and
then specific questions in the IRC room, #clojure on irc.freenode.net.
Within a few months, we'll have the beta book:
http://www.pragprog.com/titles/shc
Baltimore, Maryland, US
On Oct 17, 5:27 am, "Rastislav Kassak" <[EMAIL PROTECTED]> wrote:
> Hello Clojurians,
>
> I think after 1st year of Clojure life it's good to check how far has
> Clojure spread all over the world.
>
> So wherever are you come from, be proud and say it.
>
> I'm from Slovaki
ow an Exception rather than return false also.
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
> >
ughts? Should I change the model layer to return
String-keyed maps? Or convert the Keywords to Strings before building
the VelocityContext?
On Oct 13, 9:58 am, Rich Hickey <[EMAIL PROTECTED]> wrote:
> On Oct 13, 9:34 am, Paul Barry <[EMAIL PROTECTED]> wrote:
>
>
>
> &g
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 K
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
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 th
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>/
instead of:
#"(.*?)<\\/em>"
The advantage to
+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 bec
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 th
I agree with Stuart, I can't imagine this is how anyone new to Clojure
would expect this to work:
user=> (contains? [2 3 4] 1)
(contains? [2 3 4] 1)
true
user=> (contains? [2 3 4] 4)
(contains? [2 3 4] 4)
false
user=> (contains? (seq [2 3 4]) 1)
(contains? (seq [2 3 4]) 1)
false
user=> (contains?
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 <
On Sep 30, 11:17 am, Rich Hickey <[EMAIL PROTECTED]> wrote:
> I've been thinking about this Map vs Collection issue for a while now
> and am considering making the move to: Clojure maps implement Java
> Map.
Yes, please do! +1!
--~--~-~--~~~---~--~~
You received th
49 matches
Mail list logo