setting vars with macro

2010-05-15 Thread islon
game state without using transactions, agents, etc. Any comments about it? Islon -- 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

Re: setting vars with macro

2010-05-17 Thread islon
Thanks for the answers. I realized the macro wasn't a good idea and I will keep using atoms to manage state, just found the reset! function =) Islon On May 17, 10:28 am, Michael Gardner wrote: > On May 15, 2010, at 4:56 PM, islon wrote: > > > I'm working in a simple singl

Re: Simlpe style question

2010-05-19 Thread islon
col2 row2))) I don't think this is less idiomatic. Just my 2¢. Islon On May 19, 8:56 am, edlich wrote: > Dear Community, > > I have one question about readability. As I am not yet deep into > Clojure I can only post scala but I am sure you will get my point. > > Recentl

clojure date library

2010-05-24 Thread islon
I missed a date/time API in clojure so I made one myself. Is it possible to put it in clojure.contrib? Sugestions, critics and improvements are welcome. -> http://www.copypastecode.com/29707/ Islon -- You received this message because you are subscribed to the Google Groups "Clojure&qu

primitive meta data

2008-10-15 Thread Islon
t f = 1.8f; float f2 = 567.09723f; for(int i = 0; i < 1000; i++) { f /= f2; } return f; } Regards. Islon --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "C

Re: primitive meta data

2008-10-15 Thread Islon
ar > <[EMAIL PROTECTED]> wrote: > > > > On Oct 15, 8:34 am, Islon <[EMAIL PROTECTED]> wrote: > >> > >> (defn dumb-test [] > >> (let [#^Float f2 567.09723] > >> (loop [#^Float f 1.8, i 1000] > >> (if (zero? i) >

remainder function

2008-10-15 Thread Islon
Is there a remainder (rest of the division) function in closure? (as java '%' operator). I browse the docs but couldn't find one. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group,

Re: remainder function

2008-10-15 Thread Islon
Same problem for me. I didn't know there's a find-doc function, thanks! Regards On Wed, Oct 15, 2008 at 6:44 PM, Achim Passen <[EMAIL PROTECTED]>wrote: > > Hi, > > Am 15.10.2008 um 23:35 schrieb Islon: > > > Is there a remainder (rest of the divisi

Re: offtopic - where are you come from? (poll)

2008-10-17 Thread Islon
Islon Scherer from Brazil :) On Fri, Oct 17, 2008 at 9:52 AM, Randall R Schulz <[EMAIL PROTECTED]> wrote: > > On Friday 17 October 2008 02:27, Rastislav Kassak wrote: > > Hello Clojurians, > > > > I think after 1st year of Clojure life it's good to check how

string interpolation

2008-10-28 Thread Islon
Is there any chance closure will get string interpolation? Do things like (prn "Hi ${someone}, my name is ${myname}") is nice, not crucial of course, but nice. Islon --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Goo

Re: string interpolation

2008-10-29 Thread islon
Thanks for the macro. =) The str function is really a good replacement for interpolation. On Oct 28, 8:29 pm, "Graham Fawcett" <[EMAIL PROTECTED]> wrote: > On Tue, Oct 28, 2008 at 7:27 PM, Graham Fawcett > > <[EMAIL PROTECTED]> wrote: > > But for fun, here's an (i ...) macro, that will give you $

Re: Changes for AOT compilation

2008-11-14 Thread islon
These are great changes!! I see a bright future ahead. Thanks Rich. On 14 nov, 11:53, MikeM <[EMAIL PROTECTED]> wrote: > > Just lift your files up a directory to accommodate this change. Note > > that this implies that all namespaces should have at least 2 segments, > > and following the Java pa

Re: Just Wondering: Tag metadata

2008-11-14 Thread islon
There's no way to check types at compile time? (defn len2 [#^String x] (. x (length))) (defn wrong [] (len2 10)) Would be good if you could find such errors at compile time. Optional static typing =) Regards. Islon On 12 nov, 21:43, Rich Hickey <[EMAIL PROTECTED]> wrote: > O

clojure slime

2008-11-18 Thread islon
I checkouted the last clojure from svn, swank-clojure and clojure-mode too. When I start slime it give me the following errors: Clojure user=> (add-classpath "file:////home/islon/opt/swank-clojure/") nil user=> (require (quote swank)) java.lang.Exception: No such var: swank.u

Re: strings

2008-11-18 Thread islon
(defn string-reverse [s] (reduce #(str %1 " " %2) (reverse (seq (. s (split " ")) You're probably looking for something like this =) On Nov 18, 9:00 pm, joejoe <[EMAIL PROTECTED]> wrote: > hello all, > so I'm not only new to this group but I am new to Clojure.  I may be > going about this

Re: strings

2008-11-18 Thread islon
houser! > > > (apply str (interpose " " (reverse (.split "I am cold" " " > > > On Tue, Nov 18, 2008 at 7:15 PM, islon <[EMAIL PROTECTED]> wrote: > > >> (defn string-reverse [s] > >>  (reduce #(str %1 " " %2) (

Re: clojure slime

2008-11-18 Thread islon
commend moving back one rev by   > using: > > svn up -r 1109 > > from within your checkout of clojure/trunk. > > In the past, Jeff has updated swank-clojure very quickly on those rare   > occasions where Clojure changes enough to break it. Stay tuned. > > --Steve

mutability

2008-11-20 Thread islon
I'm porting my single thread simple mud-like rpg game from scala to clojure and one thing that is annoying me is the code needed to change some var. In scala I do things like that: val player = new Player(...) player.str += 1 in clojure I have to do (player is a struct and its attributes are re

Re: mutability

2008-11-20 Thread islon
strictly needed, but that is just my opinion. I miss some easy way to do mutability and object orientation, but otherwise clojure is great =) Islon On 20 nov, 17:38, Chouser <[EMAIL PROTECTED]> wrote: > On Thu, Nov 20, 2008 at 3:23 PM, islon <[EMAIL PROTECTED]> wrote: > > >

Re: mutability

2008-11-20 Thread islon
voke(Unknown Source) at clojure.lang.Compiler.eval(Compiler.java:4106) ... 10 more Ideas? Regards. Islon On Nov 20, 9:24 pm, Timothy Pratley <[EMAIL PROTECTED]> wrote: > Given that is the correct way to mutate state, why do we need so much > explicit syntax? > user=> (defn

Re: mutability

2008-11-20 Thread islon
I gave up, the resulting code would be a lot more complex than the scala version. But thanks for your advices. If anyone wants to port it I can send the source code, it's ~1000 lines total. Islon On Nov 20, 11:38 pm, harrison clarke <[EMAIL PROTECTED]> wrote: > i was thinking

Re: mutability

2008-11-21 Thread islon
know if the clojure version will be much more concise than the scala version. Scala is the most "low ceremony" language i found, even more than ruby, but idiomatic clojure is probably more, I think. Regards. Islon On 21 nov, 02:41, Timothy Pratley <[EMAIL PROTECTED]> wrote: > > St

Re: mutability

2008-11-21 Thread islon
I added the project in google code (github kept complaining about my public key) http://code.google.com/p/randomrpg/ I reduced the LOC to ~900. I'll try once more to port it to clojure (thanks for the macro Adam), but don't know when i'll be done. Regards. Islon On Nov 21, 4:27

Re: Eclipse Plugin- any plans for this?

2008-11-22 Thread islon
Is the plugin usable right now? On Nov 22, 8:53 am, lpetit <[EMAIL PROTECTED]> wrote: > Well, I'm also on board on the clojuredev team since yesterday, > > Take a look at the roadmap list (which currently is more a feature > wishlist than a prioritized list), and please help completing it, and >

Re: clojure date library

2010-05-24 Thread Islon Scherer
Thanks for the link. I wasn't aware of this library. Islon On May 24, 3:10 pm, David Nolen wrote: > On Mon, May 24, 2010 at 1:53 PM, islon wrote: > > I missed a date/time API in clojure so I made one myself. > > Is it possible to put it in clojure.contrib? > &g

Functions that return seqs

2013-07-02 Thread Islon Scherer
here a philosophical reason for that or it was implement this way because it's easier? Why conj is different? Doesn't it break the principle of least surprise? Thanks, Islon -- -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post

Re: Functions that return seqs

2013-07-02 Thread Islon Scherer
with vectors too, right now i'm using into or just calling vec|set or reducers library but maybe I'll try to implement this generics library I just talk about as it's really easy to do that in clojure =) Islon -- -- You received this message because you are subscribed to the Googl

Re: Multiple REPLs in Emacs? (was: test run startup time

2013-07-12 Thread Islon Scherer
Here at doo we have a shortcut "C-c X" where X is a number to change between nrepls. The code is in https://github.com/maxweber/emacs.d/blob/master/my/nrepl.el Note that the nrepl ports are hardcoded but it's good enough for us. Hope this helps. -- Islon On Thursday, July 11

wally: a alternative way to discover functions

2013-09-05 Thread Islon Scherer
Hey guys, I don't know about you but when I was a beginner in Clojure (and it still happens every now and then) I had a hard time finding functions using `doc` or `find-doc`, normally because I didn't remember the name of the function or because my only clue was a generic name so find-doc would

Re: wally: a alternative way to discover functions

2013-09-06 Thread Islon Scherer
direct match? > > > On Thu, Sep 5, 2013 at 10:34 PM, Mayank Jain > > wrote: > >> Looks pretty interesting. Thanks for sharing >> >> >> On Fri, Sep 6, 2013 at 2:53 AM, Islon Scherer >> >> > wrote: >> >>> Hey guys, >>>

Re: wally: a alternative way to discover functions

2013-09-06 Thread Islon Scherer
> Hello, > this gist does the similar thing: > https://gist.github.com/jaked/6084411 > > Maybe you can find some inspiration in it. > > Frantisek > > > On Thursday, September 5, 2013 11:23:28 PM UTC+2, Islon Scherer wrote: >> >> Hey guys, >> >> I don

Re: wally: a alternative way to discover functions

2013-09-07 Thread Islon Scherer
nforce purity :( > > I wonder if it would be possible to improve it using the core.typed > library and doing some kind of static analysis similar to Haskell's Hoogle > to filter out candidates. > > On Thursday, September 5, 2013 6:23:28 PM UTC-3, Islon Scherer wrote: >&

Re: wally: a alternative way to discover functions

2013-09-09 Thread Islon Scherer
wally approach is really cool. >> Thanks for sharing >> @maxrzepka >> >> Le jeudi 5 septembre 2013 23:23:28 UTC+2, Islon Scherer a écrit : >> >>> Hey guys, >>> >>> I don't know about you but when I was a beginner in Clojure (and it >>&g

Re: Is Korma still a good current choice for DB backend?

2014-07-23 Thread Islon Scherer
Sean, that was exactly what we did when we changed to yesql. With separated queries our Postgres specialist could optimize each query separately, and for the if nesting we used cond or core.match. Even with all the boilerplate of maintaining separated queries it was still much better than Korma

Write/reading java maps and lists using fressian/transit

2014-08-07 Thread Islon Scherer
Hi, I have a program I wrote who needs to serialize java HashMaps and ArrayLists to and from disk but AFAIK (and after some simple tests) it seems fressian writes those maps/lists correctly but read them back as clojure maps and lists (persistent). Is there a way to tell fressian (could be tran

Re: Write/reading java maps and lists using fressian/transit

2014-08-07 Thread Islon Scherer
> HTH, > /thomas > > On Thursday, August 7, 2014 2:48:20 PM UTC+2, Islon Scherer wrote: >> >> Hi, >> >> I have a program I wrote who needs to serialize java HashMaps and >> ArrayLists to and from disk but AFAIK (and after some simple tests) it >>

Re: Latest web framework for clojure

2014-02-28 Thread Islon Scherer
If you are learning go with a simple approach (compojure + http-kit + hiccup for example). If you already know clojure I recommend going with some library that provide everything as data, specially the routes, as the function composition approach of compojure only gets you so far (been there).

Re: Meta-eX - The Music of Code

2014-04-14 Thread Islon Scherer
Overtone is amazing, I'm planning on doing some experiments with it as soon as I finish the supercollider book and improve my music theory skills. On Friday, April 11, 2014 4:44:22 PM UTC+2, Sam Aaron wrote: > > > On 10 Apr 2014, at 03:18, Earl Jenkins > > wrote: > > > Good stuff, all the hard

Re: Do web apps need Clojure?

2013-11-14 Thread Islon Scherer
For me it's about 1 thing: Data. A web application is about taking data from the user, transform it and store it on the database and take data from the database, transform it and show it to the user. Clojure is the best language I used to work with data, it just gives you a composable set of to

Re: ClojureDocs.org

2010-07-16 Thread Islon Scherer
Hi. Does clojuredocs expose any external API (json, xml... rest, webservices, etc) so I can access the docs from my code? Islon On Jul 13, 11:40 pm, j-g-faustus wrote: > On Jul 13, 8:37 pm, Paul Moore wrote: > > > Can I suggest omitting the "Table of contents" sidebar w

clojure compiler

2010-08-05 Thread Islon Scherer
file dependencies? Islon -- 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 t

problem running tests in leiningen

2011-05-06 Thread Islon Scherer
quot;0.1.3"] [clj-time "0.3.0"]] :dev-dependencies [[swank-clojure "1.3.0"]] :aot [mediaretriever.media]) Any help is appreciated. Regards Islon -- You received this message because you are subscribed to the Google Groups "Clojure" group.

Re: Search for a node querying on attrs

2011-05-06 Thread Islon Scherer
This is what I did: (let [nodes (html/html-resource (StringReader. body)) meta-extractor (fn [m attr] (first (filter #(= (-> % :attrs :name) attr) m))) metas (html/select nodes [:meta]) title (-> (meta-extractor metas "title") :attrs :content) desc (-> (meta-extractor m

Re: problem running tests in leiningen

2011-05-06 Thread Islon Scherer
Thanks Stuart, the tests are working now. On May 6, 12:16 pm, Stuart Halloway wrote: > > I have a lein project and I'm trying to run my tests with lein test. > > The first problem I had was a class not found error in one of my > > records > > so I put "aot: [namespace.name]" in project.clj. > > I

Re: Learning Idiomatic Clojure

2011-05-12 Thread Islon Scherer
Read the joy of clojure, it's an amazing book that will teach you the way of clojure. Islon -- 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 member

Clojure ideas repository / todo list

2011-05-14 Thread Islon Scherer
100% sure it's not already implemented). Maybe a wiki or something like that would do the job. Thanks in advance, Islon -- 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 t

Re: Clojure ideas repository / todo list

2011-05-15 Thread Islon Scherer
Good ideas, I'm thinking about implementing it as my first clojure web project. 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 new members are moderated - ple

date-clj clojure date/time library

2011-06-29 Thread Islon Scherer
) -> # (monday) -> # (binding [*locale* (Locale/GERMAN)] (names :week-days)) -> ("Sontag" "Montag" "Dienstag" "Mittwoch" "Donnerstag" "Freitag" "Samstag") The project page is: http://github.com/stackoverflow/date-clj

Re: date-clj clojure date/time library

2011-06-29 Thread Islon Scherer
Thanks for the critic Laurent. set-date is not destructive, it creates a new date and returns it, the original is unaltered, but I agree that the documentation and the function name may be deceiving, I'll think about a better name and change the docs. Islon On Jun 29, 5:29 pm, Laurent

Re: Clojure for large programs

2011-07-04 Thread Islon Scherer
course some problems and refactor will happen no matter how well you designed, but you'll understand better what you did and what you should do. Islon On Jul 4, 9:40 am, James Keats wrote: > On Jul 4, 1:26 pm, James Keats wrote: > > > On Jul 4, 5:45 am, Christian Schuhegger > > A

Re: Anyone on Google+ yet?

2011-07-14 Thread Islon Scherer
http://gplus.to/islonscherer On Jul 14, 8:55 pm, Sean Corfield wrote: > On Thu, Jul 14, 2011 at 4:00 PM, ianp wrote: > > Looks like G+ is pretty popular with the Clojure crowd :-) > > I've been using it for a while and I don't see the point. With > Facebook for *friends* and Twitter for tech tal

Re: Fixing Java Apache Class error

2011-07-20 Thread Islon Scherer
It seems like you didn't put the apache HTTP client jars in your path. Are you using leiningen? If so you only need to run "lein deps" and it will download the dependencies. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send

Re: Fixing Java Apache Class error

2011-07-20 Thread Islon Scherer
Mark is right, you should use lein (or cake) repl instead of trying to run clojure on command line. -- 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 mod

Re: Being able to use blank?

2011-07-21 Thread Islon Scherer
I think it's just a sintax problem. (ns test-csv ... (:require [clojure.string :as str])) -- 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

Re: How to Return Vector of Vectors

2011-07-21 Thread Islon Scherer
Simple: conj doesn't mutate the vector, it returns a new vector. Clojure is a (mostly) immutable language, you're trying to solve the problem in a imperative way, you should solve it in a functional way. On Jul 21, 7:48 pm, octopusgrabbus wrote: > (def accumail-url-keys ["CA", "STREET", "STREET2"

JSON library for clojure 1.3

2011-07-22 Thread Islon Scherer
Is there a clojure json library that works in clojure 1.3? I tried danlarkin/clojure-json but it gives me error: java.lang.IllegalArgumentException: Unable to resolve classname: IPersistentMap, compiling:(org/danlarkin/json/encoder.clj:144) -- You received this message because you are subscribe

Re: JSON library for clojure 1.3

2011-07-22 Thread Islon Scherer
Thanks Sean, org.clojure/data.json worked like a charm. -- 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 p

Re: JSON library for clojure 1.3

2011-07-22 Thread Islon Scherer
I'll take a look, but I only need basic json encoding/decoding right now. Islon -- 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 modera

Re: Need Help Parsing Clojure Strings

2011-07-25 Thread Islon Scherer
Do you want something like: (vec (.split some-string "\\|")) (vec (.split "AT|1 Kenilworth Rd||Soapville|ZA|99901-7505|Option value=A ==> Normal street matchOption value=T ==> ZIP+4 corrected|013|C065|" "\\|")) => ["AT" "1 Kenilworth Rd" "" "Soapville" "ZA" "99901-7505" "Option value=A ==> Norma

Re: Code structure/design problems

2011-07-28 Thread Islon Scherer
ake your game 2 or 3 orders of magnitude faster to finish. Islon -- 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 wi

Re: learning clojure library

2011-08-03 Thread Islon Scherer
You can use (ns-publics 'your.namespace) to see every public intern mapping in this namespace. Islon -- 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

Re: Lambda: A lniux distro for clojurists

2012-05-26 Thread Islon Scherer
Why not create a shell script? On May 26, 9:32 am, Denis Labaye wrote: > Hi, > > This is a very interesting idea. It would have been of great use when I > did a Clojure workshop with complete beginners, with all kinds of OSes > (Windows, OSX, ...). > > I took the "Completely packaged VirtualBox i

Re: Top secret clojure project names

2011-09-01 Thread Islon Scherer
I have a big clojure project at work but it's not a secret. It superseded a old java project, the clojure one is 50 times smaller, 10 times faster and bug free. They had no choice but to accept the new one =) On Sep 1, 6:54 pm, Sean Corfield wrote: > On Thu, Sep 1, 2011 at 2:31 PM, JAX wrote: >

Re: advantage of dynamic typing

2011-09-20 Thread Islon Scherer
Scala is a OO language with FP support, clojure is a functional language with OO support, they are very different. It's normal for someone with a OO background to think that every method receives a object of some kind and it's good to know it's type in advance, and if you want polymorphism you c

Re: lein repl newbie question

2011-09-23 Thread Islon Scherer
Have you tried control+d? -- 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

Re: Re: lein repl newbie question

2011-09-23 Thread Islon Scherer
control+d exits clojure repl -- 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 th

Re: suggestion for clojure development

2011-09-28 Thread Islon Scherer
I agree with Nicolas, clojure should, at this point, focus on improving the language instead of maintain compatibility, and as most features of other languages can be implemented as macros I think clojure is ahead of the competition. -- You received this message because you are subscribed to t

Re: Learning clojure - comments on my function?

2011-09-29 Thread Islon Scherer
You probably want something like (defn split-zero [ls] (filter #(not= (first %) 0) (partition-by zero? ls))) -- 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

Re: Sum on a list of maps

2011-10-14 Thread Islon Scherer
The best i could think was: (defn calc-types [coll] (let [types (map (fn [m] {:type (get m "Type") :value (Double/parseDouble (get m "Value"))}) coll) ; convert keys to keywords and values to doubles it1 (sort-by :type types) ; sort by type a (atom (:type (first it1)))

record serialization

2010-11-23 Thread Islon Scherer
Hi people, I want to serialize records to further deserializing, is there a way to do that? (pr-str myrecord) doesn't seen to work. I was thinking about something like (to-map record) and (from-map RecordClass record) to serialize and deserialize. Any sugestions? Islon -- You received

Re: record serialization

2010-11-23 Thread Islon Scherer
face to the > records.http://java.sun.com/developer/technicalArticles/Programming/serializa... > > Regards, > Shantanu > > On Nov 23, 5:50 pm, Islon Scherer wrote: > > > > > > > > > Hi people, I want to serialize records to further deserializing, is > >

Re: record serialization

2010-11-24 Thread Islon Scherer
Thanks for the answers! Some guy told me on irc that you can implement interfaces right in the record definition like (defrecord R [a b] SomeInterface (methods...)) Regards. Islon On Nov 24, 4:25 am, Shantanu Kumar wrote: > Shantanu Kumar wrote: > > Islon Scherer wrote: > &