On Sat, Aug 28, 2010 at 07:00, Stuart Sierra the.stuart.sie...@gmail.comwrote:
On Aug 27, 3:42 pm, B Smith-Mannschott bsmith.o...@gmail.com wrote:
This thread got me thinking that when a namespace is partially promoted
to
Clojure proper, it might be good to provide a reduced version of the
It happens like this:
In my keyboard, I get } with AltGr-0
Now, if I type { :a { :b C } }, and hold space down while typing
AltGr-0, I get ArrayIndexOutOfBounds. In the screen there is no
difference when holding the space down.
Also, if i hold AltGr down after typing { (AltGr-7) when pressing
I implemented the Flavius Josephus algorithm from Programming Praxis
in Clojure using loop/recur. My first version looked like this:
(defn rotate-left
([ln n m]
(take n (drop (dec m) (cycle ln
([ln m] (rotate-left ln (count ln) m)))
(defn josephus3 [N M] ;; execute every mth soldier
Hello,
I'm using the clojure.contrib.logging library (logging/spy seems very
useful!) but I don't know which file it's writing to. Can you please
advise?
Thanks,
Wei
--
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to
I took a stab at it and came up with this:
(defn make-reader [s]
(java.io.PushbackReader. (java.io.CharArrayReader.
(into-array Character/TYPE (seq s)
(defn read-with-number
like read but takes in a string and returns a function
of no arguments which will
Thanks guys. I have mentioned Clojure in the Wikipedia entry for
Docstrings at: http://en.wikipedia.org/wiki/Docstring
On 19 Aug, 21:22, Paddy3118 paddy3...@googlemail.com wrote:
Hi, Does clojure have docstrings:http://en.wikipedia.org/wiki/Docstring
and, if so, do you have a link to the
Hello,
I'm trying to use type hints in protocols and records, but I found
some strange behavior.
As an example, if I use:
(defprotocol test
(test-fn [a ^String b]))
the type hint in test-fn is parsed correctly (or at least without
raising an error), but then...
(defrecord test-record [x y
So, any time I want to declare a local variable (inside a function for
example), I use let form.
On Aug 26, 8:26 pm, nickikt nick...@gmail.com wrote:
Its for defining look variables (constants) that you use more then
once in your form and not have to write it more then once (or
calculated it
Fine,
I'll post entire project in a tar file this week end and will come back with
the URL before Sunday night. Need to complete urgent work in the garden today :)
Luc P.
Phil Hagelberg p...@hagelb.org wrote ..
On Fri, Aug 27, 2010 at 8:06 PM, lprefonta...@softaddicts.ca wrote:
I got it
Hey,
I came across this method:
(use '[clojure.contrib.lazy-seqs :only (primes)])
(def ordinals-and-primes (map vector (iterate inc 1) primes))
map macro has this format:
(map function collection)
primes is the collection and (iterate inc 1) is the function to apply
on each element of the
On 27 Aug 2010, at 19:40, santervo wrote:
Also, if i hold AltGr down after typing { (AltGr-7) when pressing
space button, i get this:
user= { :a b }
java.lang.Exception: Unable to resolve symbol: :a in this context
(NO_SOURCE_FILE:0)
Note from the spaces in the error message that
(use '[clojure.contrib.lazy-seqs :only (primes)])
(def ordinals-and-primes (map vector (iterate inc 1) primes))
map macro has this format:
(map function collection)
The map function takes a function and any number of collections:
P.S. something I should of have said: map can take 1 function and more
then one collection. Calling the function with the number of arguments
of collections provided
--
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to
yes, but you can not change it if you start a new (let ...).
On 28 Aug., 16:22, HB hubaghd...@gmail.com wrote:
So, any time I want to declare a local variable (inside a function for
example), I use let form.
On Aug 26, 8:26 pm, nickikt nick...@gmail.com wrote:
Its for defining look
Ok, I understand what it does but I don't understand -yet- how it is
works.
Why vector and its parameters aren't in ( ) ?
What are the parameters to the vector and what are the parameters to
the map in the example?
On Aug 28, 6:12 pm, nickikt nick...@gmail.com wrote:
(iterate inc 1) is not the
thanks David,
Is the support for type hints in protocols planned for future
releases?
Francesco
On Aug 28, 5:10 pm, David Nolen dnolen.li...@gmail.com wrote:
On Sat, Aug 28, 2010 at 9:46 AM, Francesco Bellomi
francesco.bell...@gmail.com wrote:
It is not clear to me if type hints are
Don't forget destructuring:
(for [[a b c] signal]
(map (partial reduce +) [a b c]))
and,
((fn [[[a b c][d e f]]]
(map (partial reduce +) [a b c d e f]))
signal)
While messing around with that, I was wondering if there were some
function that allowed you to destructure on-demand.
Like,
=
On Sat, Aug 28, 2010 at 8:37 AM, HB hubaghd...@gmail.com wrote:
Ok, I understand what it does but I don't understand -yet- how it is
works.
Why vector and its parameters aren't in ( ) ?
What are the parameters to the vector and what are the parameters to
the map in the example?
vector is
A reader macro for destructuring might be nifty, like #[...].
So you could do things like:
(#(map (partial reduce +) #a b c][d e f]]] %]) signal)
Not sure if that'd be the right syntax, but you get the point.
On Sat, Aug 28, 2010 at 12:08 PM, John Newman john...@gmail.com wrote:
Don't
For the past week or two, I've been investigating what it would take
to write something that would allow *.clj and *.java files to
seamlessly compile together, such that they could be freely intermixed
in a project. I knew it was a difficult problem, but I think the
adoption benefits would be
My apologies, the title got cut off. It should be:
Is it possible in theory to write/modify a Clojure compiler that
doesn't resolve Java references?
On Aug 28, 12:50 pm, Luke VanderHart luke.vanderh...@gmail.com
wrote:
For the past week or two, I've been investigating what it would take
to
Providing we're happy with disallowing circular dependencies (which is
what javac and clojure.lang.Compiler do anyway), I wonder if it might
be possible to have a build tool invoke the appropriate compilers on a
file-by-file basis, so that if foo.java depends on a class generated
by bar.clj, which
I'm not just talking about class hierarchy dependencies, but also
reference dependencies.
For example:
Foo.java
class Foo {
public Bar getBar() {...}
}
Bar.java
class Bar{
public Foo getFoo() {...}
}
This is pretty common in the Java world.
What I'd like to do is have Foo be written in
Oh, I also think that mixing and matching Clojure Java modules --
groups of namespaces / classes which would be share a single build
artifact -- is already fairly simple, whereas I'm not sure if mixing
and matching at the level of individual source files -- with
dependency chains like foo.java -
On 28 August 2010 19:19, Luke VanderHart luke.vanderh...@gmail.com wrote:
I'm not just talking about class hierarchy dependencies, but also
reference dependencies.
Ah, I see. In that case, maybe generate placeholders for all the
classes to be implemented in Clojure (with all methods doing
On Sat, 28 Aug 2010 12:23:04 -0400
John Newman john...@gmail.com wrote:
A reader macro for destructuring might be nifty, like #[...].
I don't think so.
But first, we already have an on-demand destructuring facility: let.
So you could do things like:
(#(map (partial reduce +) #a b c][d
On 28 August 2010 19:27, Michał Marczyk michal.marc...@gmail.com wrote:
On 28 August 2010 19:19, Luke VanderHart luke.vanderh...@gmail.com wrote:
I'm not just talking about class hierarchy dependencies, but also
reference dependencies.
Ah, I see. In that case, maybe generate placeholders for
c.c.logging just delegates to the underlying logging implementation.
If you haven't included a separate logging library on your classpath
(e.g., log4j) then it will default to using java.util.logging. Note
that by default the j.u.logging will output to stdout, and has a
default threshold of INFO.
On Fri, Aug 27, 2010 at 11:00 AM, Emeka emekami...@gmail.com wrote:
Mark,
Can JavaFX do that?
Regards,
Emeka
I don't know that much about JavaFX, but my understanding is that it
was born out of Sun's desire to compete with Adobe's Flash/Flex/AIR.
Similarly, Silverlight is Microsoft's effort
Hi,
2010/8/18 Sean Corfield seancorfi...@gmail.com
On Wed, Aug 18, 2010 at 1:36 PM, Greg g...@kinostudios.com wrote:
Attached is a screenshot of some code from the wonderful Incanter
library. I think it's a great illustration of how confusing stacking
parenthesis can be (there are many
On Aug 28, 1:41 am, Robert McIntyre r...@mit.edu wrote:
I took a stab at it and came up with this:
is that what you're going for?
I was actually asking how to avoid doing what you did :-). If it's
necessary to do it, that's fine, but I thought I'd ask first, in case
there was a way around it
#%3 %2 %1][%4 %5 %6]]] signal] - [c b a d e f]
Right, the names are superfluous. So are the extra set of brackets I
guess. Perhaps even better would be:
(#[[_ _ _][_ _ _]] signal)
Or if you wanted just the third item of the second collection:
(#[[][2]] signal)
Also, I took the signal
This sounds very similar to groovyc:
http://groovyland.wordpress.com/2009/03/03/groovyscalajava/
On Aug 28, 12:50 pm, Luke VanderHart luke.vanderh...@gmail.com
wrote:
For the past week or two, I've been investigating what it would take
to write something that would allow *.clj and *.java
On Sat, 28 Aug 2010 18:11:41 -0400
John Newman john...@gmail.com wrote:
#%3 %2 %1][%4 %5 %6]]] signal] - [c b a d e f]
Right, the names are superfluous. So are the extra set of brackets I
guess. Perhaps even better would be:
(#[[_ _ _][_ _ _]] signal)
Or if you wanted just the
Hm, thanks for the reference to that groovy thread... an interesting
read.
I might take a stab at writing a *generate-stubs* patch to Clojure's
compiler, just to see how hard it would be to do.
Out of curiosity, if Rich or anyone on the dev team reads this, is
this the sort of thing that might
On Sat, Aug 28, 2010 at 1:10 PM, Laurent PETIT laurent.pe...@gmail.com wrote:
I did find the 4 char indents easier to read than the 2 char indents.
I wish CCW respected the displayed tab width setting as its
indentation in strict structural mode as I'd rather have 4 spaces than
2 but it seems
On 29 August 2010 00:11, John Newman john...@gmail.com wrote:
I am going to see if I can write a function that does:
= (destructure [[][2]] signal)
(5 6 7 8)
Note that the name is already taken by clojure.core/destructure, which
is the engine behind all destructuring done by Clojure macros:
Hi Phil,
there's a tar file at this url with the entire project skeleton:
http://cid-0bd9c1ec7356c53b.office.live.com/browse.aspx/lein-our-classes-only-0.0.1-SNAPSHOT?Bsrc=GetSharingLinkBpub=SDX.Docs
I added a README file. There is a small twist when building the target.
For those having the
On Aug 19, 12:08 pm, Brian Goslinga quickbasicg...@gmail.com wrote:
Here is another trick that works for me in Emacs: delete most of the
stack of closing parens, and then spam the ) key until the Emacs
matches it to the desired opening paren.
this.
--
You received this message because you
39 matches
Mail list logo