RE: An Error spec?

2018-10-27 Thread Max Penet
There is one context where failure as exceptions can be a bit ugly is in core async channels but there are a few ways to deal with this, from separating channels for exceptions, using some kind of named tuple, map or just dispatching with instance? It is just a side effect of core async design w

Re: An Error spec?

2018-10-27 Thread Max Penet
It's arguable. Exceptions give you a somewhat clean way of pattern match their type and dealing with failures in a single place in an uniform way. Ex having to deal with not ok http status codes and then a potential low level networking exception at the same level is good imho. I tend to use e

Re: [ANN] Primitive Operator

2017-07-03 Thread Max Penet
This seems quite similar to https://github.com/ztellman/primitive-math. Did you know about it? On Monday, July 3, 2017 at 11:44:40 AM UTC+2, Phillip Lord wrote: > > > > This is the first alpha release of my new library! Comments welcome. > > Clojure has an extensive system for dealing with numbe

Re: Clojure spec keys is considering all key within namespace although it is not defined

2017-06-28 Thread Max Penet
Hi, It's by design, as the doc of s/keys states: In addition, the values of *all* namespace-qualified keys will be validated (and possibly destructured) by any registered specs. Note: there is no support for inline value specification, by design. So if the ns'ed key in your map is registered a

Re: [ANN] core.async 0.3.426

2017-02-23 Thread Max Penet
There are new/related issues that crept up with this release fyi. I would personally wait the next one for an upgrade in production: http://dev.clojure.org/jira/browse/ASYNC-187 http://dev.clojure.org/jira/browse/ASYNC-186 On Wednesday, February 22, 2017 at 7:58:27 PM UTC+1, Gary Trakhman wrote

Re: CPU usage goes way up when closing a core.async channel with loop inside

2017-01-23 Thread Max Penet
You do nothing for the while loop to end (while true ... )) This will still eat cpu time (a lot if there's no "pause" inside, empty chan/takes inside or not. That's why usually you use loop/recur with a condition of the take! result or put! result in case of push. (go-loop [] (when-let [x (

conditional support for spec in libraries

2016-10-23 Thread Max Penet
Another way is to provide the specs as a separate (or "sub") project. You then dont have to care about clojure versions, potential aot issues etc. I do this in https://github.com/mpenet/alia The same approach is taken with all features that could be considerrd opinionated and relying on extern

Re: Porting Clojure to Native Platforms

2016-04-27 Thread Max Penet
He happens to be one of the original Erlang authors/designers. There's also a side project of LFE that attempts to make things more clojur'esque in LFE https://github.com/lfex/clj. As for right now LFE shares more similarities with Common Lisp than with Clojure or Racket (lfe is a Lisp2). Person

Re: [ANN] Alia 3.0.0 - High performance Cassandra client

2016-01-29 Thread Max Penet
And I fogot to mention the changelog! https://github.com/mpenet/alia/blob/master/CHANGELOG.md#changelog On Friday, January 29, 2016 at 12:06:57 PM UTC+1, Max Penet wrote: > > Alia is reaching 3.0.0, following its parent project > datastax/java-driver. It covers the most recent featur

[ANN] Alia 3.0.0 - High performance Cassandra client

2016-01-29 Thread Max Penet
ithub.com/mpenet/alia or clojars: https://clojars.org/cc.qbits/alia -- Max Penet github: https://github.com/mpenet twitter: http://twitter.com/mpenet -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, se

Re: Clojure beyond Java 6 ?

2016-01-19 Thread Max Penet
I doubt it such a big deal actually. You can run multiple versions of the java on the same machine. The only issue would be for legacy projects that are frozen to java 6 and would like to upgrade to a lib (like clojure) relying java8. But I doubt such projects are the norm, and the few that are p

Re: [ANN] Ring-jetty9-adapter(rj9a) updated with HTTP2 support

2015-07-26 Thread Max Penet
Hi, It doesn't seem to work for me, I get " invalid_preface" error returned by the server (tried with latest firefox, chrome, chromium on linux). I will give nghttp2 a go, maybe me env is somehow busted, but other http2 websites (webtide, google etc) work fine on http2. Cheers, Max On Su

[ANN] New release of Alia, Cassandra driver/client for clojure

2015-05-21 Thread Max Penet
New release of Alia, the lean cassandra driver for clojure. https://github.com/mpenet/alia Alia focuses on performance, stability, simplicity, extensibility, being feature complete and tries to expose java-drivers' API in a clojure friendly way. It provides a "blocking" API, but also has interf

Re: JDK8

2015-05-08 Thread Max Penet
We've been running Oracle JDK8 on 30'ish servers (clj based web api, aggregation/streaming service, cassandra 2.1+, elastic search, etc) without any (noticeable) hiccups for a couple of weeks here. On Thursday, May 7, 2015 at 10:25:13 PM UTC+2, Pierre-Yves Ritschard wrote: > > Hi, > > There

Re: Does function core.async/poll! work?

2015-03-23 Thread Max Penet
I think the problem is that it's listed on the autodoc page http://clojure.github.io/core.async/ , hence the confusion. On Monday, March 23, 2015 at 4:50:57 PM UTC+1, tbc++ wrote: > > Unfortunately this isn't even in the latest alphas. > > Probably your best bet is to checkout a copy of core.as

Re: [ANN] trapperkeeper-jetty9 v1.2.0

2015-03-13 Thread Max Penet
HI, You might want to use an even more recent version of jetty9 see: https://github.com/eclipse/jetty.project/blob/cfca172dd68846b2c7f30a9a6b855f08da7e7946/advisories/2015-02-24-httpparser-error-buffer-bleed.md On Thursday, March 12, 2015 at 6:52:09 PM UTC+1, Chris Price wrote: > > Hi! Just

Re: A (foolish) plan to re-invent IO on top of core.async

2015-01-06 Thread Max Penet
Jet is already very usable and used in production by some notable projects/clients. I am also working on improving the backpressure story on all fronts at the moment (matter of few days at most). -- You received this message because you are subscribed to the Google Groups "Clojure" group. To p

Re: core async and transducers in Clojure 1.6.0

2014-12-30 Thread Max Penet
I did the same recently, you can already leverage transducer support in core.async while staying backward compatible with clojure 1.6. You loose some sugar and the transducer versions of most sequences functions but it's very usable still. you can see 2 examples here: https://github.com/mpene

Re: [ANN] Clojure 1.7.0-alpha3 now available

2014-10-29 Thread Max Penet
Just curious, why http://dev.clojure.org/jira/browse/CLJ-1517 didn't make it. It seemed complete at first glance. On Tuesday, October 28, 2014 9:53:05 PM UTC+1, Alex Miller wrote: > > We will definitely be rolling this particular aspect of CLJ-1330 back in > the next release. > > Alex > > On Tu

Re: [ANN] async-sockets - work with sockets using core.async channels

2014-10-08 Thread Max Penet
This is something that should be configurable & extendable in core.async really... but given how long it took to have this possibility with agents I am not holding my breath (not to mention it was never even considered for c.c/future). On Tuesday, October 7, 2014 8:48:23 PM UTC+2, Brian Guthrie

Re: core.async | compojure ... odd error ... help!!

2014-09-28 Thread Max Penet
Jet supports what you were trying to do, it accepts a channel as return value to send the response to the client, and in the :body of the response (no matter the kind of response via a channel or map) to trigger chunked responses. see here https://github.com/mpenet/jet#ring-async On Saturday,

Re: core.async | compojure ... odd error ... help!!

2014-09-28 Thread Max Penet
Jet supports what you were trying to do, it accepts a channel as return value to send the response to the client, and in the :body of the response (no matter the kind of response via a channel or map) to trigger chunked responses. see here https://github.com/mpenet/jet#ring-async On Saturday,

Re: Deploy best practices

2014-09-18 Thread Max Penet
You can use nginx as reverse proxy, load balance on 2 apps that are running on 2 different ports, and manage to always leave one alive when doing deploys. clojars has some document (probably not very up to date) about this kind of setups: http://p.hagelb.org/clojars-deploy On Thursday, Sept

[ANN] Jet - Jetty9 wrapper (ring, websocket, http client)

2014-09-10 Thread Max Penet
Jet [1] is a lightweight library for using Jetty9 from clojure. Jetty9 is interesting (compared to 7 or 8) mostly due to the fact that its core has been rewritten to take advantage of Async IO and it brings first class support for WebSocket among other nice things. There's an old'ish post that de

Re: [ANN] Alia 2.1.1 - Clojure client for cassandra

2014-08-27 Thread Max Penet
core.async channel, with fine control over the streaming process via core.async "takes" or interupting the streaming via core.async close!. On Wednesday, August 27, 2014 11:25:29 AM UTC+2, Max Penet wrote: > > Alia is a thin wrapper around "java-driver" by Datastax. > &

[ANN] Alia 2.1.1 - Clojure client for cassandra

2014-08-27 Thread Max Penet
Alia is a thin wrapper around "java-driver" by Datastax. Datastax's java-driver 2.1 final was released yesterday, Alia was brought up to speed with this release, adding support for the latest features from the library it wraps and cassandra 2.1+ If you have no idea what I am talking about you

Re: Clojure production environment

2014-08-20 Thread Max Penet
For "web stuff" we use jetty (9) apps as uberjar, behind nginx, deployed and C&C via ansible, hosted on DigitalOcean as well. Ansible is super easy to get started with and can grow to complicated setups relatively painlessly, can't say enough good things about it. On Wednesday, August 20, 2014

Re: [ANN] Alia 2.0.0-rc3 - Lightweight Cassandra driver integrated with core.async - Hayt (query dsl)

2014-05-22 Thread Max Penet
To give credit where it is due: thanks for the great suggestion(s) :) On Thursday, May 22, 2014 12:17:25 PM UTC+2, coltnz wrote: > > Alia / Hayt are a great combo thanks Max! > > I'm looking forward to trying Cassandra as a lazy-seq. > > Colin > > -- You received this message because you are sub

[ANN] Alia 2.0.0-rc3 - Lightweight Cassandra driver integrated with core.async - Hayt (query dsl)

2014-05-22 Thread Max Penet
ELOG.md 6. http://mpenet.github.io/hayt/codox/qbits.hayt.html -- Max Penet ___ github: https://github.com/mpenet twitter: http://twitter.com/mpenet ___ -- You received this message because you are subscribed to the Google Groups "Clojure" gro

Re: What's clojure killer app? I don't see any.

2014-04-19 Thread Max Penet
Hi, And there's Storm that could be worth mentioning... used by some (very) large companies (twitter ,groupon, etc...) and a success story. Also prismatic is a good example, and I could mention more companies/products, some that were acquired by big players, others used by millions, netflix c

Re: Is it possible to give an atomic message?

2014-04-12 Thread Max Penet
One of the possibility is to use joda-time DateTimeFormatter (directly or via one of the clojure wrappers). On Saturday, April 12, 2014 1:24:22 PM UTC+2, Cecil Westerhof wrote: > > 2014-04-12 11:40 GMT+02:00 Max Penet >: > >> Be aware that SimpleDateFormat is not threadsafe t

Re: Is it possible to give an atomic message?

2014-04-12 Thread Max Penet
Be aware that SimpleDateFormat is not threadsafe though. -- 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 - please be patient with your first

Re: Basic string modification question

2014-04-02 Thread Max Penet
about 1. if that's meant to be portable, yes, not the best indeed, but if you look at c.c.string/* or even c.c/str, most of the functions use stringbuilder I think. about 2. probably slower than subs, these are just alternatives to what you suggested On Wednesday, April 2, 2014 1:06:40 PM UTC+2

Re: Basic string modification question

2014-04-02 Thread Max Penet
There are many ways to do this, these 2 come to mind: (doto (StringBuilder. "abc") (.setCharAt 2 \d)) (apply str (assoc (vec "abc") 2 "d")) The former is probably a lot faster (uglier too)... On Wednesday, April 2, 2014 12:10:48 PM UTC+2, Andy Smith wrote: > > Hi, > > I see there are a lot of

Re: [ANN?]: ring-jetty-adapter with jetty 9.1.x

2014-01-24 Thread Max Penet
FYI there is also this one on github: https://github.com/sunng87/ring-jetty9-adapter On Thursday, January 23, 2014 11:39:45 PM UTC+1, Andrey Antukh wrote: > > Hi! > > I have port the current ring-jetty-adapter from current ring repository to > use jetty 9.1.1 version. > > I understand that cur

Re: contains? and transient set

2013-12-04 Thread Max Penet
Well not quite: > (contains? (transient #{1 2 3}) 1) false > *clojure-version* {:major 1, :minor 4, :incremental 0, :qualifier nil} > So it used not to throw but return a wrong value instead, which was worse. On Wednesday, December 4, 2013 2:50:19 PM UTC+1, Max Penet wrote: &g

Re: contains? and transient set

2013-12-04 Thread Max Penet
Also it seems it used to work on clojure 1.4 On Wednesday, December 4, 2013 2:29:35 PM UTC+1, Stefan Kamphausen wrote: > > It looks like you're onto something here > > get works with transient maps: > > (get (transient {:a 1 :b 2}) :a) > ;=> 1 > > and with transient vectors, too: > > (get (transie

Re: Access the datastructure used to create a function?

2013-11-26 Thread Max Penet
The best you can do is probably mess with https://github.com/technomancy/serializable-fn, but maybe trying to describe what you are trying to do at a higher level would help, most of the time using serializable-fn is a bad idea (symptom of one). On Thursday, November 21, 2013 7:14:39 PM UTC+1,

Re: ANN: double-check, a Clojure/ClojureScript-portable fork of simple-check

2013-11-21 Thread Max Penet
Looks good! I am wondering though, why not merging your work on the parent project instead of creating a new one (with a new name etc), you seemed to be on your way of doing just this? On Thursday, November 21, 2013 5:38:16 PM UTC+1, Chas Emerick wrote: > > Reid Draper's simple-check[1] is a

Re: core.async - handling nils

2013-08-27 Thread Max Penet
It's a real problem for me too, I also wonder what was the intention behind this. I guess there could be a very good reason for this special treatement of nils, but I haven't seen it yet. I would love to hear about this from people involved in core.async development. On Friday, August 16, 201

Re: function creation, partial or #()

2013-08-13 Thread Max Penet
Hi, Partial calls apply, so it's not as performant as #(..). That can make quite the difference depending on where it's used. All instances of partial were removed recently in carmine/nippy and that resulted in quite a performance improvement. On Tuesday, August 13, 2013 2:47:01 PM UTC+2, Jay

Re: java.jdbc - (sql/where ...) with multiple values (i.e. 'x in (1,2,3')

2013-07-11 Thread Max Penet
Honeysql is nice but it only supports select statements FYI. That said it's probably easy to extend, but my point is that it's far from complete, so I am not sure it's a good recommendation at the moment. -- -- You received this message because you are subscribed to the Google Groups "Clojure

Re: ANN Cassaforte 1.0 final is released

2013-07-09 Thread Max Penet
//blog.clojurewerkz.org/blog/2013/07/09/cassaforte-1-dot-0-1-is-released/ > > The ClojureWerkz team would like to thank Max Penet for helping us shape > up what > Cassaforte is, making an excellent CQL DSL library available and > supporting us in general, > even though w

Re: Can't figure out how to merge this dern map.

2013-07-08 Thread Max Penet
You don't need apply, you can just use into: user> (into {} [{:apple "red and crunchy"} nil nil {:Numb 1} nil nil {:Field "FRUIT.Description"}]) {:apple "red and crunchy", :Numb 1, :Field "FRUIT.Description"} On Monday, July 8, 2013 5:01:20 PM UTC+2, VaedaStrike wrote: > > So I have data struct

Re: Multiple args: opts map vs inline arguments

2013-06-18 Thread Max Penet
My rule of thumb for this is if that's something that will be "static" (as in, set once in the source and never changes) kw options are fine, if it is likely to be manipulated, is the result of some previous computation, then a map fits better. apply also has a performance cost that's not alwa

Re: In what OS do you code?

2013-06-15 Thread Max Penet
What OS? Emacs of course. More seriously debian (with a lightweight xmonad config), at work and at home. I tried OSX a couple of years back (for about a year), and there were just too many annoyances, weird keyboard shortcuts, broken package managers, proprietary stuff everywhere, payware (and

Re: Local database recommendation?

2013-05-26 Thread Max Penet
H2 sounds like the safe choice. You could also try/evaluate the latest mapdb: https://github.com/jankotek/MapDB#features It very easy to use from clojure but I only used it on trivial stuff however, and it's still considered alpha. On Sunday, May 26, 2013 5:09:51 PM UTC+2, Cedric Greevey wro

Re: [ANN] core.typed 0.1.14

2013-05-11 Thread Max Penet
Hi, Some nice improvements here, thanks! - Max On Saturday, May 11, 2013 3:53:02 PM UTC+2, Ambrose Bonnaire-Sergeant wrote: > > Hi, > > Announcing a new release of core.typed, with a bunch of improvements and > fixes. > > Leiningen: [org.clojure/core.typed "0.1.14"] > > Highlights: > - support

ANN: Alia & Hayt 1.0.0 - Cassandra CQL3 Client and Query DSL

2013-05-10 Thread Max Penet
Hayt [1] is a CQL3 DSL allowing to compose queries from clojure functions and/or maps. Alia [2] is a full featured Cassandra client built on top of DataStax newly released java-driver [3] with a simple, yet powerful API and query DSL (Hayt). Detailed announcement: http://bit.ly/17a0zfQ [1]

Re: What Slows Down clojure-hadoop?

2013-04-26 Thread Max Penet
Right! My bad. On Friday, April 26, 2013 2:44:21 PM UTC+2, Ji Zhang wrote: > > Besides, correct me if I'm wrong, the clojure map function returns a lazy > seq, and reduce consumes it, so there's actually only one loop, right? > > On Friday, April 26, 2013 8:23:04

Re: What Slows Down clojure-hadoop?

2013-04-26 Thread Max Penet
Hi, In reducer-reduce you iterate twice over the values compared to the java version, once in map (just to call .get), then in reduce. There are other issues probably, but this is one of the obvious ones. On Friday, April 26, 2013 12:05:33 PM UTC+2, Ji Zhang wrote: > > Hi, > > I'm writing map

Re: Is conj supposed to preserve metadata?

2013-04-14 Thread Max Penet
Nevermind, I just noticed it was marked to be applied in 1.5. On Sunday, April 14, 2013 11:36:45 PM UTC+2, Max Penet wrote: > > into doesn''t preserve metadata (clj-1.4). > > > (meta (into (with-meta {} {:foo :bar}) {})) > nil > > There was an Issue ab

Re: Is conj supposed to preserve metadata?

2013-04-14 Thread Max Penet
into doesn''t preserve metadata (clj-1.4). > (meta (into (with-meta {} {:foo :bar}) {})) nil There was an Issue about it, but it was closed: http://dev.clojure.org/jira/browse/CLJ-916 On Sunday, April 14, 2013 11:01:26 PM UTC+2, Marko Topolnik wrote: > > Yes, it is meant to preserve metadat

Re: Fastest way to generate comma-separated list

2013-04-03 Thread Max Penet
I am curious, what data store are you interacting with? On Wednesday, April 3, 2013 2:01:33 PM UTC+2, Ryan wrote: > > Most SQL Database support array types natively > > > If you are using MySQL unfortunately there isn't and the OP (including > myself) probably needs this because his RDBMS does n

Re: Fastest way to generate comma-separated list

2013-04-02 Thread Max Penet
uot;jim" "jon" "chris")) > ("jim" \, "jon" \, "chris")... > > once you have that pr-str is your friend... > > =>(apply pr-str (interpose \, (list "jim" "jon" "chris"))) > "\"jim\&qu

Re: Fastest way to generate comma-separated list

2013-04-02 Thread Max Penet
Using a protocol fn to do the encoding of the values according to the rules you set per type then using clj.string/join should be quite fast and not so horrible. On Thursday, October 28, 2010 2:18:08 AM UTC+2, andrei wrote: > > Hi all, > > I work with a database and need a function, that will

Re: Apply elements in a vector as arguments to function

2013-03-26 Thread Max Penet
You are mistaken :) try: (apply str [:a :b :c]) (apply str [:a :b :c :d :e]) > (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 prepending intervening arguments to args. nil

Re: ClassNotFoundException when using fetch RPC from cljs

2013-03-21 Thread Max Penet
+1 fetch also has some bugs that will bite you sooner or later, it's not maintained anymore (and I don't think anyone took over). On Thursday, March 21, 2013 4:34:44 PM UTC+1, Paul deGrandis wrote: > > If you're up for the challenge, I'd encourage you to migrate from Noir to > Compojure+Ring a

Re: Help on implementing a simple java (openNLP) EventStream interface

2013-02-15 Thread Max Penet
(swap! remaining rest) > (case->event current features-extractor labeler))) > (hasNext [this] (not (empty? @remaining)) > > May I ask why that would be faster? And when proxy is preferred over reify? > > Joachim. > > 2013/2/14 Max

Re: Help on implementing a simple java (openNLP) EventStream interface

2013-02-14 Thread Max Penet
Also It looks like you could use reify instead of proxy here, it would improve performance. http://clojuredocs.org/clojure_core/clojure.core/reify - Max On Thursday, February 14, 2013 3:26:02 PM UTC+1, Ulises wrote: > > Without testing or anything that looks reasonable enough. I'm sure that

Re: How to Process Files in Background

2013-02-11 Thread Max Penet
Hi, I made a small library a while ago to help with this. It wraps different java executors and has a version of clojure future and future-call that allows you to pass an executor as argument: https://github.com/mpenet/knit (require '[qbits.knit :as k]) (def x (k/executor :fixed :num-threads

Re: Callbacks as Sequences

2013-02-06 Thread Max Penet
Hi, jayq includes something similar (nicer imho). It takes the form of a let like construct (let-deferred [a (jq/ajax "http://localhost:8000/1.json";) b (jq/ajax "http://localhost:8000/2.json";)] (do-something-with-result (merge a b foo))) It also supports :let and :when intermedia

Re: ClojureScript + Jayq Resulting in Error

2013-01-19 Thread Max Penet
You need to use a more recent clojurescript version (you are missing clj->js from cljs.core). see https://github.com/ibdknox/jayq/blob/master/CHANGELOG.md#200-breaking-changes On Saturday, January 19, 2013 4:02:29 AM UTC+1, Ari wrote: > > I also noticed that when I compile the cljs code I get

Re: Promise for ClojureScript?

2012-11-27 Thread Max Penet
jayq [1] now supports jQuery deferred API , there are 2 examples of its use with these 2 macros: let-ajax and let-deferred (see the readme). [1] https://github.com/ibdknox/jayq On Tuesday, November 27, 2012 12:51:22 AM UTC+1, FrankS wrote: > > All this call-back stuff drives me crazy in Clojur

Re: a question for crate and hiccup

2012-11-25 Thread Max Penet
Strong +1 This is a great idea. This would allow more flexibility in some corner cases and prevent unnecessary duplication, not to mention sharing. Another example: I believe crate compiles templates using the DOM API, which is often fine, but sometimes you'd want it to do this using raw stri

Re: clojure.java.jdbc says "data too long" for 1 character of data

2012-11-10 Thread Max Penet
It's probably the use of single quotes, which results in a quoted symbol Clojure> 'f' f' On Saturday, November 10, 2012 6:20:06 PM UTC+1, larry google groups wrote: > > In MySql I have a table with a field called is_top_winner and this is > defined as char(1). In Clojure I have this function: >

Re: future with user specified ExecutorService

2012-10-27 Thread Max Penet
:42 PM UTC+2, Casper Clausen wrote: > > +1 That would be nice. This may not be the right place for the suggestion > though. > > On Thursday, October 25, 2012 2:43:58 PM UTC+2, Max Penet wrote: >> >> wrong commit: >> https://github.com/mpenet/clojure/commit/9c6e475

Re: future with user specified ExecutorService

2012-10-25 Thread Max Penet
wrong commit: https://github.com/mpenet/clojure/commit/9c6e47524dc21c6bdfaa9d0cc2a69377cc69cbf3 On Thursday, October 25, 2012 2:35:01 PM UTC+2, Max Penet wrote: > > Another enhancement proposal, would it be possible to have a future-call > arity with an additional argume

future with user specified ExecutorService

2012-10-25 Thread Max Penet
Another enhancement proposal, would it be possible to have a future-call arity with an additional argument as the ExecutorService used. It seems to be a trivial but useful modification, but I wanted to ask here before creating a ticket for this. Something like this maybe: https://github.com/m

Re: Questions about some-fn and every-pred (possible bug, and improvements)

2012-10-25 Thread Max Penet
Thanks, perfect, I had prepared a patch that was identical. On Thursday, October 25, 2012 2:11:44 PM UTC+2, Tassilo Horn wrote: > > Tassilo Horn > writes: > > >>> user> ((some-fn) ) > >>> false > >>> user> ((every-pred) ) > >>> true > >>> > >>> e.g. (some-cn) was equivalent to (constantly fa

Re: Questions about some-fn and every-pred (possible bug, and improvements)

2012-10-25 Thread Max Penet
On Thursday, October 25, 2012 12:49:32 PM UTC+2, Tassilo Horn wrote: > > Max Penet writes: > > > user> ((every-pred (fn [_]))) > > true > > user> ((some-fn (fn [_]))) > > nil > > > > Shouldn't the first example return false? s

Re: Questions about some-fn and every-pred (possible bug, and improvements)

2012-10-25 Thread Max Penet
user> (every? identity []) true I think I understand now, this might be to match the behavior of "every?". Max On Thursday, October 25, 2012 12:31:57 PM UTC+2, Max Penet wrote: > > Hello, > > I am trying to understand the rationale behind the current implementation &g

Questions about some-fn and every-pred (possible bug, and improvements)

2012-10-25 Thread Max Penet
Hello, I am trying to understand the rationale behind the current implementation of some-fn and every-pred, there seems to be a couple of odd things, or maybe that is just me misunderstanding their doc. user> ((every-pred (fn [_]))) true user> ((some-fn (fn [_]))) nil Shouldn't the first exam

Re: Bug in jayq clj->js function ?

2012-10-22 Thread Max Penet
Good point, I forgot about this case. On Monday, October 22, 2012 7:02:41 PM UTC+2, David Nolen wrote: > > On Mon, Oct 22, 2012 at 12:52 PM, Max Penet >wrote: > >> This reminds me, maybe having something like this function, probably with >> its protocol in core

Re: Bug in jayq clj->js function ?

2012-10-22 Thread Max Penet
You can get a fix from my fork cc.qbits/jayq "0.1.0-alpha4-SNAPSHOT" or just use your own: https://github.com/mpenet/jayq/commit/d26615f26f012093e02bd89df893fb6e993830e6 On Monday, October 22, 2012 5:44:11 PM UTC+2, Pierre Allix wrote: > > Hello everybody, > > I'm having a bug with the followi

Re: Bug in jayq clj->js function ?

2012-10-22 Thread Max Penet
This reminds me, maybe having something like this function, probably with its protocol in core would be nice. Thoughts? On Monday, October 22, 2012 6:46:41 PM UTC+2, Max Penet wrote: > > Hi, > > jayq relies on .-str-obj to serialize maps, which doesn't exist on > Persista

Re: Bug in jayq clj->js function ?

2012-10-22 Thread Max Penet
Hi, jayq relies on .-str-obj to serialize maps, which doesn't exist on PersistantHashMaps (it turns into one once you insert the 33rd element). It should use aset instead I guess. By the way there is a map->js function you can use in the meantime. On Monday, October 22, 2012 5:44:11 PM UTC+2,

Re: ANN: a Clojure docs site, and github organization

2012-10-06 Thread Max Penet
Google also has something similiar, and it has probably been checked by an army of layers. http://code.google.com/legal/individual-cla-v1.0.html On Sunday, October 7, 2012 2:25:36 AM UTC+2, Ben Mabey wrote: > > On Oct 6, 2012, at 6:04 PM, Michael Klishin > > > wrote: > > > > 2012/10/7 Softaddi

Re: Evolving the Clojure contribution process and goals

2012-09-26 Thread Max Penet
+1 Accepting CAs by mail would be very welcome. The impact of this until now is something quite difficult to measure, since potential contributors maybe never voiced their interest and just quit when they get to know the effort (or cost) required. But it probably makes a difference when a pr

Re: CLJS: Checked Arithmetic?

2012-01-28 Thread Max Penet
Sorry about the horrible formatting, blame google groups interface. Max On Jan 28, 7:16 pm, Max Penet wrote: > Hello David, > This is interesting! > The JavaScript behavior is definitively not a good one, that said the > only thing that I think could do more harm than good is th

Re: CLJS: Checked Arithmetic?

2012-01-28 Thread Max Penet
Hello David, This is interesting! The JavaScript behavior is definitively not a good one, that said the only thing that I think could do more harm than good is the fact these checks are enabled by default. I am not sure the majority of cljs user will want to take a performance hit (or have to set a

Re: how to get font-lock to work in swank repl buffer

2012-01-19 Thread Max Penet
Well it *should*, now that I think of it, I am not using clojure-jack- in so it might be different. On Jan 20, 12:08 am, Max Penet wrote: > Hello, > > This should do it: > > (add-hook 'slime-repl-mode-hook 'clojure-mode-font-lock-setup) > > On Jan 19, 10:52 pm

Re: how to get font-lock to work in swank repl buffer

2012-01-19 Thread Max Penet
Hello, This should do it: (add-hook 'slime-repl-mode-hook 'clojure-mode-font-lock-setup) On Jan 19, 10:52 pm, Ben Smith-Mannschott wrote: > I'm trying to get syntax highlighting (font-lock) to work in the > repl buffer provided by slime as described > here:https://github.com/technomancy/swank-

Re: ClojureScript children seq

2011-09-10 Thread Max Penet
On Sep 10, 9:33 pm, Max Penet wrote: > You can use goog.dom/getChildren to get the children (I think it will > exclude the non-Nodes such as text and comments) I meant "non Element Nodes" -- You received this message because you are subscribed to the Google Groups "Cloju

Re: ClojureScript children seq

2011-09-10 Thread Max Penet
You can use goog.dom/getChildren to get the children (I think it will exclude the non-Nodes such as text and comments ) but it will return an HTMLCollection doesn t implement ISeq, so you need to transform it to a regular js array with goog.array/toArray. something along these lines: (ns dom-mani

Re: What are the advantages of clojurescript over straight-forward javascript?

2011-08-31 Thread Max Penet
Imho, you get everything google closure is good at (great compiler, huge library, dependency management/resolution, stability/support) without having to follow OO style closure encourages, with the joy of working with clojure, it's abstractions/semantics/ecosystem, and the ability to share code be

Re: ANN: Optimized Pattern Matching Library for Clojure

2011-08-08 Thread Max Penet
Thanks! This looks really good. I hope this ends up in contrib at some point, also looking forward to its extension (guards & co). On Aug 9, 7:49 am, David Nolen wrote: > Ambrose and I have been working on a high performance pattern matching > library for Clojure. There's much left to do but it'

Re: slime and utf-8

2011-06-26 Thread Max Penet
Hi, Try adding this line to your .emacs: (setq slime-net-coding-system 'utf-8-unix) On Jun 26, 1:34 pm, Gregg Reynolds wrote: > Hi, > > This seems to be an emacs problem.  I'm trying to read a file with utf-8 > text using  (slurp "foo.txt") in an emacs slime session.  It chokes and > says: > >

Re: Clojure interest in Zurich

2011-04-14 Thread Max Penet
Hi, Hi, I live in Geneva too. I recently found out (thanks to Christophe Grand) there are a few Clojure users around here. Max On Apr 14, 10:07 pm, Ivan Koblik wrote: > Hello, > > I'll be the third guy from Switzerland :) I live in Geneva... Any Clojurians > from Suisse romande? > > Cheers, >

Re: Creating an empty string array

2011-03-28 Thread Max Penet
into-array can do that for you: user=> (doc into-array) - clojure.core/into-array ([aseq] [type aseq]) Returns an array with components set to the values in aseq. The array's component type is type if provided, or the type of the first value in aseq if present, or Obj