I think you are right, when ever the function returns a closure I get the
exception. I think it should work with closures anyhow.
--
-jarppe
On Sunday, December 16, 2012 7:49:30 PM UTC+2, juan.facorro wrote:
>
> I think it has to do with the closure in the *fn *used when generating
> the form
London Clojurians has a periodic update of who's using Clojure in
production.
The latest thread is here:
https://groups.google.com/forum/?fromgroups#!topic/london-clojurians/ES8AuxXI0Nk
There are a few here that haven't been mentioned elsewhere such as
Likely.co, MastodonC, uSwitch, Trampoline,
Symbols are functions. See
http://clojure.org/data_structures#Data%20Structures-Symbols
Thanks,
Ambrose
On Mon, Dec 17, 2012 at 12:12 PM, Paul Sholtz wrote:
> I was messing around with the Clojure interpreter and typed this:
>
> user=> ('+ 3 4)
>
> The interpreter responded with "4".
>
> That's
I was messing around with the Clojure interpreter and typed this:
user=> ('+ 3 4)
The interpreter responded with "4".
That's odd (but interesting)..
Clearly if I had typed (+ 3 4), it would have responded with 7, and it I
had typed '(3 4), it would have responded with a list (3 4), but why do
Hello,
After a very long three weeks without a home internet connection, I've
finally gotten around to releasing version 0.2.10 of lein-cljsbuild. Thank
you all for your patience, I know that there hasn't been a release in a
while!
This release will default to using the upstream ClojureScript
When I move it off of wordpress I will use highlight.js. Unfortunately I'm
using a free hosted wordpress.com site and can't install plugins. So it
looks like I'm out of luck for now. If I end up keeping this blog up, I'll
pay the couple of bucks and move it to a real host and setup the plugin
Hi, Ray.
When you are doing things that have a relational algebra feel to them
(joins, etc.), you might want to consider the fns in the clojure.set
namespace. E.g.:
;; convert vectors of records to sets, then:
> (clojure.set/join
(clojure.set/rename items {:id :iid :name :iname}) ; to p
The problem if you dive into Java is that it may bring to your attention a
myriad of details
that may not be worth the trouble of learning if you do not expect to
dive into Java and stay on the Clojure side of the fence.
No ready-fit light reading comes to my mind. Maybe a "learn java in 21 days"
It depends on the relationship between args. If the second arg narrows the
semantic
of the first and so on, 4th arity fns may not be hard at all. Otherwise it may
confuse the reader.
> Any time I'm tempted to adda 3rd arity to a function I strongly consider
> using keyword args.
>
> On Sun, D
Thank you, gentlemen. Jim and Luc, your answers are both helpful. Luc's
answer illustrates why a Java tyro often has problems understanding
Clojure. Somebody like me who is trying to master Clojure, having come
to it via a language path that doesn't include Java, needs a
prerequisite crash cour
I would say that above 4 args, it starts to exercise your memory except if you
have auto-completion and a tool tip provided by your IDE.
Optional arguments are better handled with keywords than with an option map or
multiple signatures.
This the area were you can get lost. At least with keyword de
I think one of the main reasons we don't use keyword arguments
everywhere is their verbosity. Most function names implicate the order
of arguments, and many functions don't take more than two or three.
It's a trade-off between how much a programmer has to remember and how
much he has to code.
On
I remember in Rich Hickey's talk "Simplicity Matters", he mentioned that
forcing the user to remember the order of function arguments, as opposed to
using keyword arguments, is overly-complex; yet, reading Clojure source
code and looking at the standard functions, I find that keyword arguments
Interesting idea. Let me ponder that.
When one starts pulling on a thread like metadata for example, all kinds of
interesting facets pop up. That's what I meant with my comment about the XP
practices graph thing. Different Clojure capabilities support and enable
other capabilities, and you need
Thanks, I won't forget the REPL.
I think, however, that there is a risk of a disconnect, where newcomers
don't really grasp that there is a JVM running and that code is actually
compiled and injected into it, and that it's for real. They are used to
mickey mouse interactive tools that don't pr
I think showing people how metadata works usually makes people start dreaming,
and exposes them to docstrings and arglists which I think is crucial to
self-directed learning.
So, I think I'd show them: (doc ...), and then show how that is metadata, and
for quicker folks you could show how to ad
On Dec 14, 2012, at 10:41 PM, cameron wrote:
> Until Lee has a representative benchmark for his application it's difficult
> to tell if he's
> experiencing the same problem but there would seem to be a case for changing
> the PersistentList
> implementation in clojure.lang.
We put together a ve
On Dec 15, 2012, at 1:14 AM, cameron wrote:
>
> Originally I was using ECJ (http://cs.gmu.edu/~eclab/projects/ecj/) in java
> for my GP work but for the last few years it's been GEVA with a clojure
> wrapper I wrote (https://github.com/cdorrat/geva-clj).
Ah yes -- I've actually downloaded and
Hilarious - I am so conditioned already to have everything in a list :)
Thanks for your patient explanation. Merry xmas.
ray
Ray
On Sunday 16 December 2012 at 22:20, Benjamin R. Haskell wrote:
> On Sun, 16 Dec 2012, mond wrote:
>
> > One small thing Ben... when I try to use the final formu
On Sun, 16 Dec 2012, mond wrote:
One small thing Ben... when I try to use the final formulation I receive an
error:
(def joined-products (map product-with-item products))
user=> (joined-products)
ClassCastException clojure.lang.LazySeq cannot be cast to clojure.lang.IFn
user/eval241 (NO_SOUR
One small thing Ben... when I try to use the final formulation I receive an
error:
(def joined-products (map product-with-item products))
user=> (joined-products)
ClassCastException clojure.lang.LazySeq cannot be cast to clojure.lang.IFn
user/eval241 (NO_SOURCE_FILE:9)
Any ideas?
Thanks in a
> My plan was to do something like this:
>
> *First half of the day*
>
> 1. install Leiningen and learn the basics
> 2. get everyone an editing environment, with the option of using either
> Emacs, IntelliJ, or Eclipse
> 3. teach the basics and let everyone follow along in their own environment
Good points, thanks.
It's so easy to overload them, because one wants to teach them every little
piece of gold that's in there. I think it was in one of the old XP books,
where there was this graph that showed which practices were supported by or
enabled other practices. I would love to see so
I don't know why it doesn't work. However, changing defgreeter to the
following seems work.
(defmacro defgreeter [greeter-name]
(let [greeter (make-greeter)]
`(def ~greeter-name ~greeter)))
Might be a clue. :)
Jonathan
On Sun, Dec 16, 2012 at 6:49 PM, juan.facorro wrote:
> I think it ha
First example tries to access a public static field in the Math class.
Second example calls the static member function of the Math class.
The difference is in the missing set of parenthesis.
A static field or member function is attached to the class, not to a specific
object
and can be accessed
Java methods are not first-class...you cannot use them like that...you
need an object to call the method on...by wrapping the java call with an
anonymous fn you are able to use Math/sqrt as 1st-class...
Hope it is clearer now...
Jim
On 16/12/12 19:33, Larry Travis wrote:
It almost certainly h
> However, the fact that you can write funcall so easily as #(%1 %2)
> illustrates that funcall adds no real expressiveness to the language,
> whereas apply is really fundamental to being able to pass lists to
> multi-arg functions. It's hard to imagine how to write apply at all if it
> were
It almost certainly has something to do with my abysmal ignorance about
things Java, but I don't understand this difference:
(1)
user> (map Math/sqrt [5 6 16])
Unable to find static field: sqrt in class java.lang.Math
[Thrown class java.lang.RuntimeException]
(2)
user> (map #(Math/sqrt
On Sun, Dec 16, 2012 at 10:04 AM, Marko Topolnik
wrote:
>
> Well, why don't you start with my example? Try rewriting this without OP's
> *apply*, implemented here as #(%1 %2).
>
> (defn apply-curried [f & args] (reduce #(%1 %2) f args))
>
>
>
To avoid confusion, I'm going to refer to the OP's con
On Sun, Dec 16, 2012 at 10:06 AM, Armando Blancas wrote:
> I'm not going out of my way to be pseudonymous, it just seems to be a
>> feature of the group.
>
>
>>
>
> I thought, Mark asking how to run a script? An usurper!
>
>
>
Ah yes. My understanding of Clojure runs fairly deep, but when it com
>
> I'm not going out of my way to be pseudonymous, it just seems to be a
> feature of the group.
>
I thought, Mark asking how to run a script? An usurper!
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to c
> As for your suggestion of a (funcall f [i]) that behaves just like (f
> [i]), I can't imagine any possible purpose for that in Clojure. Why would
> you not just write (f [i])?
>
Well, why don't you start with my example? Try rewriting this without OP's *
apply*, implemented here as #(%1 %
On Sun, Dec 16, 2012 at 2:59 AM, Peter West wrote:
So it sounds like you just thought apply was something other than the
list->arguments adapter that it is. One of the best resources for learning
about clojure's functions is clojuredocs.org. Most of the functions are
accompanied by a number of
I think it has to do with the closure in the *fn *used when generating the
form in the macro.
If you change this function:
*(defn make-greeter []*
* (let [message "hello"]*
*(fn [user-name]*
* (str message ", " user-name*
To this one:
*(defn make-greeter []
*
* (fn [user-name]*
Hi Aaron,
On Sunday, 16 December 2012 04:45:16 UTC+5:30, Aaron wrote:
>
> Cool. I'm just seeing this now. I actually spent some time a while back
> getting a very simple nleiningen working in ClojureCLR. I had nuget
> downloads working and also the ability to AOT compile namespaces and merge
Hi,
I have this macro (complete file https://www.refheap.com/paste/7633):
*(*defmacro defgreeter [greeter-name]
*(*let [greeter *(*make-greeter*)*]
`*(*do
*(*defn ~greeter-name [user-name#]
*(*~greeter user-name#*)**)**)**)**)*
It works as expected when make-greeter is
I did some changes.
First and foremost, I change the project's name to a more formal one: it
has became clj-javafx and the link is now
https://github.com/chrix75/clj-javafx
I cleaned the code too, thus:
- I remove the ugly Thread/sleep for promise and deliver
- make the code cleaner
L
> If you are looking, for some reason I can't imagine at the moment, for a
> function that acts just like a funcall, so that
> (funcall f [i]) is exactly equivalent to (f [i]), I guess you are out of
> luck.
>
I can give you a reason: applying a curried function. On first sight that
may seem
>
> Users of clojure learn that pretty quickly. I've just learned it. Doc
> doesn't help.
> user=> (doc apply)
>>
>> -
>>
>> clojure.core/apply
>>
>> ([f args] [f x args] [f x y args] [f x y z args] [f a b c d & args])
>>
>> Applies fn f to the argument list formed by
Great stuff Ben. Thanks.
ray
On Saturday, December 15, 2012 10:54:42 PM UTC+1, Benjamin R. Haskell wrote:
>
> On Sat, 15 Dec 2012, mond wrote:
>
> > Thanks for picking up the cudgels Ben!
>
> Ha. It's nice to have reached a point where I feel at-all confident
> with any of this... happy to he
Thanks again. I do get it. I'm not saying that apply has effects other than
the result it returns. No, it's not a side-effect; it doesn't change
something in the environment in passing. What it changes is the expected
result, if you expect that, as Rich Hickey is supposed to have written,
(appl
On Sunday, December 16, 2012 5:12:36 AM UTC+1, Armando Blancas wrote:
> Why are you using puzzler's account and what did you did to him?!
>
And who, in your opinion, is puzzler, if not Mark Engelberg?
--
You received this message because you are subscribed to the Google
Groups "Clojure" group
42 matches
Mail list logo