Problem installing slime

2010-09-12 Thread Oskar
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 ~

Re: Problem installing slime

2010-09-13 Thread Oskar
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

Why is this code so slow?

2011-07-22 Thread Oskar
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

Re: Why is this code so slow?

2011-07-22 Thread Oskar
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

Re: Why is this code so slow?

2011-07-24 Thread Oskar
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

Re: Invitation for Open Source Project

2011-07-26 Thread Oskar
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

Code structure/design problems

2011-07-27 Thread Oskar
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

Re: How to write `when-lets`

2011-07-27 Thread Oskar
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

Re: How to write `when-lets`

2011-07-27 Thread Oskar
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"

Re: How to write `when-lets`

2011-07-27 Thread Oskar
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

Re: Code structure/design problems

2011-07-27 Thread Oskar
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

protocols and records -- use when?

2011-07-28 Thread Oskar
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

Re: protocols and records -- use when?

2011-07-28 Thread Oskar
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

Re: Code structure/design problems

2011-07-28 Thread Oskar
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

Re: Code structure/design problems

2011-07-28 Thread Oskar
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

Re: protocols and records -- use when?

2011-07-29 Thread Oskar
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

"I don't feel the absence of a debugger, because I've learnt enough that I don't ever need a debugger."

2013-05-27 Thread Oskar Kvist
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

[ANN] map-regexps, regexps for map seqs instead of text

2015-03-26 Thread Oskar Kvist
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'

Vim+fireplace+lein repl+tools.namespace give: "nREPL: namespace not found"

2014-05-02 Thread Oskar Kvist
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

Re: Vim+fireplace+lein repl+tools.namespace give: "nREPL: namespace not found"

2014-05-02 Thread Oskar Kvist
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

Re: Vim+fireplace+lein repl+tools.namespace give: "nREPL: namespace not found"

2014-05-02 Thread Oskar Kvist
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

Re: Vim+fireplace+lein repl+tools.namespace give: "nREPL: namespace not found"

2014-05-02 Thread Oskar Kvist
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 >

Re: Vim+fireplace+lein repl+tools.namespace give: "nREPL: namespace not found"

2014-05-02 Thread Oskar Kvist
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

A Design (Simplification) Problem

2013-11-13 Thread Oskar Kvist
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

Re: A Design (Simplification) Problem

2013-11-15 Thread Oskar Kvist
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

Coding while running the program

2013-03-23 Thread Oskar Kvist
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

Re: Coding while running the program

2013-03-23 Thread Oskar Kvist
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

Re: Coding while running the program

2013-03-23 Thread Oskar Kvist
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

Re: Coding while running the program

2013-03-24 Thread Oskar Kvist
. 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

Re: Predicate problem

2011-08-02 Thread Oskar Kvist
"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

Re: Predicate problem

2011-08-02 Thread Oskar Kvist
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

Re: Predicate problem

2011-08-02 Thread Oskar Kvist
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:

Re: Predicate problem

2011-08-02 Thread Oskar Kvist
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

Nasty java interop problem -- ideas?

2011-08-12 Thread Oskar Kvist
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.

Re: Nasty java interop problem -- ideas?

2011-08-12 Thread Oskar Kvist
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.

Designing for Simplicity

2012-11-17 Thread Oskar Kvist
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

Strange behavior with future

2012-12-29 Thread Oskar Kvist
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

Re: Strange behavior with future

2012-12-30 Thread Oskar Kvist
(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

Re: Strange behavior with future

2012-12-30 Thread Oskar Kvist
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

Re: Releasing Caribou today: Open Source Clojure Web Ecosystem

2013-11-18 Thread Oskar Boethius Lissheim
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