Here's the refactored version.user> (def example
(ref
[{:id 1 :email {"a...@mail.com" 1}}
{:id 2 :email {"d...@mail.com" 1}}
{:id 3 :email {"g...@mail.com" 2}}
{:id 4 :email {"f...@mail.com" 2}}]))
#'user/example
user>
(defn
Thanks for all your suggestions. Seems like a useful addition to
clojure.zip to me.
--
--
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 - pl
Hi,
Am Mittwoch, 12. Juni 2013 06:39:59 UTC+2 schrieb Kelker Ryan:
>
> user> (defn update-counter [id xs]
>
> (let [at-after (drop-while #(not= id (:id %)) @xs)
> to-modify (-> at-after first :email)
> mod-key (-> to-modify keys first)
> location (
Hi Plínio,
At Prismatic (getprismatic.com), our entire backend (web crawling, machine
learning, topic modeling, real-time ranking, API, web-servers, ...) is
written in Clojure, and our frontend is moving towards 100% ClojureScript
-- you can check out our blog at http://blog.getprismatic.com/ f
I've seen some interesting responses, but here's my solution. user> (def example
(ref
[{:id 1 :email {"a...@mail.com" 1}}
{:id 2 :email {"d...@mail.com" 1}}
{:id 3 :email {"g...@mail.com" 2}}
{:id 4 :email {"f...@mail.com" 2}}]))
#'user/example
user>
Come on. JavaScript is an awesome and misunderstood language =)
Thank you all for your help. I have lots of examples to show where we're
using Clojure.
Plínio
On Jun 11, 2013 10:20 PM, "Eric MacAdie" wrote:
> OT, but, personally, I look forward to a world free of Javascript.
>
> On Tue, Jun 1
Solutions seem to depend on whether you have two or more mail addresses in
a ':emails' section or not.
If you have, you should identify the mail address of which you want to
increment the value.
Anyway, try below:
(dosync
(alter result
(fn [v]
(mapv second
(update-in (into {}
OT, but, personally, I look forward to a world free of Javascript.
On Tue, Jun 11, 2013 at 4:38 AM, Bruce Durling wrote:
> Hey!
>
> Oh, and we use clojure for all of our stuff at Mastodon C that isn't
> html or javascript and I think the javascript's days are numbered.
>
> cheers,
> Bruce
>
> --
On Tue, Jun 11, 2013 at 3:33 PM, Andy Fingerhut wrote:
>
> I haven't done anything but think about it during commute time yet, but I
> had been wondering in how many situations it might be useful to have a
> string type that was something like Relaxed Radix Binary trees, in that
> they can be conc
On Jun 11, 2013, at 2:08 PM, Tj Gabbour wrote:
> Interesting; these arguments sound oddly like those surrounding Common Lisp's
> "loop" macro. When reading Midje's docs, I got the weird impression Brian was
> aware of the history of "non-lispy" macros.
I was a Common Lisp user and implementor
Here's another link:
http://java-performance.info/changes-to-string-java-1-7-0_06/
--
--
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 - pleas
This is the easiest way to swap the keys with the values in a hash-map.(defn flip-map [m]
(zipmap (vals m) (keys m)))
#'user/flip-map
user> (def m1 (apply hash-map (range 8)))
#'user/m1
user> m1
{0 1, 2 3, 4 5, 6 7}
user> (def m2 (flip-map m1))
#'user/m2
user> m2
{7 6, 5 4, 3 2, 1 0} 11.06.2013,
On Jun 11, 2013, at 10:02 AM, JeremyS wrote:
> Now, opinion time (more opinionated actually). Midje might be full of macros
> and abstractions that I don't understand when I read the code. Hell it's full
> of them. But I honestly never had to read it to write my tests. More It's
> well docume
And to answer my own question about a reference for this change in
behavior, which appears to have been made in Java 7:
http://stackoverflow.com/questions/16123446/java-7-string-substring-complexity
Andy
On Tue, Jun 11, 2013 at 3:33 PM, Andy Fingerhut wrote:
> Mark,
>
> I had not heard about
Mark,
I had not heard about Java changing the substring operation from O(1) to
O(n). Do you have a link to any further info about this change?
I'm guessing that the implementation is changing from the O(1) "create a
new String object that is a reference to a portion of the original String
object
I wrote a function for this in
laser.
https://github.com/Raynes/laser/blob/e351444a09e5c81b900767e955edf62558c33fd6/src/me/raynes/laser/zip.clj#L38
(defn zipper?
"Checks to see if the object has zip/make-node metadata on it (confirming it
to be a zipper."
[obj]
(contains? (meta obj) :zi
On 12 June 2013 00:08, Steven Degutis wrote:
> Right now they both point to test2.api.asserters/*assertion-results*. But
> I'd really like to get rid of the concreteness of this if possible. But even
> throwing exceptions to indicate assertion results won't do, because the
> specific exception cla
Ah, you're right. Thanks for helping me understand.
Now, the runner and discoverer logic are separated.
Here's the function that calls the runner, passing in a finder:
https://github.com/evanescence/test2/blob/master/src/test2/run.clj
Here's the default runner, and how it uses the finder:
https:/
On 11 June 2013 14:42, Steven Degutis wrote:
> Timothy, Brandon, Cedric, et al.:
>
> Separating out the Discoverer from the Runner in the SPEC is a bad idea.
>
> The main benefit mentioned so far for such a separation is so we can have
> different definitions of what constitutes a test. For exampl
Honestly I hadn't yet given it any thought. Thanks for the interest in
having it on Clojurescript. Here are a few issues that come to mind:
1. To achieve performance, I've spent time coding custom data structures
that implement various Clojure and Java interfaces. I haven't done much
with Cloj
Thanks for that link Stu. It's quite a lot to take in but it's very useful.
As for *assertion-results*, it seems this has to be in the implementation,
because both Asserters and Runners need a concrete but detached way to
communicate.
Right now they both point to
test2.api.asserters/*assertion-re
If you're using clojure.zip then a zipper is merely a vector with 3
specific keys (:zip/make-node, :zip/children, and :zip/branch?) in the
metadata which the zipper algorithms use to manipulate and traverse the
data structure. You can trivially check using something like (and (vector?
z) (every
As of this moment, it's usable for writing test suites.
The readme is a lot cleaner now: https://github.com/evanescence/test2
The spec is a lot shoerter now:
https://github.com/evanescence/test2/blob/master/SPEC.md
There's a working auto-runner extension:
https://github.com/evanescence/test2-autor
Thanks for the report Phillip, I've pushed an update that I hope addresses
your issue. Let me know if things aren't fixed.
Cheers, Jay
On Tuesday, June 11, 2013 4:51:08 PM UTC-4, Phillip Lord wrote:
>
> I can't get the nav bar on the left to scroll -- so I can't get to all the
> documentation.
Ok fair enough. Check out the updated gist, I think it more exactly fits
your guidelines.
https://gist.github.com/SegFaultAX/5754209
(defn crypt-range [low high]
(let [chars (map char (range low high))]
(zipmap chars (shuffle chars
(defn make-crypto []
(let [ranges [[97 123] [65 91
Hi,
while working on some XML data extraction I got an NPE which boiled down to
calling some zipper related functions on an empty vector or nil.
I didn't find a function in clojure.zip, clojure.data.zip or
clojure.data.zip.xml to test if an object passed to a function is actually
a zipper.
I can't get the nav bar on the left to scroll -- so I can't get to all the
documentation. The bottom two
also overlap the "isn't github fun" links.
Haven't seen expectations before. Looks really nice.
Phil
From: clojure@googlegroups.com [clojure@googlegr
That was what I was suggesting the other day... I see more value in
providing a standardizing test result format and better reporting
tools / integration with IDEs etc than in YATF (Yet Another testing
Framework).
On Tue, Jun 11, 2013 at 1:18 PM, Brandon Bloom
wrote:
>> Maybe it makes sense to se
Thank you. I will sit down with the code and Clojure references to figure
out what it is doing.
For this problem, I don't want to use the full printable range. That would
make the word problem too difficult. I specifically set mine up to
substitute UPPER for UPPER, lower for lower, digit for d
No worries. It's been on my todo list for awhile, and confusion about features
motivated the actual effort.
--
--
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 me
> Maybe it makes sense to separate out the 'common testing interop' effort
> from the 'another test framework' effort, so it can can get off the ground?
I agree with this. It's easier to solve fewer problems at once. Maybe
you should reduce the scope to just the common result reporting
schema? At
Good idea. Thanks guys, I'll do that.
On Tue, Jun 11, 2013 at 3:18 PM, Brandon Bloom wrote:
> > Maybe it makes sense to separate out the 'common testing interop' effort
> > from the 'another test framework' effort, so it can can get off the
> ground?
>
> I agree with this. It's easier to solve f
2 cents, I don't see the value in mixing and matching lower-level
constructs between test frameworks, which also sounds hard. I see a lot of
value in what the SPEC provides, standardized test-reporting, metadata and
runner infra. This makes tooling's life easier, and would ease the burden
of using
One of the goals is to create extensions that mimic each existing test-lib,
so that migrating to test2 just means changing your :requires.
But there are some tricky spots:
1. I don't fully understand how clojure.test's fixtures plays into its
ability to call test functions from within other test
Ok, my turn to let some testosterone out :)
Presently migrating to 1.5.1 from 1.3
Around 8500 slocs with another 3000 slocs of custom DSL definitions.
Less than 1000 lines of unit tests, increasing slowly.
132 namespaces
166 atoms/refs
226 vars
170 private fns
585 public fns
46 macros
Some
Re-paste for formatting:
;; project.clj
(defproject my-website "0.1.0-SNAPSHOT"
:description "my Noir website"
:dependencies [[org.clojure/clojure "1.3.0"]
[noir "1.3.0-beta3"]
[org.clojure/java.jdbc "0.2.3"]
[mysql/mysql-connector-java "5.1.
I put the code in my reply hope you can tell me how clojure works
On Tuesday, June 11, 2013 12:53:16 PM UTC-6, Michael-Keith Bernard wrote:
>
> Without some code it would be impossible for us to speculate about how
> your program operates. Please provide the relevant source code and we can
> eas
Hi,
At Planspot.com we're migrating some old code to Clojure and writing most
new backend code in it. So far that is some API components for recording
and serving statistical data and the backend of a contact aggregation,
enrichment and management system.
Cheers,
Chris
On 11 June 2013 20:08,
am using the my-website code. I then tried to create jimsweb and use the
exact code
I think the main calls the server file, but I don't understand how the
logon screen is called?
I can think in cobol but this??
* project.clj
(defproject my-website "0.1.0-SNAPSHOT"
:description "my Noir websi
Hi Lynn,
> Let me know if you have any questions/comments/concerns/ideas
I have one question. As someone who has submitted a talk proposal
(two rather) I wonder if I should go ahead and sign up for the
conference now and work though the reimbursement details later should
my talk get accepted.
I
2013/6/11 Jay Fields
> I spent a bit of time and converted those entries into the following site:
> http://jayfields.com/expectations/index.html
>
That's very helpful! Thanks Jay!
--
MK
http://github.com/michaelklishin
http://twitter.com/michaelklishin
--
--
You received this message becaus
This is very helpful Jay, thank you!
We switched from clojure.test to Expectations after Clojure/West 2012
and we've been very happy with the framework. Centralized
documentation will certainly make life easier for my team!
Sean
On Tue, Jun 11, 2013 at 11:39 AM, Jay Fields wrote:
> expectations
Interesting; these arguments sound oddly like those surrounding Common
Lisp's "loop" macro. When reading Midje's docs, I got the weird impression
Brian was aware of the history of "non-lispy" macros.
Taken straight from
http://www.gigamonkeys.com/book/loop-for-black-belts.html :
(loop repeat 5
Looks really neat! I'm glad you're switching away from the blog-style
documentation, I found that harder to follow. And sorry I hadn't said so
sooner, my mistake :)
On Tue, Jun 11, 2013 at 1:39 PM, Jay Fields wrote:
> expectations* has always had a decent amount of documentation; however,
> it'
Without some code it would be impossible for us to speculate about how your
program operates. Please provide the relevant source code and we can easily
help you trace the flow of execution.
On Tuesday, June 11, 2013 5:32:46 AM UTC-7, jayvandal wrote:
>
> what statements makes the program execute
expectations* has always had a decent amount of documentation; however,
it's traditionally been in the form of blog entries.
I spent a bit of time and converted those entries into the following site:
http://jayfields.com/expectations/index.html
If you've never looked at expectations and you'd lik
The latest data from World Singles llc (which is listed on that
Success Stories page):
Clojure source 76 files 13178 total loc, 1064 fns, 554 of which are
private, 152 vars, 2 macros, 17 atoms
Clojure tests 37 files 3016 total loc
Clojure WebDriver tests 11 files 371 total loc
We're on Clojure 1.
Hey All,
Tickets for the 4th Annual Clojure/conj conference will be going on sale
today at 3pm EST!
Early registration starts at $400. A limited number of student tickets will
be available for $200.
We will also be offering ClojureScript, Datomic and Pedestal training in
the days prior to th
Thanks for the responses Ambrose and Gary,
I suppose the answer is its dependent on JVM implementation/version. As
Gary pointed out his code broke on the JVM upgrade. The real question is,
if there is ambiguity what "should" the behaviour be? It seems far from
ideal atm, brodering on non-determ
You're right. I'm sorry for doing that. From now on I'll make a bigger
point of it to be more correct.
On Tue, Jun 11, 2013 at 10:18 AM, Jay Fields wrote:
> On Tuesday, June 11, 2013 11:11:23 AM UTC-4, Steven Degutis wrote:
>
>> Jay,
>>
>> [elided]
>>
> That's the issue I'm trying to solve. May
On Tuesday, June 11, 2013 11:11:23 AM UTC-4, Steven Degutis wrote:
> Jay,
>
> [elided]
>
That's the issue I'm trying to solve. Maybe that's not what everyone sees
> in this. But this is the big win I see in it.
>
I think that's a good goal, I think you should stick to that, instead of
continui
Jay,
Imagine there is no Micah or Marick or you, there's only Bob and Alice, two
Clojure geeks who have a really big test suite.
If they wrote their whole test suite using clojure.test, they can't use an
autorunner unless they rewrite it in one of the other libs.
If they wrote their whole test s
Hi Puzzler,
I was wondering if you planned to port Instaparse to ClojureScript. I know
it's asking a lot, but I am one of those who would love
to be able to run it in a browser or in node.js...
Cheers,
Jeremys.
On Tuesday, May 14, 2013 10:13:52 AM UTC+2, puzzler wrote:
>
> Instaparse is an eas
+1 for both features... I found these *very* helpful
Op donderdag 30 mei 2013 03:25:22 UTC+2 schreef Nelson Morris het volgende:
>
> Good news everybody! As of leiningen 2.2.0 using `lein deps :tree` will
> perform version checks and version range detection. Therefore, I have
> deprecated lein-p
I'd like to support Laurent on this and the Test2 effort, having a spec of
tests in terms of abstractions useable from library to library, possibly
having tests as data, (since I have learned that it's all about data) would
really be really useful. The ring-spec like idea for tests really has
s
The result can be JVM-dependent. I've solved a bug in our codebase that
was due to JDK 7's reflection preferring a different constructor for an
object than 6, which was fixed by explicitly wrapping the ambiguous
argument in (boolean). Whatever the behavior, it's best to not rely on a
specific bro
On Tuesday, June 11, 2013 12:39:59 AM UTC-4, Steven Degutis wrote:
> It's pretty frustrating that I, a regular old Clojure user who likes
> writing tests, can't mix and match tools from existing testing libraries.
> Seriously, there's 4 major ones (clojure.test, speclj, midje, expectations)
> a
Hi Nathan,
I just had a quick look at the implementation: I think Clojure picks the
first matching method if several are found.
https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Reflector.java#L70
It's probably worth testing this out though.
Thanks,
Ambrose
On Tue, Jun 11, 2
On Jun 11, 2013 8:25 AM, "Meikel Brandmeyer (kotarak)" wrote:
> Or another one:
>
> (defn filter-lines
> [rdr]
> (->> (line-seq rdr)
> (mapcat #(str/split % #"\s+"))
> (filter #(<= 4 (count %) 9))
> (into #{})))
>
> (defn filter-file
> [filename]
> (with-open [rdr (io/reader fi
Or another one:
(defn filter-lines
[rdr]
(->> (line-seq rdr)
(mapcat #(str/split % #"\s+"))
(filter #(<= 4 (count %) 9))
(into #{})))
(defn filter-file
[filename]
(with-open [rdr (io/reader filename)]
(filter-lines rdr)))
Meikel
Am Dienstag, 11. Juni 2013 11:04:14 UTC+2
Hi All,
I have a question regarding ambiguity in reflective dynamic invocation.
In Clojure you can dynamically invoke a method on a Java class like so:
(. some-instance bar arg)
where bar is a method name.
If the type inferencer can't ascertain the type of some-instance a runtime
reflective p
Project URLs below.
lein-localrepo: https://github.com/kumarshantanu/lein-localrepo
lein-servlet: https://github.com/kumarshantanu/lein-servlet
lein-idefiles: https://github.com/kumarshantanu/lein-idefiles
Shantanu
On Tuesday, 11 June 2013 18:42:08 UTC+5:30, Shantanu Kumar wrote:
>
> Hi,
>
> I
Project URLs below.
lein-localrepo: https://github.com/kumarshantanu/lein-localrepo
lein-servlet: https://github.com/kumarshantanu/lein-servlet
lein-idefiles: https://github.com/kumarshantanu/lein-idefiles
Shantanu
On Tuesday, 11 June 2013 18:42:08 UTC+5:30, Shantanu Kumar wrote:
>
> Hi,
>
> I
Hi,
I pushed new versions of three Leiningen plugins to Clojars recently:
* lein-localrepo 0.5.0
This plugins lets one manage the local Maven/Leiningen repository. The
0.5.0 release fixes outstanding issues.
* lein-servlet 0.3.0
This plugin lets the user work with servlet-based Clojure apps.
I haven't seen the use of multiple statements in the for comprehension
here, so perhaps it's nice to elaborate that this exists?
(defn filter-file [filename]
(with-open [rdr (io/reader filename)]
(set
(for [line (line-seq rdr)
word (str/split line #"\s+")
:when (<
You know, if some day all the test libs / frameworks can be run, test
results exploited, etc. through the same abstraction, this will
greatly ease the pain of tools developers !
I would better write once the integration between Eclipse way of
running and displaying tests, than once per library !
Timothy, Brandon, Cedric, et al.:
Separating out the Discoverer from the Runner in the SPEC is a bad idea.
The main benefit mentioned so far for such a separation is so we can have
different definitions of what constitutes a test. For example,
test.generative can generate multiple tests from just
what statements makes the program execute.
The main statement tells the program to execute server file
what statements in the server file tell the program to run the welcome file
? the user file
--
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To
Beautiful!
On Tue, Jun 11, 2013 at 1:57 AM, Cedric Greevey wrote:
> You pass not the Discoverer's results to the Runner, but the Discoverer
> itself, which the Runner then invokes at need, possibly more than once.
>
>
> On Tue, Jun 11, 2013 at 1:35 AM, Steven Degutis wrote:
>
>> Originally we h
In the depths of ?Sunny? Suffolk... We use clojure and now clojurescript to
build our internal systems with a very small team of developers (2). Cannot
imagine getting the power, productivity or fun out of any other environment.
We are looking for another developer so if anyone knows anyone prep
Hey!
On Tue, Jun 11, 2013 at 10:36 AM, Simon Holgate wrote:
> Bruce Durling's semi-irregular update for London Clojurians is here:
I'll have you know that I'm completely irregular. :-D
Oh, and we use clojure for all of our stuff at Mastodon C that isn't
html or javascript and I think the javasc
Bruce Durling's semi-irregular update for London Clojurians is here:
https://groups.google.com/forum/?fromgroups#!searchin/london-clojurians/production/london-clojurians/ES8AuxXI0Nk/4xgY52znaUcJ
On Monday, 10 June 2013 22:47:25 UTC+1, Plinio Balduino wrote:
>
> Hi there
>
> I'm writing a talk abo
The 'reduce' solution is very elegant, but you can simplify it further:
(defn filter-file [filename]
(with-open [rdr (io/reader filename)]
(reduce (fn [words line]
(into words (filter #(<= 4 (count %) 9) (str/split line #"\s+"
#{}
(line-seq rdr
We use Clojure full-stack at www.cognician.com. Clojure, ClojureScript,
Datomic. Still under 20k loc. Loving it!
On Monday, June 10, 2013 11:47:25 PM UTC+2, Plinio Balduino wrote:
>
> Hi there
>
> I'm writing a talk about Clojure in the real world and I would like to
> know, if possible, which
74 matches
Mail list logo