[ANN] Clojure IDE for OS X

2013-12-16 Thread Christian Sperandio
Hi, It's a good news to have a new IDE for Clojure. I wanted to try it but I read it works only on OS X 10.9. I think your target is very limited. So, may be another time. Chris -- -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to thi

Re: docs for ^:once

2013-09-12 Thread Christian Sperandio
You'll find a case of use of this term here: http://clj-me.cgrand.net/2013/09/11/macros-closures-and-unexpected-object-retention/ Le 12 sept. 2013 20:56, "Brian Craft" a écrit : > I still don't really understand ^:once. Are there docs anywhere? Is there > a way to inspect a function for this pro

Re: [ANN] core.typed 0.2.0 - Production Ready

2013-08-29 Thread Christian Sperandio
Ok... Another question, the checking is done only once (while compiling) ? Or, it's done while the runtime? 2013/8/29 Michael Klishin > 2013/8/29 Christian Sperandio > >> Is there any perf improvement to use static typing in Clojure? > > > core.typed is n

Re: [ANN] core.typed 0.2.0 - Production Ready

2013-08-29 Thread Christian Sperandio
Is there any perf improvement to use static typing in Clojure? Like we can see with Groovy 2.x and its static mode. 2013/8/29 Nils Grunwald > Congratulations and thanks for your work! > > > On Thursday, August 29, 2013 12:28:35 AM UTC+2, Ambrose Bonnaire-Sergeant > wrote: > >> Hi, >> >> After

Re: strange map

2013-08-28 Thread Christian Sperandio
%) '(1 2 3 4 5)) 2013/8/28 > Hi > > user=> (def r (map #(do (print "-") %) '(1 2 3 4 5))) > #'user/r > user=> (println r) > (--1 -2 -3 -4 5) > nil > > On Wednesday, August 28, 2013 4:57:49 PM UTC+8, Christian Sperandio wrote: > >&

Re: strange map

2013-08-28 Thread Christian Sperandio
Hi, Try just one thing: (def r (map #(do (print "-") %) '(1 2 3 4 5))) And after, do (println r) What do you get? 2013/8/28 > Hi > > (map #(do (print "-") %) '(1 2 3 4 5)) > I think the result should be (-1 -2 -3 -4 -5), but it is (--1 -2 -3 -4 5), > it's difficult to understand, > Can

Re: ANN Gemini 0.3.0

2013-08-26 Thread Christian Sperandio
I released a version 0.3.2. The macro with-likeness doesn't return nil anymore. I think this behavior is more correct. Christian https://github.com/chrix75/Gemini -- -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send emai

Re: ANN Gemini 0.3.0

2013-08-26 Thread Christian Sperandio
After realising the 0.3.1 version, I wondered if it's a good idea the with-likeness macro returns always nil. it's a mistake, isn't it? Le 26 août 2013 16:50, "Christian Sperandio" a écrit : > Hi, > > I released a minor version 0.3.1. > > This version

Re: ANN Gemini 0.3.0

2013-08-26 Thread Christian Sperandio
Hi, I released a minor version 0.3.1. This version provide a way to get a function to find expressions likeness. I implemented a macro too. This macro reduces the code size by limiting the declarations for the expressions likeness. Christian https://github.com/chrix75/Gemini -- -- You rece

Re: Place of function?

2013-08-26 Thread Christian Sperandio
I didn't think search this term. Thanks :) Le 26 août 2013 à 15:13, Jay Fields a écrit : > you're probably looking for fn? > > On Mon, Aug 26, 2013 at 9:11 AM, Christian Sperandio > wrote: >> Hi, >> >> Does anyone know why the functions like: map?

Place of function?

2013-08-26 Thread Christian Sperandio
Hi, Does anyone know why the functions like: map?, number?, vector?, … belongs to the clojure.core but not function? ? Christian -- -- 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

ANN Gemini 0.3.0

2013-08-25 Thread Christian Sperandio
Hi, I continue improving the Gemini matching library. I added the possibility to define the authorized validator with :all. Thus, instead of doing :authorized {:inv 1 :sub 1 :delete 1 :insert 1} you can write :authorized {:all 1} And, I created a new namespace gemini.extended that provides fun

Re: always function?

2013-08-25 Thread Christian Sperandio
Not really. The identity function returns the value. I want to have the function that returns the value. constantly is the good answer for my needs. Le 25 août 2013 à 13:57, Dave Della Costa a écrit : > There is also identity, which returns what it was passed, which seems > closer to what you

Re: always function?

2013-08-25 Thread Christian Sperandio
Thank you :) -- -- 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 post. To unsubscribe from this group, se

Re: always function?

2013-08-25 Thread Christian Sperandio
Thanks, exactly what I want :) Le 25 août 2013 à 13:40, László Török a écrit : > Hi, > > (constantly 5) > > will return a function that takes any number of args and always returns 5. > > See http://clojuredocs.org/clojure_core/clojure.core/constantly. > > Las

always function?

2013-08-25 Thread Christian Sperandio
Hi, Is there a function builds a function that returns always the same value? In coder words, this sort of function: (defn always [v] (fn [& _] v)) If this function exists already, I prefer use it rather than reinvent the wheel :) Christian -- -- You received this message because you ar

ANN Gemini 0.2.1

2013-08-24 Thread Christian Sperandio
Hi, A minor version of the project Gemini that manages the :min-length selector. You can use it alone or with the :max-length selector to define a length gap. More details on https://github.com/chrix75/Gemini Christian -- -- You received this message because you are subscribed to the Google G

ANN Gemini 0.2.0

2013-08-24 Thread Christian Sperandio
Hi, I implemented a function to filter a collection by using a matching environment. Thus, you can do a sort of fuzzy filter on your data. A little example: (let [coll ["église" "Eglise" "Église" "Elise" "Elise" "élise"] clean-fn (fn [s] (-> (clojure.string/upper-case s) (clojure.strin

ANN Gemini 0.1.0

2013-08-23 Thread Christian Sperandio
Hi, I works for many years in the data matching and I decided to start developing the Gemini Clojure library. This project gives a way to provide functions that searches the likeness of 2 data. More details on the GitHub project page: https://github.com/chrix75/Gemini Christian -- -- You r

Re: [ANN] optparse-clj: Functional GNU-style command line options parsing

2013-08-21 Thread Christian Sperandio
Cool! I started looking at integrate the Apache commons-cli with clojure. Your code will save work time :) Thanks -- -- 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 ne

Re: Comparing of 2 words

2013-08-19 Thread Christian Sperandio
18. August 2013 18:52:54 UTC+2 schrieb Christian Sperandio: >> >> Hi, >> >> I wrote a set of functions to compare 2 words managing the keyboard >> mistakes. The common mistakes are insertion, deletion, substitution or >> inversion. >> > > Thi

Comparing of 2 words

2013-08-18 Thread Christian Sperandio
Hi, I wrote a set of functions to compare 2 words managing the keyboard mistakes. The common mistakes are insertion, deletion, substitution or inversion. It can be useful for searching name, product reference, city For example, if you want to let 2 errors in an input, you can do: ;; a na

Re: Model validation - exceptions as side-effects?

2013-08-18 Thread Christian Sperandio
Le 18 août 2013 06:00, "Alexandr Kurilin" a écrit : > > My thought process was that at this point I have a pure API that either gets the right inputs or it simply does nothing. As in, no helping messages about what went wrong, no attempt to do recovery. Some claim that for security purposes errors

Re: memoization help

2013-08-16 Thread Christian Sperandio
You've understood well the memoization. So, your sole solution is to extract the board argument from the function you want to cache. Le 16 août 2013 14:14, "Jim - FooBar();" a écrit : > Hi all, > > I've got a memoization question... > > my chess-engine spends most of its time calculating legal

Re: Do you like the Clojure syntax?

2013-08-14 Thread Christian Sperandio
And if you're a JavaScript developer with an extreme mind, you minimize your code to have no space. Le 14 août 2013 18:12, "Dan Cross" a écrit : > On Wed, Aug 14, 2013 at 12:08 PM, Chris Ford > wrote: > >> Two obviously. It's the only compromise between those who want everything >> to be a prime

Re: Searching for Regular Expressions in a file

2013-08-13 Thread Christian Sperandio
Is the number of lines known and is it fixed? If it is then you can load the file inside a window, don't you? Le 13 août 2013 20:32, "JvJ" a écrit : > I had some difficulty with the line seq because I was looking for > multi-line patterns. I'll try the char-seq thing. > > On Monday, 12 August 20

Re: Do you like the Clojure syntax?

2013-08-13 Thread Christian Sperandio
:53, "Alex Baranosky" a écrit : > To me you cannot separate Clojure's syntax from its capabilities, because > a number of its capabilities are enabled by the syntax. > > On Mon, Aug 12, 2013 at 10:55 PM, Christian Sperandio < > christian.speran...@gmail.com> wrote: &g

Re: Do you like the Clojure syntax?

2013-08-12 Thread Christian Sperandio
I think the choice of a language has always a subjective part. Particularly when you learn a language by yourself for pleasure. Because it's 'for pleasure' you want to learn a fun stuff. At work, I believe the subjective part works against a choice. Currently, at my office, the 8 other colleague

Re: Should ` ` be trimmed using `clojure.string/trim`? EOM

2013-08-11 Thread Christian Sperandio
  is closer an expression than a single character. A regexp replace should be more suitable. Le 11 août 2013 22:55, "Tim Visher" a écrit : > Should ` ` be trimmed using `clojure.string/trim`? EOM > > -- > -- > You received this message because you are subscribed to the Google > Groups "Clojure"

Re: Clojure 1.5.1 and Sockets

2013-08-11 Thread Christian Sperandio
Thanks for your answer. I'm wrapping the Java methods so. Without regret or remorse :) -- -- 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 - p

Re: Leiningen 2.3.0 and uberjar

2013-08-11 Thread Christian Sperandio
The workaround works fine, thanks for your help :) I give below the workaround, thus everybody can get it: $ lein clean && lein compile && lein uberjar -- -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure

Clojure 1.5.1 and Sockets

2013-08-11 Thread Christian Sperandio
Hi, Is there a socket management with Clojure 1.5.1? I found the create-server function in the clojure.contrib but (except any error) the clojure.contrib is outdated with the last version of Clojure. And I didn't find any clue about client socket management. Should I wrap Java classes? Thanks.

Re: apply inc

2013-08-10 Thread Christian Sperandio
When you write (apply inc [4 5]) it's like (inc 4 5) But the inc function accepts only one argument. -- -- 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

Leiningen 2.3.0 and uberjar

2013-08-10 Thread Christian Sperandio
Hi, I've installed the last lein version. But when I do: $ lein new app jartest $ lein uberjar At this time, 2 jars are created. Then I call: $ java -jar target/jartest-0.1.0-SNAPSHOT-standalone.jar And I get this error: Caused by: java.lang.ClassNotFoundException: jartest.core at java.net.UR

Re: In what OS do you code?

2013-06-15 Thread Christian Sperandio
It's true before the os x emacs version was tedious. But now, I use os x mountain lion with the last emacs version for os x and those issues are no more. I've the same keyboard shortcuts as my previous ubuntu installation :) Le 15 juin 2013 à 12:04, Max Penet a écrit : > What OS? Emacs of co

In what OS do you code?

2013-06-15 Thread Christian Sperandio
Hi, I use os x for my dev. I regularly switch between os x and linux for many years now. When my computer is too old to get a newer os x version, I switch to linux to have more usability years (I keep my computer 7-8 years). I avoid Windows the more I can because I don't like this os and I'm a f

Re: Exception propagation design in Clojure web APIs.

2013-03-20 Thread Christian Sperandio
Use exceptions for control flow makes the developer's work easier but not the one of reader. In other terms the maintenance may become more difficult for the reason given by John. And I think when exceptions are used for control flow, the original exception meaning is forgotten: Exceptions shou

ANN clj-javafx 0.2

2013-01-06 Thread Christian Sperandio
Hi, I released the version 0.2 of clj-javafx. You can find it here: https://github.com/chrix75/clj-javafx/tree/clj-javafx/0.2 As a reminder, this project helps you out to use JavaFX with Clojure. You have information about this project in the Wiki pages. Chris -- You received this message bec

Re: Issues with record and atom

2013-01-05 Thread Christian Sperandio
I tried by using map instead of record and I've got the same issue. -- 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 y

Issues with record and atom

2013-01-05 Thread Christian Sperandio
Hi, I want to define a record that represents a tree items. The idea is each item is a component that can have parent and children. The parent and the children are components too, So, I define this record by: (defrecord Component [name children parent]) After, I declare 2 components: (def pare

Re: Are strings expensive for memory on the JVM?

2013-01-05 Thread Christian Sperandio
Fine :) It's a nice improvement. Else, to have an idea about the memory management I found a good article again: http://www.ibm.com/developerworks/java/library/j-codetoheap/index.html It's interesting to understand the twists and turns of the JVM memory usage :) On 01/05/2013 12:40 PM, Mar

Re: Are strings expensive for memory on the JVM?

2013-01-05 Thread Christian Sperandio
About the String's expensiveness, working a lot with this kind of objects, it's big enough. In fact, that depends if you have a lot of small strings then the used memory space can become important. For instance, the word "Bazinga" takes almost 60 bytes in memory (for a 32bits JVM) in which 24 by

Re: Call namespace's functions from a record

2012-12-24 Thread Christian Sperandio
e this: (children? c) and make sure you can see the test-record.component namespace from your user ns (apart from importing the record class). HTH, Jim On 24/12/12 11:55, Christian Sperandio wrote: Hi, I'm testing the use of records in Clojure and I have some issues when I try to

Call namespace's functions from a record

2012-12-24 Thread Christian Sperandio
Hi, I'm testing the use of records in Clojure and I have some issues when I try to call function of another namespaces from the record. For testing purposes, I defined this record: (ns test-record.component (:use test-record.utils)) (defprotocol Hierarchical "Protocol for tree." (childre

Re: hash of 0 and nil

2012-12-21 Thread Christian Sperandio
l must probably have a hash equal to '() for example) On Fri, Dec 21, 2012 at 9:05 AM, Christian Sperandio > wrote: I write again my post because the previous was bad written and I want to respect the Englis language the more as I can. With your question, I&#

Re: hash of 0 and nil

2012-12-21 Thread Christian Sperandio
hash (if there is no good reason) would result in many useless collisions. However, there might be a good reason to have nil and 0 having the same hash. (nil must probably have a hash equal to '() for example) On Fri, Dec 21, 2012 at 9:05 AM, Christian Sperandio mailto:christian

Re: hash of 0 and nil

2012-12-21 Thread Christian Sperandio
I write again my post because the previous was bad written and I want to respect the Englis language the more as I can. With your question, I'm feeling you think each item has a different hash code. But it's wrong. You can meet collisions. An hash code is not an id, it's a way to find an element

hash of 0 and nil

2012-12-20 Thread Christian Sperandio
With your question, I'm feeling you think each item has a different hash code. But it's wrong. You can meet collisions. An hash code is not an ident, it's a way to find an element. So even if it's weird to have the same hash code for 0 and nil, at least you meet a case of collisions. That can b

Re: JavaFX and Clojure

2012-12-16 Thread Christian Sperandio
eaner Le dimanche 16 décembre 2012 00:24:34 UTC+1, Christian Sperandio a écrit : > > I had a test to show how it work. > > > Le samedi 15 décembre 2012 22:10:50 UTC+1, Christian Sperandio a écrit : >> >> Hi, >> >> After some studies about JavaFX with Clojure,

Re: JavaFX and Clojure

2012-12-15 Thread Christian Sperandio
I had a test to show how it work. Le samedi 15 décembre 2012 22:10:50 UTC+1, Christian Sperandio a écrit : > > Hi, > > After some studies about JavaFX with Clojure, and bricks broke with my > head, I wrote a sort of wrapper to work more easily with both. > It's here : htt

JavaFX and Clojure

2012-12-15 Thread Christian Sperandio
Hi, After some studies about JavaFX with Clojure, and bricks broke with my head, I wrote a sort of wrapper to work more easily with both. It's here : https://github.com/chrix75/javafx-clj You can play with JavaFX in your REPL and you have the macro with-javax and wit-javafx-let that let you wri

Re: Import many classes with the same name

2012-12-14 Thread Christian Sperandio
plication Application Platform])) > > ; This one is javafx.application.Application > (Application.) > > ; and this one is javafx.clojure.Application > (javafx.clojure.Application.) > > Hope it helps, > > J > > On Friday, December 14, 2012 10:40:28 PM UTC-3, Christia

Import many classes with the same name

2012-12-14 Thread Christian Sperandio
Hi, I'm writing a wrapper to use JavaFX with Clojure. But I hava an issue. I called a class javafx.clojure.Application, then in a source code I wrote: (ns javafx-clj.wrapper (:import javafx.clojure.Application) (:import javafx.application.Application javafx.application.Platform)) ... But w

Re: A bearded person, Clojure and JavaFX

2012-12-06 Thread Christian Sperandio
I thank you and Dave for your lights about JavaFX. You motivated me to continue testing JavaFX. I think my main error is to try write code in Java and then translate this code into clojure. Chris Le 6 déc. 2012 à 01:08, Stephen Compall a écrit : On Dec 5, 2012 6:38 PM, "Christian Sper

Re: A bearded person, Clojure and JavaFX

2012-12-05 Thread Christian Sperandio
re I'm happy about it, but I think most > UI's are done in a browser now, and if you haven't checked out > clojurescriptone.com yet I'd take a look. > > > > On Wed, Dec 5, 2012 at 5:38 PM, Christian Sperandio < > christian...@gmail.com > wrote: >

A bearded person, Clojure and JavaFX

2012-12-05 Thread Christian Sperandio
Hi, I'm one of those bearded (Lin)Unixians person who love the black screen. I'm closer to back-office than front-office (it's may be my (too) pragmatic mind). But sometimes, for some programs, a GUI is a good thing for users. In particular when the sofware is not for barbed person :) First, I

Re: JavaFX2, problem with overriden constructor

2012-12-01 Thread Christian Sperandio
I feel shame. I didn't think try this solution. Thanks. 2012/12/1 Sean Corfield > On Sat, Dec 1, 2012 at 11:58 AM, Christian Sperandio < > christian.speran...@gmail.com> wrote: > >> When I try to use the following constructor >> *Scene<http://docs.o

JavaFX2, problem with overriden constructor

2012-12-01 Thread Christian Sperandio
Hi, I continue learning JafaFX with Clojure and I've got an issue with the Scene constructor. When I try to use the following constructor *Scene*(Parent

Re: First test with JavaFx and blocked yet :(

2012-12-01 Thread Christian Sperandio
the class you > want to use instead of the weird detection thing > > > > > > On Fri, Nov 30, 2012 at 3:38 PM, Christian Sperandio > wrote: > Hi, > > I'm testing JavaFX with Clojure 1.4 and I've got some issues. > I wrote

First test with JavaFx and blocked yet :(

2012-11-30 Thread Christian Sperandio
Hi, I'm testing JavaFX with Clojure 1.4 and I've got some issues. I wrote this code: (ns test-javafx2-clj.core (:import javafx.application.Application javafx.stage.Stage (javafx.scene Parent Scene)) (:gen-class :extends javafx.application.Application)) (defn -main

Re: Arity problem with multi-methods

2012-11-21 Thread Christian Sperandio
to nil or restart the swank/nrepl server. It doesn't update that on recompilation. Sidhant On Thursday, November 22, 2012 3:44:10 AM UTC+5:30, Christian Sperandio wrote: > > Hi, > > I try to define multi-methods but when I call one I get an exception. > > I decl

Arity problem with multi-methods

2012-11-21 Thread Christian Sperandio
Hi, I try to define multi-methods but when I call one I get an exception. I declared the multi-methods like below: (defmulti new-food-item (fn [food expiration] (if (number? expiration) ::duration ::expiration-date

Re: with-open and line-seq

2012-10-28 Thread Christian Sperandio
I've got a question about lazy-sequence and file reading. Is line-seq good to process lines from huge file? Let take this case, I want to process each line from a file with one or more functions. All lines must be processed. Line-seq return a lazy sequence, it means all already read lines stay i

Re: [ANN] Leiningen 2.0.0-preview9 released

2012-08-25 Thread Christian Sperandio
I found. I went to a project folder and launching lein help, lein downloaded the necessary package. And now, it seems ok. But it's weird I couldn't do a lein help in any folder. Chris Le samedi 25 août 2012 08:53:09 UTC+2, Christian Sperandio a écrit : > > Hi, > > I did

Re: [ANN] Leiningen 2.0.0-preview9 released

2012-08-24 Thread Christian Sperandio
Hi, I did a lein upgrade and now when I launch lein, I've got this error: chrix@Batman:~$ lein help Check :dependencies and :repositories for typos. It's possible the specified jar is not in any repository. If so, see "Free-floating Jars" under http://j.mp/repeatability Could not resolve dependen

Re: assoc! order problem

2012-08-05 Thread Christian Sperandio
Hi, By default, maps are array-map for short map and hash map for larger one. That explains why the map seems sorted at the beginning. Christian Le 5 août 2012 à 10:40, Evan Mezeske a écrit : > I know the sorted-map, but my question is : why the map is not 'ordered' when > size is larger tha

Re: Using gen-class to generate methods with same names and arities but different type signatures

2012-08-02 Thread Christian Sperandio
Hi, The problem may be come from the name of the class. Do you try to change the name of your class? For example, replace Class by Foo or another word. I'm not sure it's the correct answer :$ 2012/8/2 David Greenberg : > Hi Clojurians, > I'm finding myself far down the rabbit hole of gen-class.

Re: What concurrency models to document?

2012-08-01 Thread Christian Sperandio
Hi, I don't like the term auto-concurrency because auto-concurrency doesn't exist. The immutability make easier the concurrency programming because you don't have to manage the shared data but, you always have the synchronising management and write specific code for concurrency (using pmap, futu

Re: CSV Parser

2012-07-26 Thread Christian Sperandio
Below the link :) https://gist.github.com/3184210 Thanks 2012/7/26 Jeremy Heiler : > On Wed, Jul 25, 2012 at 7:31 PM, Christian Sperandio > wrote: >> hi, >> >> I started learning Clojure programming these last days. For my training, I >> developped a CSV parser. &g