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
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
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
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
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
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)
>
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,
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
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
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
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 $
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
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
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
(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
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) (
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
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
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:
>
> >
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
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
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
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
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
>
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
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
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
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
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
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,
>>>
> 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
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:
>&
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
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
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
> 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
>>
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).
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
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
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
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
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.
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
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
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
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
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
)
-> #
(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
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
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
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
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
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
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
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"
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
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
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
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
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
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
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
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:
>
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
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
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
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
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
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)))
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
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
> >
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:
> &
72 matches
Mail list logo