On Sat, Aug 28, 2010 at 07:00, Stuart Sierra wrote:
> On Aug 27, 3:42 pm, B Smith-Mannschott 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 old
> > namespace, providing just the funct
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 pres
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 soldie
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 t
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 r
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 wrote:
> Hi, Does clojure have docstrings:http://en.wikipedia.org/wiki/Docstring
> and, if so, do you have a link to the feature in the Clojure
> docu
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 z]
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 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 more then once)
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 wrote ..
> On Fri, Aug 27, 2010 at 8:06 PM, wrote:
> > I got it working with the our-classe-only plug-in.
>
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 collect
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 t
> (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:
http://clojure.github.com/clojure/clojure.core-a
(iterate inc 1) is not the function vector is
what you do is call vector with the first of primes and (iterate inc
1)
so the first things map does is
(vector 1 2) => [1 2]
(vector 2 3) => [2 3]
(vector 2 5) => [3 5]
meaning the first is the index number the second is the corresponding
prime numb
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
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 supported in protocols, and if
> so, how I can use them.
>
> thanks in advance, Francesco
>
Hints are not supported in protocols as far as I can tell. They are
suppor
yes, but you can not change it if you start a new (let ...).
On 28 Aug., 16:22, HB 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 wrote:
>
> > Its for defining look variables (constants) that you use mor
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 wrote:
> (iterate inc 1) is not the function vector is
thanks David,
Is the support for type hints in protocols planned for future
releases?
Francesco
On Aug 28, 5:10 pm, David Nolen 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 supported in protocol
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 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 used as a 'functio
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 wrote:
> Don't forget destructuring
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 subs
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
wrote:
> For the past week or two, I've been investigating what it would take
> to write something that woul
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
What is the primary goal you're trying to achieve?
Specifically, something that is not addressed by e.g. a maven project
with both clojure and java source (which works seamlessly out of the
box)?
I realize it's not the same thing; perhaps you're after making a
single compiler invocation for perfo
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 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 something
like "throw new Run
Hi
On 28 August 2010 02:25, neveu wrote:
> 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)
On Sat, 28 Aug 2010 12:23:04 -0400
John Newman 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 e f]]] %])
On 28 August 2010 19:27, Michał Marczyk wrote:
> On 28 August 2010 19:19, Luke VanderHart 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 Cloj
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 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 to compete in that
Hi,
2010/8/18 Sean Corfield
> On Wed, Aug 18, 2010 at 1:36 PM, Greg 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 functions in there that are like this).
>
On Aug 28, 1:41 am, Robert McIntyre 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 that I had
On 28 August 2010 22:14, evins.mi...@gmail.com wrote:
> 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 that I hadn't noticed.
Well, some level of reimplementation will probably
> #%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
wrote:
> 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 compil
On Sat, 28 Aug 2010 18:11:41 -0400
John Newman 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 third ite
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 po
On Sat, Aug 28, 2010 at 1:10 PM, Laurent PETIT 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 2 is pretty mu
On 29 August 2010 00:11, John Newman 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:
user> (let [[
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=GetSharingLink&Bpub=SDX.Docs
I added a README file. There is a small twist when building the target.
For those having the s
On Aug 19, 12:08 pm, Brian Goslinga 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 are subscribed to the G
See also
http://edward.oconnor.cx/elisp/hl-sexp.el
(Highlights the "innermost list structure".)
Sincerely,
Michał
--
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
45 matches
Mail list logo