Hello,
Why the names fix / to-fix ?
2013/2/20 Alan Malloy a...@malloys.org:
Useful has functions that do this and more: fix or to-fix, according to
taste. Your iffn is just the three-argument case of to-fix: (def magnify
(to-fix pos? inc dec)). But fix and to-fix accept more or fewer
You can use fix to take some data that might not be right (say, an integer
that might actually be a string) and fix it by applying read-string: (fix
10 string? read-string). to-fix returns a function you can use to fix
things.
On Wednesday, February 20, 2013 12:06:36 AM UTC-8, Laurent PETIT
2013/2/20 Alan Malloy a...@malloys.org:
You can use fix to take some data that might not be right (say, an integer
that might actually be a string) and fix it by applying read-string: (fix
10 string? read-string). to-fix returns a function you can use to fix
things.
OK, I thought there was
Geo ggrigor...@gmail.com writes:
I am cross-posting my Clojure question from StackOverflow. I am trying to
get an algorithm in Clojure to match Java speed and managed to get the
performance to within one order of magnitude and wondering if more is
possible. The full question is here:
Hi,
given a vector of the form
[:key1 1 2 3 :key2 4 :key3 5 6 7]
I wand to create a map collecting the items behind each keyword as a vector
like this:
{:key1 [1 2 3]
:key2 [4]
:key3 [5 6 7]}
I have already written two functions which achieve this, but neither of them
feels good
'keycollect-partition' looks sensible and idiomatic to me... perhaps
juxt can come into play here? Of course, both versions will only work
with keys as keywords and non-keys as non-keywords. If you use anything
else other than a keyword for a key or a keyword for an item, both will
break...
It worked after I installed leinigen 2, then ran the same commands that I
listed in my previous post. Ben, I'm not sure why the deploy command
gave the same error, but I appreciate your detailed response. KK, if I
have more problems in the future, I'll be sure to try your recommendation.
It was a bug in kerodon that happens when a ring response has a :body
that is a not a string (in this case a lazyseq). Reported and fixed by
Travis Vachon at https://github.com/xeqi/kerodon/pull/6, I just had
lost track of making a release for it.
Fixed as part of [kerodon 0.1.0].
Not sure if this is any more idiomatic, or feels any better, but I thought
a loop would be appropriate here, plus I made key selection pluggable.
https://gist.github.com/thheller/4995766
(defn split-into-map [items key-fn] see gist)
key-fn is a function which accepts one arg and should return
I would like to suggest that a future version of Kerodon have
something like text? but checking for a substring, rather than
equality. I have been running my tests against my real-world
templates, so I get failures for stuff like this:
FAIL in (anyone-can-view-frontpage) (core_test.clj:15)
Hey,
So yesterday we discussed concurrency at our meetup
(http://www.meetup.com/Budapest-Clojure-User-Group/) and a question occurred to
me.
Suppose we have a classic web application. (I'm not currently building such a
web app in Clojure, so that's a theoretical question).
When the user
Ben: of course, haha...making it a macro seems rather silly now :P
Alan: I didn't know about useful before, thanks for the pointer! fix and
to-fix look great.
--
--
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to
I see that lein2 has factored out the 'interactive' command.
Can I use lein1 and expect the various clojure libraries and templates to
work?
There's been several mentions of jark in relation to speeding up lein. From
what I see, it doesn't seem battle tested. Do any of you use it on a daily
given the current position of core.logic and core.typed
I wonder if it would be in range of a gsoc project to implement something
similar to Qis type system for clojure
(here is a link to an example of using Qis type system
I've been using drip with quite some success (with the exception of midje
tests which seem to launch their own jvm every time.)
On 20 February 2013 15:53, Buck Golemon workithar...@gmail.com wrote:
I see that lein2 has factored out the 'interactive' command.
Can I use lein1 and expect the
Interesting idea, but the specifics of the project are not clear to me.
Could you flesh out what
you're trying to achieve in particular?
Would you build on top of core.logic and core.typed?
Thanks,
Ambrose
On Thu, Feb 21, 2013 at 12:13 AM, Maik Schünemann maikschuenem...@gmail.com
wrote:
SSD + fastest laptop in your price range ;)
lein2 help takes 12 seconds from start to back at command prompt...
We have a huge build here with 9 distinct projects, AOT, ...
lein is fired up maybe a dozen times and it takes a bit
above 3 mns elapsed time and 2mns of cpu time.
Quite happy to live
It's probably possible but too broad a scope for GSoC 2013. I think the
community would be better served by directly contributing to core.logic
core.typed both of which could use lots of help :)
On Wed, Feb 20, 2013 at 11:13 AM, Maik Schünemann maikschuenem...@gmail.com
wrote:
given the
Drip does not give me any significant advantage on my hardware...
I think that most of this 12 seconds is spent compiling and initializing all
the plugins
on top of lein and clojure itself.
One day I will have some time to spit out a tool to create a local AOT version
of
all these nice tools to
I've got very variable performance from drip. In some cases, it's
slower.
My guess is that it runs the application in the last JVM, and spins up
the new one to replace it at the same time. On slow machines, this is
problematic.
Personally, I use patience; I find this solves all my problems.
You should have worked on a vax-725 with a removable 10mb disk the size if a
large pizza 4 inches thick .
It would have torned your patience to snowflakes which are presently
falling on my head, almost as white as my hairs which have been whitening over
years of waiting after the then really too
Function composition similar to that has been explored a lot in the haskell
world. See:
http://www.haskell.org/haskellwiki/Arrow
I also made a small library to implement some of the operators:
https://github.com/odyssomay/clj-arrow
I think the reason arrows are so interesting in haskell is
I've added two projects related to core.typed.
FYI: I am technically qualified to participate as a student in GSoC 2013,
but I may participate as a mentor instead. I'm hoping to find out in the
next few weeks.
http://dev.clojure.org/display/community/Project+Ideas#ProjectIdeas-TypeSystems
On
Softaddicts writes:
SSD + fastest laptop in your price range ;)
lein2 help takes 12 seconds from start to back at command prompt...
FWIW the help task is basically the worst case scenario for measuring
startup time since it has to load every single task in order to get
docstrings for them. If
I've added some projects I'm willing to mentor as well
http://dev.clojure.org/display/community/Project+Ideas
On Wed, Feb 20, 2013 at 1:10 PM, Ambrose Bonnaire-Sergeant
abonnaireserge...@gmail.com wrote:
I've added two projects related to core.typed.
FYI: I am technically qualified to
Don't know if it's better, but:
(apply hash-map (map-indexed #(if (= 0 (mod %1 2)) (first %2) (vec %2))
(partition-by keyword? [:key1 1 2 3 :key2 4
:key3 5 6 7])))
Seems to work.
Mauricio
--
--
You received this message because you are subscribed to the Google
Hi,
I'm trying to incorporate authentication via the interactive form workflow;
however, I'm currently unable to receive submitted credentials for
verification. When I submit the sign-in form that has it's action bound to
/login, I get Page not found as per my default route below. I've
I wanted to report an issue with Clojure-CLR 1.4.1 that I am seeing but the
issues section on the Clojure-CLR Github must be disabled because the link
is not showing up.
When I run the REPL I get a lot of duplicated warnings. I've pasted the
warnings below.
On Wed, Feb 20, 2013 at 2:48 PM, Ari ari.brandeis.k...@gmail.com wrote:
Hi,
I'm trying to incorporate authentication via the interactive form workflow;
however, I'm currently unable to receive submitted credentials for
verification. When I submit the sign-in form that has it's action bound to
Hi Ari,
you have to add wrappers:
ring.middleware.params/wrap-parms
ring.middleware.keyword-params/wrap-keyword-params
---
Ilshad Khabibullin
+7 981 688 26 35
On Feb 21, 2013, at 12:48 AM, Ari ari.brandeis.k...@gmail.com wrote:
Hi,
I'm trying to incorporate authentication via the
I believe anyone should be able to create an account at this web site and then
create a ticket. If you have any trouble doing so, let me know.
http://dev.clojure.org/jira/browse/CLJCLR
Andy
On Feb 20, 2013, at 12:58 PM, Frank Hale wrote:
I wanted to report an issue with Clojure-CLR
Thank you. New ticket created.
On Wed, Feb 20, 2013 at 4:20 PM, Andy Fingerhut andy.finger...@gmail.comwrote:
I believe anyone should be able to create an account at this web site and
then create a ticket. If you have any trouble doing so, let me know.
on win7 64bit
Microsoft Windows [Version 6.1.7601]
C:\Users\usercd \1
C:\1powershell
Windows PowerShell
Copyright (C) 2009 Microsoft Corporation. All rights reserved.
PS C:\1 Measure-Command {*lein version*}
Days : 0
Hours : 0
Minutes : 0
Seconds :
I am around the same figures, mostly cpu time.
If I take our software which is AOT compiled, I can eval nil (or simple values)
through clojure.man in 0.9 seconds. I see this as a significant improvement,
we use about two dozen Clojure libs, most of which get at least partially
compiled
prior to
Judging from the transcript, there is something not right in your
ClojureCLR setup.
protocols.clj should not be loading. It should be AOT-compiled.
We can work from the JIRA ticket.
-David
On Wednesday, February 20, 2013 3:30:52 PM UTC-6, Frank Hale wrote:
Thank you. New ticket created.
Ah, thanks.
On Feb 21, 2013, at 1:42 AM, larry google groups lawrencecloj...@gmail.com
wrote:
ring.middleware.params/wrap-parms
ring.middleware.keyword-params/wrap-keyword-params
No, he already has:
(handler/site))
Which should add in the middleware that you mention. But in my
okay, I just compiled from the Clojure-CLR 1.4.1 branch in 'Release' mode
and then copied the binaries out to a directory and opened a terminal there
to run the REPL.
On Wed, Feb 20, 2013 at 4:42 PM, dmiller dmiller2...@gmail.com wrote:
Judging from the transcript, there is something not right
Passing a :login-uri causes workflows/interactive-from to change what
uri it checks for. Given the setup above the login form needs to post
to /.
I was under the impression that the :login-uri was on for only getting the
form. Do you know if the GET and POST uris can be separated via
Hi, I'm getting an unexpected exception trying to do unchecked
arithmetic:
user= (def seed1 25214903917)
#'user/seed1
user= (type seed1)
java.lang.Long
user= (type 25214903917)
java.lang.Long
user= (unchecked-multiply seed1 0x5DEECE66D)
ArithmeticException integer overflow
looks like different methods are called:
for: user= (unchecked-multiply 25214903917 0x5DEECE66D)
this method: static public long unchecked_multiply(long x, long y){return x
* y;}
for: (unchecked-multiply seed1 0x5DEECE66D)
this method: static public Number unchecked_multiply(long x, Object
looks like if you make any(or both) to double it works as expected due to
these being called:
static public double multiply(double x, double y){
return x * y;
}
static public double multiply(double x, long y){
return x * y;
}
static public double multiply(long x, double y){
return x
I agree that unchecked-multiply should do an unchecked multiply, even when
faced with objects. Going to bring that up on clojure-dev.
A workaround: (unchecked-multiply (long seed1) 0x5DEECE66D)
--
--
You received this message because you are subscribed to the Google
Groups Clojure group.
To
On Feb 20, 2013 5:55 AM, Phillip Lord phillip.l...@newcastle.ac.uk
wrote:
(do
(assoc curr (inc j) 0)
(recur (inc j) max-len)))
Here you're discarding the result of assoc, a pure function, which changes
the code's nature
Surprised this hasn't gotten more attention. Well done. Looking forward to
using this on future projects.
'(Devin Walters)
On Feb 20, 2013, at 1:33 AM, Alan Dipert a...@dipert.org wrote:
Hi all,
We recently released a ClojureScript library for FRP called Javelin. Links
of interest:
*
On Feb 20, 2013, at 1:33 AM, Alan Dipert wrote:
We recently released a ClojureScript library for FRP ...
On Feb 20, 2013, at 17:02, Devin Walters wrote:
Surprised this hasn't gotten more attention. Well done.
Looking forward to using this on future projects.
Indeed. I'm a big fan of FRP:
I can't find the reference now, but either in a screencast or a discussion
I read it was mentioned that if you have a single thing that performs
side-effects, you can perform this function last in the transaction without
worrying about any issues. The reasoning here is that if anything before
I think Alan provided more than enough info in his announcement. FRP
(Functional Reactive Programming) is a pretty well-known acronym 'round these
parts, and the links he provides go a long way toward giving context to FRP
beginners.
In any event, I'm going to go ahead and assume TLA refers
And this is mine
(defn keycollect-too [key-fn coll]
(let [not-key (complement key-fn)]
(loop [[k more] coll, res (transient {})]
(let [[vv rr] (split-with not-key more)]
(if-not k
(persistent! res)
(recur rr (assoc! res k (vec vv
(keycollect-too
whatever the implementation I would include some example in the doc, like:
(defn keycollect-*fnnamehere**
**input:
[:key1 1 2 3
:key2 4
:key3 5 6 7]
output:
{:key1 [1 2 3]
:key2 [4]
:key3 [5 6 7]}
*
[coll]
;... implementation here
)
wish clojure has this kind of doc(s) instead,
49 matches
Mail list logo