Hey!
I am trying to set up clojure for emacs. I use ubuntu and gnu emacs
23. I followed this guide
http://riddell.us/ClojureWithEmacsSlimeSwankOnUbuntu.html
In particular, I did:
~$ cd opt
~/opt$ git clone git://github.com/jochu/clojure-mode.git
~/opt$ git clone git://git.boinkor.net/slime.git
~
Thank you! I'll check it out.
On Sep 12, 9:03 pm, Phil Hagelberg wrote:
> On Sat, Sep 11, 2010 at 7:55 PM, Oskar wrote:
> > I am trying to set up clojure for emacs. I use ubuntu and gnu emacs
> > 23. I followed this
> > guidehttp://riddell.us/ClojureWithEmacsSlimeSw
Hi!
I was doing some project euler problems and I wrote the following
code. It is really slow, and I would like to know why and how it can
be made faster. Not that I care much about this code in particular,
but I want to understand Clojure better.
(def vs (int-array 401))
(def ss (boo
Thanks for the replies everyone!
About the Python version not being recursive: Oh yeah, didn't even
think about that, but it shouldn't matter that much, or? With all the
right type hints the clojure version should be much faster than the
previous one even with recursion, right?
On Jul 22, 10:51 p
On Jul 23, 4:06 pm, Dmitry Gutov wrote:
> Ahem.
>
> Here is a more idiomatic version that runs under half a second, no
> annotations required.
I did that from the beginning, but as I really needed 4e6 and not 1e5
elements, that map got very big. And I didn't remember the argument to
give java mor
What's the application supposed to do?
On Jul 26, 6:27 pm, Peter Penzov wrote:
> Hi,
> I'm starting a open source project which involves web based Java,
> JBoss application server and JBoss Seam 3. I'm a student and I work on
> the project in my free time for training. Every one who want to t
Hi!
I'm making a game with Clojure. And I have a few code structure/design
problems.
I have an atom with characters (a map of maps) in my main file. But
because I don't want to make that file too big I have, for example, a
file called "ai.clj" with AI stuff, that I require from the main file.
For
I tried to solve this, and, having very litte macro-writing
experience, just looked at when-let and tried to modify it to work
with multiple binds. This is what I ended up with:
(defmacro when-lets
[bindings & body]
(if-not (seq bindings)
`(do ~@body)
(let [form (bindings 0) tst (bindi
On Jul 27, 8:56 pm, Dmitry Gutov wrote:
> > First: Why doesn't macroexpand expand the inner when-lets?
>
> It's not supposed to, see the doc. To do full expansion, you can use
> `clojure.walk/macroexpand-all`.
Oh, yeah. Thanks!
> > Is the gensym in the two expands the same thing, or do "they"
On Jul 27, 9:23 pm, Alan Malloy wrote:
> On Jul 27, 11:56 am, Dmitry Gutov wrote:
>
> > > First: Why doesn't macroexpand expand the inner when-lets?
>
> > It's not supposed to, see the doc. To do full expansion, you can use
> > `clojure.walk/macroexpand-all`.
>
> > > Is the gensym in the two ex
On Jul 27, 5:07 pm, Benny Tsai wrote:
> Hi Oskar,
>
> I just came across this article yesterday, which I thought you may find
> useful. It's a 4-part series where the author discusses his experience
> implementing games in a functional style:
>
> http://prog21.dadgum.co
Hi!
I have not heard much about records and protocols. What is a typical
use case in idiomatic Clojure code for them? Is it a good idea, for
example, to make a "Character" protocol and "Player" and "Monster"
records or something in a game. It feels a bit too much like OOP for
me to be comfortable
mostly to filter the
map, for example monsters can only attack players.
Is it a good idea to use protocols (and records?) for me in this
situation (now or in the future when I might want them to behave
differently)? How can I benefit from them?
On Jul 28, 1:46 pm, Alex Osborne wrote:
> O
Wow, thank you everyone! Lots of great responses. I'm going to take
some time to let it all sink in.
> I'd say "yes" if only for the experience of writing a "purely functional"
> game (minus the I/O, of course). I wrote a Pong clone in a similar way,
> though I don't share that author's dislike
On Jul 28, 6:40 pm, Islon Scherer wrote:
> Hi Oskar, I've been a game programmer for more than 5 years going from
> simple card games to 3D MMORPGs.
> Even though you can make a simple game in a functional way it would be a big
> challenge to do the same with a modera
Thank you everyone. I now have a much better understanding of
protocols aed records. This video helped too http://vimeo.com/11236603
On Jul 29, 3:01 pm, Jeff Heon wrote:
> Thanks for the clarification. I see I was mixing up various concepts
> in my head.
>
> On Jul 29, 8:19 am, Alex Osborne wrot
Stuart Halloway said in his video Clojure in the Field (
http://www.infoq.com/presentations/Clojure-tips) from March 1, 2013 (I
think): "I don't feel the absence of a debugger because I've learnt enough
that I don't ever need a debugger." I am very intrigued by that statement.
What does he (or y
Hi!
(let [a {:a 1} b {:b 1}]
(map-regexps/re-seq "{:a 1}+" [a b a a]))
> ([{:a 1}], [{:a 1} {:a 1}])
Check out https://github.com/oskarkv/map-regexps I hope you find it useful!
This is my very first public library, so feel free to give comments and
critique about anything and everything. I'
Hi!
I'm using Vim, vim-fireplace, `lein repl`, and tools.namespace.
When I run `(tools.namespace.repl/refresh)` from within vim via fireplace,
it usually (perhaps always) works the first time. Say there is a simple
error like a misspelled word. The second time I try to run
`(tools.namespace.re
And to be clear, the fireplace issues that I found when searching for a
solution have all been fixed and closed.
On Friday, May 2, 2014 6:06:59 PM UTC+2, Oskar Kvist wrote:
>
> Hi!
>
> I'm using Vim, vim-fireplace, `lein repl`, and tools.namespace.
>
> When I run `(tools
Although, sometimes it works. I don't know exactly what conditions triggers
it. Maybe it depends on where the error is, what type of error it is, or
something else. Sigh.
On Friday, May 2, 2014 6:06:59 PM UTC+2, Oskar Kvist wrote:
>
> Hi!
>
> I'm using Vim, vim-firep
06:59 PM UTC+2, Oskar Kvist wrote:
>
> Hi!
>
> I'm using Vim, vim-fireplace, `lein repl`, and tools.namespace.
>
> When I run `(tools.namespace.repl/refresh)` from within vim via fireplace,
> it usually (perhaps always) works the first time. Say there is a simple
>
05:16:41PM -0700, Oskar Kvist wrote:
> > Hi guns, thanks for your input!
> >
> > I see, but it only happens from within Vim, not if I run `ctnr/refresh`
> in
> > the repl outside vim. I made an issue on fireplace's github that
> describes
> > how to repr
Hi!
I'm making an MMORPG. For those of you not into games, MMORPG is short
for massively multiplayer online role-playing game. That means that
hundreds of players can connect to the same server and play a role
playing game simultaneously. There is of course a big game state on the
server that chan
Thank you everyone for your input!
@James
Hm, I think I understand what you mean. Interesing idea, I will think some
more about it.
@Sacha
Ah, yes, of course. I don't know why I didn't think of it. Probably because
I had I similar idea when I first started out but discarded it for some
forgo
Hi!
I saw this video http://www.youtube.com/watch?v=BES9EKK4Aw4 of Notch coding
on Minecraft while the game was running, and of course seeing the changes
in the running program. He used some kind of debug mode in his IDE (I don't
really know which IDE). I want to make a game, and I want to to a
eature to make something
> entertaining :) .
>
> I'm making a game with a tool called GameMaker. Not as full-featured or
> powerful as with a programming language? Sure, but then I want to first
> have a game under my belt, then I'll worry about looking cool in the
> process
s or something else that's fun.
>
> Look, I'm not trying to be mean, but unless you have a specific goal in
> mind, then
> this new feature is a waste of time :) .
>
> On Sat, Mar 23, 2013 at 12:20 PM, Oskar Kvist
> > wrote:
>
>> It's not about looking
. This allows you
> to change the game without recompiling the entire engine unnecessarily.
>
>
> On Mar 23, 2013, at 5:06 PM, Oskar Kvist >
> wrote:
>
> John: I don't really understand why you say it's a waste of time. Speeding
> up the feedback cycle seems g
"Returns true if _key_ is present in the given collection, otherwise
returns false."
For sets like #{200, 210} the values also count as keys.
On Aug 2, 10:10 am, Petr Gladkikh wrote:
> I spent hour already and can not understand what is wrong here.
>
> I want to filter collection based on a nest
Sorry, didn't read your post properly. Maybe it's because the ints are
of different types.
(contains? [(int 1)] (long 1))
false
On Aug 2, 10:13 am, Oskar Kvist wrote:
> "Returns true if _key_ is present in the given collection, otherwise
> returns false."
>
&g
Btw, that should be fixed in 1.3 I think.
On Aug 2, 10:18 am, Oskar Kvist wrote:
> Sorry, didn't read your post properly. Maybe it's because the ints are
> of different types.
>
> (contains? [(int 1)] (long 1))
> false
>
> On Aug 2, 10:13 am, Oskar Kvist wrote:
I'm stupid today... I meant:
(contains? #{(int 1)} (long 1))
false
On Aug 2, 10:19 am, Oskar Kvist wrote:
> Btw, that should be fixed in 1.3 I think.
>
> On Aug 2, 10:18 am, Oskar Kvist wrote:
>
>
>
>
>
>
>
> > Sorry, didn't read your post pr
Hi!
I have the following problem. I'm using a Java lib for making GUIs.
One lays out the GUI in XML, then uses a Controller (Listener type
thing) to do stuff. For example, in the XML one might have
onClick="doSomething()". And then reflection is used to find the
method of the controller instance.
Oh yes, of course. Why didn't I think of that? For some reason,
implementing 2 interfaces never occurred to me. :P
On Aug 12, 4:48 pm, David Powell wrote:
> > The simplest so far seems to be to use gen-interface to create a
> > subinterface of Controller with all the methods I need, or gen-class.
Hi!
I have listened to Rich's presentation Simple Made Easy, and he has
convinced me of the virtures of simplicity. However, I am not so good at
designing simple stuff myself. Writing things down makes me think more
clearly, and I was also hoping that you can help me by giving some input
and c
Hi!
I'm trying to play a sound in my application,
using http://www.javazoom.net/javalayer/documents.html that lib. Anyway, I
tried playing the sound in a future, so the main thread would not block
while playing, like so: (future (-> in Player. .play)). But if I don't
deref the future, the soun
(recur
(shutdown-agents))
On Monday, December 31, 2012 12:12:09 AM UTC+1, Moritz Ulrich wrote:
>
> Laziness might be your problem, but that wouldn't explain (println
> "called") working without a deref.
>
> Can you show a bit more code around this call
Oh, now I understand! I close the stream (in the with-open) in the main
thread before the other thread got a chance to play it.
On Monday, December 31, 2012 3:49:25 AM UTC+1, Oskar Kvist wrote:
>
> Ok, here is some more code:
>
> The line (-> in Player. .play) nil)) in the first f
Seriously impressive stuff. Great to have two super interesting takes on
clojure web frameworks (pedestal and now caribou).
--
--
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 po
40 matches
Mail list logo