as a side note, since we are within the backquote, simply using r (instead
of ~'r) would not work since it would incorrectly expand to the fully
qualified symbol, e.g. user/r
Gianluca
On Saturday, February 15, 2014 5:49:57 PM UTC+1, Jan Herich wrote:
Hello Eric,
You can rewrite this
(require 'clojure.string)
Im just wondering why the language chose to use the quote form, rather than
a string or a keyword e.g.
(require clojure.string)
(require :clojure.string)
There obviously must be a good reason why.
--
You received this message because you are subscribed to the
In case anyone's interested, I've picked up Geertjan's stuff and started a
repo at https://github.com/rcarmo/netbeans-clojure, since it's minimally
usable already.
There's a tentative roadmap there as well -- feel free to ping me directly
if you want commit access.
Regards,
R.
On Friday,
Thanks, Mikera
You are right about merge:
user= (def m1 (apply hash-map (range 1000)))
#'user/m1
user= (def m2 (apply hash-map (range 500 1500)))
#'user/m2
user= (time (def m3 (merge m1 m2)))
Elapsed time: 5432.184582 msecs
#'user/m3
user= (time (def m4
Wow - that's a pretty big win. I think we should try and get this into
Clojure ASAP.
Are we too late for 1.6?
On Sunday, 16 February 2014 18:48:09 UTC+8, Jules wrote:
Thanks, Mikera
You are right about merge:
user= (def m1 (apply hash-map (range 1000)))
#'user/m1
user= (def m2
I would have thought so - it's only my first cut - seems to work but I
wouldn't like to stake my life on it. It really needs a developer who is
familiar with PersistentHashMap to look it over and give it the thumbs
up...Still, I guess if it was marked experimental ...:-)
Jules
On Sunday, 16
Thinking about it a bit more, it would be good to have an interface e.g.
Spliceable which e.g. 'into' could take advantage of when it found itself
concatenating two seq of the same implementation...
Further digging might demonstrate that a similar trick could be used with
other seq types ?
Symbols are used in Clojure to represent identifiers, and in this case
we're identifying a namespace.
I believe it's also the case that a valid symbol is also a valid namespace
name.
- James
On 16 February 2014 10:39, Andy Smith the4thamig...@googlemail.com wrote:
(require 'clojure.string)
Hi,
It took me some time to get started with clojurescript (on windows/cygwin)
- http://swannodette.github.io/2013/11/07/clojurescript-101/ worked for me.
I'd like to use clojurescript to do some UI component development for
product which is built using webkit/js/jquery. I was wondering if it
This looks very neat, but I was unable to figure out how to use
lispy/clojure-semantic the way you were doing in your screencast. Could you
give a breakdown of how this works?
On Saturday, February 15, 2014 4:46:48 AM UTC+7, Oleh wrote:
Hi all,
As a follow-up to this post -
Hi Everybody,
I get the following error when I do a rseq on a subvec in clojurescript
Uncaught Error: No protocol method IReversible.-rseq defined for type
cljs.core/Subvec: [(:red :clockwise) (:blue :clockwise) (:yellow
:clockwise) (:yellow :clockwise) (:orange :clockwise)]
Is this a known
Part of Rich's objection to not-nil? variants could be that they are a
double negative, not-(no value)?, which can decrease clarity and require
more coffee.
- nil Means 'nothing/no-value'- represents Java null and tests logical
false [clojure.org/reader]
To compete with some?
Hi,
Happy to announce the first version of
typed-clojure-modehttps://github.com/typedclojure/typed-clojure-mode,
an emacs
minor mode for Typed Clojure.
Thanks to John Walker who wrote the core functionality, he earned this open
source
It is now, thanks for the report!
Ticket with patch:
http://dev.clojure.org/jira/browse/CLJS-765
On 16 February 2014 17:48, Sunil S Nandihalli
sunil.nandiha...@gmail.com wrote:
Hi Everybody,
I get the following error when I do a rseq on a subvec in clojurescript
Uncaught Error: No protocol
You're right :) When I isolated the issue thanks to some help it turns out
java.jdbc is working fine but I wasn't getting the resultset output
properly in the function. So got it resolved and working like this:
(defn get-member [id]
(let [id (parse-int id)
member (first
Hi all.
We here at Metosin have been developing and using a bunch of small
utilities for Ring-based web api development. Here they are:
*1) ring-http-response *(https://github.com/metosin/ring-http-response)
Real http status codes for Ring - ported from Spray[1]. There is a response
function
I was inches away from reinventing something like this for our company's
codebase. Maybe you saved us the trouble :-).
Will definitely check it out.
On Sun, Feb 16, 2014 at 3:20 PM, Tommi Reiman tommi.rei...@gmail.comwrote:
Hi all.
We here at Metosin have been developing and using a bunch
Hi John,
Your solution is perfectly valid and optimal for the problem I
described above.
Unfortunately, I forgot to mention an additional constraint: sometimes I do:
(let [ foo (:some-selector @data-atom) ]
(swap! data-atom update-in [:other-selector] ... ))
which the - doesn't quite
Yer welcome please do let me know how this works out for you! I've
updated the gist[1] to delay more parts of the whole computation and
replace most occurrences of `reduce` with `loop` - altogether leading
to an almost 2x faster result for the worst case scenario where all
test clauses are
You can use a ref instead of an atom. And use dosync with multiple alter,
so everything is safely inside a transaction.
On Feb 16, 2014 2:04 PM, t x txrev...@gmail.com wrote:
Hi John,
Your solution is perfectly valid and optimal for the problem I
described above.
Unfortunately, I
I believe that's the STM approach, which has the advanrtage of:
* can synchronize across multiple pieces of data
but has the disadvantage of:
* work must be pure since it can be retried
* possibly less efficient due to possibility of retrying
In the example I posted above, I only need
Hi,
Disclaimer - I am completely new to Clojure. I just implemented my very
first (simple) program, letting me find out, from a GPX file, how much time
is spent in the various heart rate zones. Now that it's working, I'm
reviewing the code and trying to use best practices. From what I have
I am unable to find a style file that supports clojure code in LaTeX. Can
anyone point me in the right direction?
Thanks,
Mark
--
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
to me it seems that you are anyway relying on the assumption that the
sequence is ordered, so I think it would be convenient to drop the ands
Gianluca
On Sunday, February 16, 2014 11:31:46 PM UTC+1, Laurent Droin wrote:
Hi,
Disclaimer - I am completely new to Clojure. I just implemented my
I'm also very new to clojure but this is how I'd do it:
(def hr-zones {
[0 100] :low
[101 120] :fat-burn
[121 140] :aerobic
[141 160] :anaerobic
[161 333] :max})
(defn hr-zone [hr]
(some (fn [x]
(and (= (first (key x)) hr (second (key x)))
(val x)))
hr-zones))
I'm afraid your understanding of atom swap! operations is not quite correct
- update function must (or should) be pure as well.
See the
documentationhttp://clojuredocs.org/clojure_core/clojure.core/swap!for swap!,
update function could be potentially called multiple times if
there are more
It works pretty seamlessly.
You will need to include a jquery externs file to avoid munging of function
call names by the google closure compiler in advanced mode.
See also
https://github.com/ibdknox/jayq
Which adds a few simplifications to usage (particularly some protocols for
jQuery
Hi Jan,
You're right. I'm wrong.
I'm grateful you pointed this out -- this would have otherwise been
impossible to debug.
===
To everyone:
Why can swap! be retried? This confuses me -- to implement swap!, why can't we
* have a lock
* ensure that only one
I realized I could use that at some of my code so I wrote it. Not sure if
it's the best possible implementation but here it is:
(defn quantizer
Returns a function that quantizes input data which when called with 'x'
returns: o 1st val if-Inf x = 1st bound o 2st val if 1st
bound
I like Alex's suggestions. Another option is something rather than
some or exists. Something has the disadvantage that it's long, so
when you combine it with addition strings, you get something even longer.
On the other hand, for me both some and exists sound like existential
quantifiers
Just because you are using jQuery extensively in your JS codebase
doesn't mean you need jayq/jQuery in your ClojureScript code. If you
are trying to do inter-op and call some of your JavaScript code from
your ClojureScript code, then you can simply use standard JavaScript
inter-op; if you want to
On Sunday, February 16, 2014 6:05:24 PM UTC-5, puzzler wrote:
I am unable to find a style file that supports clojure code in LaTeX. Can
anyone point me in the right direction?
Pygments can output LaTeX. (There is also minted)
HTH
--
You received this message because you are subscribed to
Thank you Dave and David,
Regards,
Kashyap
On Monday, February 17, 2014 8:26:25 AM UTC+5:30, David Della Costa wrote:
Just because you are using jQuery extensively in your JS codebase
doesn't mean you need jayq/jQuery in your ClojureScript code. If you
are trying to do inter-op and call
I can't claim to be an experienced Clojure developer, specially so
regarding maintainability as I'm the only reader of what I write. Andy
provided a great piece of code, although I scratched my head for a second
or two unwrapping the last two lines. You'll be surprised how often
(partition *
Hi t x,
I think, that lock-free approach an it's semantics is more in line with
other Clojure reference types such as refs.
It also encourages you to only use pure functions for state transitions,
among other things, such as significant
performance benefits in comparison with lock based
35 matches
Mail list logo