> My wish: There are easy-to-understand examples in API doc.
>From another thread I see that the api doc is being automated, so
maybe this presents an opportunity to include a new meta tag such
as :eg or :example (to allow them to be viewed separately from :doc -
or if this is not a good idea may
I think there are a lot of people who need to choose between Clojure
and Scala to study as a "new" language. I must say that both are bad:
* Clojure doc is hard to understand.
* Scala grammar is complicated.
I prefer Clojure. I think Clojure feature at this time is OK, thus the
decisive point to
On Aug 25, 7:37 pm, Alan Busby wrote:
> Reducing it further, I'd be interested just to hear more about the contrast
> of static typing versus macros. Which is more beneficial for different
> situations and why?
I fail to see how macros can be contrasted to static typeng. They are
orthogonal. Her
On Wed, Aug 26, 2009 at 5:43 AM, npowell wrote:
>
> I mean, I didn't think the article was terribly in depth, but a real,
> evenhanded comparison would be enlightening.
Reducing it further, I'd be interested just to hear more about the contrast
of static typing versus macros. Which is more benef
On Aug 25, 4:36 pm, Christian Vest Hansen
wrote:
> I think he misrepresents both Scala and Clojure.
...
Not a super helpful assessment.
I'd like to hear more. What do you disagree with and why?
I think the comparisons are inevitable, and knowing more about both
helps developers make good cho
That's great! Thanks a lot for the explanation.
On Aug 25, 2:58 pm, Richard Newman wrote:
> Incidentally, you can find this stuff out by reading the source, if
> you know where to look. It's a reader macro, so LispReader.java is the
> best place to start. Look for the metachar '=', which cro
Awesome. I've got a new computer I need to install Netbeans on
anyway. This is great!
Sean
On Aug 25, 9:18 pm, Eric Thorsen wrote:
> New release of the Enclojure plugin for Netbeans has been released! I
> uploaded a short video to provide an overview of the new features.
> Partial feature li
New release of the Enclojure plugin for Netbeans has been released! I
uploaded a short video to provide an overview of the new features.
Partial feature list for this release:
• REPL
• Integrated Pretty Printer (clojure.contrib.pprint)
• Browsable/sear
Incidentally, you can find this stuff out by reading the source, if
you know where to look. It's a reader macro, so LispReader.java is the
best place to start. Look for the metachar '=', which crops up on line
91:
http://github.com/richhickey/clojure/blob/14316ae2110a779ffc8ac9c3da3f1c41852
> It's undocumented in http://clojure.org/reader. What is its name? What
> does it precisely do?
It's "EvalReader". What it does is cause the expression to be
evaluated at read time:
user=> (read-string "(+ 5 #=(* 9 9))")
(+ 5 81)
You can prevent this occurring by binding *read-eval*:
user=>
Hi Dragan,
The example projects been updated with a repository declaration pointing to
the clojure snapshots, and using the released plugin version.
Running "mvn test" runs the tests as expected. You mentioned " Can you,
please, update the example so we can see exactly how to hook
up clojure:tes
#= is a real Clojure reader macro. It often shows up when using *print-
dup*:
Clojure 1.0.0-
user=> (binding [*print-dup* true] (println {:a 3, :b 2}))
#=(clojure.lang.PersistentArrayMap/create {:a 3, :b 2})
nil
user=> #=(clojure.lang.PersistentArrayMap/create {:a 3, :b 2})
{:b 2, :a 3}
It's und
Plus, his spelling and grammar is atrocious. If you're going to write
a blog, proofread what you're writing!
(I know this is harder for non-English speakers, but it does make a
huge difference to the perceived quality of what you're saying.)
On Aug 25, 1:36 pm, Christian Vest Hansen
wrote:
> I
Rich:
Glad to help, thanks for the kind words.
For Clojure core, mostly what I need to do is refactor and
parameterize a bunch of stuff. I'll just make a fork and start
playing. When I have something, we can discuss and fine tune.
Should it be similar to what we have now with all the namespaces
I think he misrepresents both Scala and Clojure.
On Tue, Aug 25, 2009 at 7:11 PM, Emeka wrote:
> Hello All,
>
> This sounds great!
>
> http://codemonkeyism.com/clojure-scala-part-2/
>
>
> Regards,
> Emeka
> >
>
--
Venlig hilsen / Kind regards,
Christian Vest Hansen.
--~--~-~--~~-
I am two sided about this. I hope that there exists a nice easy
translation from block-indentation code to parenthesis-ridden code. As
it stands however, the current solutions are more hassle than they're
worth.
I don't want to be misinterpreted as saying that I wouldn't desire
such a feature. I
Hi,
Am 25.08.2009 um 20:09 schrieb rb:
Here is what I've done for now:
(defmacro deflistener [ interfaces trigger-args & body]
`(proxy [ ~...@interfaces ] [] (trigger [...@trigger-args] ~...@body))
)
Which can be used like this:
( deflistener (Signal1$Listener) (mouse-event) (.setText resul
On Tue, Aug 25, 2009 at 7:56 PM, Jonathan Smith
wrote:
>
> I would have worried that if dim and max were close you'd get to the
> last number and keep calling #(rand-int) and never hit the last
> number.
>
> how does distinct work that it keeps that situation from occuring?
(make-random-numbers
HI,
I have several calls to addListener, for which I have to create a
proxy::
(.. (WPushButton. "Greet me" root) clicked (addListener wapp
(proxy [Signal1$Listener] [] (trigger [ mouse-event ] (.setText
result-text (.getText line-edit))
I think this is code elligible for simplification
Looks really nice Tom!
Wouldn't it be better to make the words "API documentation" the link
rather than adding the extra valueless word "here"?
Alternatively, you could turn the namespace titles into links and get
rid of the line words "API documentation here" entirely. That might
also help goo
I would have worried that if dim and max were close you'd get to the
last number and keep calling #(rand-int) and never hit the last
number.
how does distinct work that it keeps that situation from occuring?
On Aug 25, 12:26 pm, Christophe Grand wrote:
> no, distinct uses a hash-set (nearly-con
like this:
(defn shuffle-java ;;from Shawn Hoover post on these google groups
"Shuffles coll using a Java ArrayList. Blows shuffle out of the
water on speed and space."
[coll]
(let [l (java.util.ArrayList. coll)]
(java.util.Collections/shuffle l)
(seq l)))
(defn random-number-list
Why not make a list of numbers from 0 to max, randomly shuffle it,
and do a take on the resulting sequence until you have enough numbers.
On Aug 25, 10:16 am, sebastien wrote:
> What is the most efficient way to generate list of unique random
> numbers? The function must look something like this
On Tue, Aug 25, 2009 at 1:09 PM, Tom Faulhaber wrote:
>
> (I know this has been mentioned and referenced a number of times
> already in this forum, but I have crossed some imaginary line to
> "officially done" so I thought I'd put up an official announcement.)
>
> The automatic documentation for t
On Aug 25, 11:28 am, B Smith-Mannschott wrote:
> On Tue, Aug 25, 2009 at 16:24, Licenser wrote:
>
> > Hi everyone,
> > I wonder what is the reason clojure uses XML standard wise and not
> > JSON. In the past I've found that JSON is much cleaner to read, and
> > much easier to represent data str
Hello All,
This sounds great!
http://codemonkeyism.com/clojure-scala-part-2/
Regards,
Emeka
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups
(I know this has been mentioned and referenced a number of times
already in this forum, but I have crossed some imaginary line to
"officially done" so I thought I'd put up an official announcement.)
The automatic documentation for the clojure-contrib library is now up
at http://richhickey.github.
It might sound good to someone new to Clojure, and Lisp as a whole,
but you could ask almost any experienced Lisper, and he'll gladly tell
you that he believes the parentheses only serve to make the code more
readable. It looks weird coming from another language, but once you've
used the parenthes
On Aug 25, 5:51 pm, tmountain wrote:
> Clojure 1.1.0-alpha-SNAPSHOT
Maybe it was a bug and they fixed it.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@
> 2. It is NOT simple to do, and IMO unjustified complexity. Maybe it's
> simple to implement superficially, but there would be some ugly,
> inevitable warts, I think?
Furthermore, you cannot eliminate all uses of parentheses — fns,
nested calls, let blocks, etc — so what's the point? Python ha
On Aug 25, 7:26 pm, Christophe Grand wrote:
> no, distinct uses a hash-set (nearly-constant lookup) so distinct is O(n).
Oh, that's great, i will use it.
Thank you.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups
2009/8/24 wangzx :
>
> (defn hello
> "Writes hello message to *out*. Calls you by username.
> Knows if you have been here before."
> [username]
> (dosync
> (let [past-visitor (@visitors username)]
> (if past-visitor
>
Hi all,
after having heard about Clojure for a bit, I started playing around
with it a couple of days ago (which led to this:
http://github.com/citizen428/ClojureX in case anyone is interested).
Anyway, I'm now trying to write a small program which extracts the
enclosure URLs out of an RSS 2.0 f
no, distinct uses a hash-set (nearly-constant lookup) so distinct is O(n).
On Tue, Aug 25, 2009 at 6:19 PM, sebastien wrote:
>
>
> > The simplest I can think of is:
> > (defn make-random-numbers [dim max]
> > (take dim (distinct (repeatedly #(rand-int max)
>
> But distinct itself gives ord
Isn't the audio part of the JDK something that Sun wasn't able to open
source because of licensing issues? I recall that openjdk had issues
in that area initially at least, I haven't looked recently.
-- Aaron
--~--~-~--~~~---~--~~
You received this message because
> The simplest I can think of is:
> (defn make-random-numbers [dim max]
> (take dim (distinct (repeatedly #(rand-int max)
But distinct itself gives order of growth O(n!), through it scans
resulting list for every generated number, isn't it?
--~--~-~--~~~---~--~-
Clojure 1.1.0-alpha-SNAPSHOT
java version "1.6.0_14"
Java(TM) SE Runtime Environment (build 1.6.0_14-b08)
Java HotSpot(TM) Server VM (build 14.0-b16, mixed mode)
On Aug 25, 11:10 am, icemaze wrote:
> On Aug 25, 4:50 pm, tmountain wrote:
>
> > I'm pretty sure your issue is that format is a func
On Tue, Aug 25, 2009 at 16:24, Licenser wrote:
>
> Hi everyone,
> I wonder what is the reason clojure uses XML standard wise and not
> JSON. In the past I've found that JSON is much cleaner to read, and
> much easier to represent data structures in. I know XML is a buzzword,
> but JSON is on it's
On Tue, Aug 25, 2009 at 10:36 AM, John Harrop wrote:
> What the hell?
The group actually gets a steady stream of spam, but it
usually gets deleted instead of being sent to everyone. On
this one I accidentally clicked the wrong button. Sorry
about that.
--Chouser
--~--~-~--~~--
Hey, this works! Thanks!!
I was wondering... why doesn't casting work? i.e.
(.open (cast SourceDataLine sdl) fmt (* 48000 2 2))
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, s
Hi,
On Aug 25, 3:29 pm, Baishampayan Ghose wrote:
> It's easy to say, but try imagining how macros will be written when
> there are no parentheses.
Just as before. Macros act on the Clojure structures. So if you have a
reader which is able to read in the "whitespace syntax", the resulting
stru
> Hi everyone,
> I wonder what is the reason clojure uses XML standard wise and not
> JSON.
>
> …
>
> Or do I miss something that makes it important for Clojure to be
> bundled so tightly with XML?
Where did you get the idea that Clojure is tightly bundled with XML?
It uses XML for the build sc
Hi,
On Aug 25, 4:24 pm, Licenser wrote:
> I wonder what is the reason clojure uses XML standard wise and not
> JSON. In the past I've found that JSON is much cleaner to read, and
> much easier to represent data structures in. I know XML is a buzzword,
> but JSON is on it's way to become one too
On Aug 25, 4:50 pm, tmountain wrote:
> I'm pretty sure your issue is that format is a function inside
> clojure.core, so it's causing a conflict. I renamed it, and the code
> seems to work on my machine.
Using another name, unfortunately, doesn't fix the problem here. But
the fact the my program
On Tue, Aug 25, 2009 at 10:24 AM, Licenser wrote:
>
> I wonder what is the reason clojure uses XML standard wise and not
> JSON.
I don't think Clojure has standardized in any way on XML. There just happens
to be an XML parsing lib in Clojure proper because it's a useful thing to
have. There is
Hi,
On Aug 25, 3:57 pm, B Smith-Mannschott wrote:
> Yes, that's precisely the intent. ("...Consider the prefix to be the
> empty string in for attrs declaring a default namespace.")
Oops again. Seems I was also sloppy reading docstrings. :)
Sincerely
Meikel
--~--~-~--~~--
I'm pretty sure your issue is that format is a function inside
clojure.core, so it's causing a conflict. I renamed it, and the code
seems to work on my machine.
(import '(javax.sound.sampled AudioSystem
AudioFormat
DataLine
Hi,
2009/8/25 icemaze :
> (.open sdl format (* 48000 2 2))
Add a type hint to the sdl operand:
(.open #^SourceDataLine sdl fmt (* 48000 2 2))
--
! Lauri
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Clojure"
Hi everyone,
I wonder what is the reason clojure uses XML standard wise and not
JSON. In the past I've found that JSON is much cleaner to read, and
much easier to represent data structures in. I know XML is a buzzword,
but JSON is on it's way to become one too. And yes I know Java uses
XML extensi
On Tue, Aug 25, 2009 at 4:16 PM, sebastien wrote:
>
> What is the most efficient way to generate list of unique random
> numbers? The function must look something like this:
>
> (defn make-random-numbers [dim max]
> )
The simplest I can think of is:
(defn make-random-numbers [dim max]
(
> Why not just use a HashSet rather than a SortedSet to begin with?
Yes, that is clearly better.
-m
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@goog
On Tue, Aug 25, 2009 at 15:44, Meikel Brandmeyer wrote:
>
> Hi,
>
> here's my try using for:
>
> (defn xmlns-attr?
> [k]
> (or (= k :xmlns) (.startsWith (name k) "xmlns:")))
>
> (defn ns-assoc-2
> [attrs xmlns-map]
> (into xmlns-map
> (for [[k v] :when (xmlns-a
On Tue, Aug 25, 2009 at 10:42 AM, Fogus wrote:
>
> A quick and dirty way would be to use a map as your intermediate
> storage with your generated numbers as keys and some constant as their
> assoc'd value. Once you've populated said map with the proper number
> of entries (keeping track of clash
A quick and dirty way would be to use a map as your intermediate
storage with your generated numbers as keys and some constant as their
assoc'd value. Once you've populated said map with the proper number
of entries (keeping track of clashes along the way) then get a
sequence using `(seq (.keySet
What the hell?
--~--~-~--~~~---~--~~
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
Hi again,
On Aug 25, 3:44 pm, Meikel Brandmeyer wrote:
> (for [[k v] :when (xmlns-attr? k)]
Oops. Missed the attrs in front of :when.
Sincerely
Meikel
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "
What is the most efficient way to generate list of unique random
numbers? The function must look something like this:
(defn make-random-numbers [dim max]
)
where dim is dimensionality of the vector, and max is the upper bound
of random numbers.
The problem is not to allow duplicates in th
Hi,
I've been struggling with this problem for some time and I don't
understand why this doesn't work. I'm trying to call the "open" method
of a javax.sound.sampled class but it throws the following exception:
No matching method found: open for class
com.sun.media.sound.DirectAudioDevice$Direc
On Tue, Aug 25, 2009 at 15:44, Meikel Brandmeyer wrote:
>
> Hi,
>
> here's my try using for:
>
> (defn xmlns-attr?
> [k]
> (or (= k :xmlns) (.startsWith (name k) "xmlns:")))
>
> (defn ns-assoc-2
> [attrs xmlns-map]
> (into xmlns-map
> (for [[k v] :when (xmlns-a
On Mon, Aug 24, 2009 at 11:23 PM, wangzx wrote:
>
> (defn hello
> "Writes hello message to *out*. Calls you by username.
> Knows if you have been here before."
> [username]
> (dosync
> (let [past-visitor (@visitors username)]
> (if past-visitor
wangzx wrote:
> (defn hello
> "Writes hello message to *out*. Calls you by username.
> Knows if you have been here before."
> [username]
> (dosync
> (let [past-visitor (@visitors username)]
> (if past-visitor
> (str "We
Hi,
here's my try using for:
(defn xmlns-attr?
[k]
(or (= k :xmlns) (.startsWith (name k) "xmlns:")))
(defn ns-assoc-2
[attrs xmlns-map]
(into xmlns-map
(for [[k v] :when (xmlns-attr? k)]
[(-> k name (.replaceAll "xmlns:" "") (.replaceAl
Hello!
I've been playing around with clojure in my spare time for a while now
and am currently experimenting with ideas for querying XML using
clojure. It'll be a while yet before I have something usable, but in
the meantime I'd like some advice regarding one of the functions I'm
writing. Clojure
Hot sale !!! sport shoes Brand shoes fashion t-shirt hat handbag and
so on (.salegood8.com)
Sports shoes
Fashionable style,high quality&reasonable price(.salegood8.com)
Big discount for big order more details pls do not hesitate to
contact us ,(www.salegood8.com)
Yours satisfact
Hi,
if you are an emacs user, this might be interesting for you:
http://www.foldr.org/~michaelw/emacs/
(Scroll down to mwe-color-box.el, with screenshot)
Sincerely
Meikel
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Gro
(defn hello
"Writes hello message to *out*. Calls you by username.
Knows if you have been here before."
[username]
(dosync
(let [past-visitor (@visitors username)]
(if past-visitor
(str "Welcome back, " usern
On Aug 25, 1:47 pm, Dragan Djuric wrote:
> I needed a macro if I wanted to avoid ' in calls. It may seem as
> nitpicking but (to-keyword name) is more readable and less error prone
> than (to-keyword 'name) if I need to use it in lots of places.
If that's all you do, then the easiest approach
In this scenario, I'd probably not try to fight maven and split this into
two modules - api and implementation. Even in a pure java project I'm
tempted to keep them separate (esp. with the OSGi stuff I'm doing, it looks
like this would solve more of our reloading issues).
As the plugin stands curr
Hi Mark
Thank you for the effort! A Meven plugin is something really needed
for any Java environment.
Can you please update the example roject, since the default settings
(the ones from the above-mentioned gist and the docs) does not seem to
work as expected.
Here's what I mean.
I have a projec
we offer cheap sport shoes men's shoe(www.salegood8.com) casual shoe
fashion shoe
basketball shoes(www.salegood8.com) running shoe(www.salegood8.com)
High quality and competitive price for European countries and North
American countries(www.salegood8.com)
hot sale cheap sport shoes men'
This makes me think about a possible improvement.
(stop me if I'm wrong).
I think that your java source classes will only have a compilation
dependency on clojure source if your clojure source generates classes or
interfaces via gen-class / gen-interface.
(If there are other kind of dependencies
And the problem with the plain (keyword x) approach is how the
namespace resolving works in that case. I can see that some things
have been improved in Clojure 1.1 compared to 1.0, but there is still
one thing:
In 1.1. if I call (keyword 'foo/bar) i'll get :foo/bar. OK, because
the namespace is e
If you have the clojure:compile goal bound to the compile phase it runs
-after- the normal java compiler. One solution I've used is just using
multiple modules and keeping the clojure code separate from the java.
However, if your only talking TO java from clojure this might not be a
problem.
--
How does it work if you have both Java and Clojure code in the same
project? Which is compiled first?
On Tue, Aug 25, 2009 at 12:46 PM, Mark Derricutt wrote:
> For my own usages I've just been using IDEAs native maven support and
> opening the pom.xml - This sadly doesn't pick up the source direc
I needed a macro if I wanted to avoid ' in calls. It may seem as
nitpicking but (to-keyword name) is more readable and less error prone
than (to-keyword 'name) if I need to use it in lots of places.
On Aug 24, 8:38 pm, Achim Passen wrote:
> Hi!
>
> Am 24.08.2009 um 18:31 schrieb Dragan Djuric:
For my own usages I've just been using IDEAs native maven support and
opening the pom.xml - This sadly doesn't pick up the source directories
thou.
--
On Tue, Aug 25, 2009 at 7:33 PM, Laurent PETIT wrote:
> Excellent, thanks Mark for this contribution !
>
> When time permits, I'll undoubtedly gi
For a bleeding edge/nightly build of clojure-lang and clojure-contrib I'm
using the repository at:
http://tapestry.formos.com/maven-snapshot-repository
groupId of org.clojure
artifact of clojure-lang / clojure-contrib
--
On Tue, Aug 25, 2009 at 5:35 PM, ngocdaothanh wrote:
>
> I want to ask
Hi,
On Aug 24, 8:51 pm, Konrad Hinsen wrote:
> > Yes. The trick is that
> > (keyword 'x/y)
> > is different from
> > (ns x)
> > ::y
>
> Not in my copy of Clojure:
>
> user=> (ns x)
> nil
> x=> ::y
> :x/y
> x=> (identical? ::y (keyword 'x/y))
> true
This does not work in Clojure 1.0. As well as
Excellent, thanks Mark for this contribution !
When time permits, I'll undoubtedly give a thorough look at it, and see how
I can integrate this with Counterclockwise (new name for clojure-dev eclipse
plugin).
Something like a mvn clojure:eclipse that could extend the eclipse:eclipse
goal for initi
79 matches
Mail list logo