On 01.12.2009, at 02:42, Rich Hickey wrote:
> An updated version of the code for datatypes[1] and protocols[2] is
> now available in the 'new' branch[3].
This weekend I finally got around to converting all my deftype-and-
defprotocol-using code to the current Clojure new branch. It is now
more
On 07.12.2009, at 07:52, ataggart wrote:
> The functions >, <, >=, <= are only for numbers (though there might be
> a way to shadow them). You can use the compare function for anything
> implementing the Comparable interface (which should be easier to do
> when using deftype instead of defstruct)
Hello
What is the idiomatic way to implement the classic collide-with
function in Clojure?
I would like to implement something similar to the following (pseudo
code ahead):
(defmulti collide-with foo)
(defmethod collide-with ["asteroid" "spaceship"] (print "Boom"))
(defmethod collide-with ["aster
On Dec 7, 1:21 am, Tzach wrote:
> Hello
> What is the idiomatic way to implement the classic collide-with
> function in Clojure?
> I would like to implement something similar to the following (pseudo
> code ahead):
>
> (defmulti collide-with foo)
>
> (defmethod collide-with ["asteroid" "spaceshi
Thanks everyone for the recommendations.
2009/12/4 Steve Purcell :
>
> Here's what I do (in Cocoa Emacs 23) to make 'option' work the same in Emacs
> as in other OS X apps:
>
> (setq mac-command-modifier 'meta)
> (setq mac-option-modifier 'none)
> (setq default-input-method "MacOSX")
Hmm, I'v
I have a Macbooc Pro with Sweden keyboard so had a little different
issues here - by default not possible to type characters {[]} on
Carbon Emacs.
I solved it by adding the following to my .emacs file:
;; paredit-mode
(add-to-list 'load-path (expand-file-name "~/.emacs.d/paredit"))
(autoload 'par
I'm finding the behavior of leiningen new to be broken. It looks like
the initial implementation isn't clear about what exactly the project
name given as argument to lein new denotes. I'd like to fix this, but
before i hack on a patch, I'd be curious to know how this subcommand
was intended to work
Sorry, pressed send button too fast - here is correct elisp code:
(global-set-key (kbd "M-3") (lambda (&optional n)
(interactive "p")
(let ((last-command-event 35))
(self-insert-command n
On Mon, Dec
On Mon, Dec 7, 2009 at 3:11 AM, Konrad Hinsen
wrote:
> On 01.12.2009, at 02:42, Rich Hickey wrote:
>
>> An updated version of the code for datatypes[1] and protocols[2] is
>> now available in the 'new' branch[3].
>
> This weekend I finally got around to converting all my deftype-and-
> defprotocol
clojure-contrib also has a str-join function, which could be helpful
for joining SQL conditions:
(use '[clojure.contrib.str-utils :only (str-join)])
(str-join " AND " (map identity [1 2 3]))
Jim
On Sun, Dec 6, 2009 at 11:03 AM, samppi wrote:
> Also, you should also consider simply using the seq
> It does not look like wildcarding is supported in the ns macro and it
> seems silly to explicitly nominate each class that I want to have at
> my disposal. Am I thinking about this all wrong?
As far as i know you have to add each of them...
--
You received this message because you are subscrib
That is a useful hint.
Thanks - I'll check that out.
On Dec 6, 6:07 am, Phil Hagelberg wrote:
> "balln...@googlemail.com" writes:
> > Emacs /clojure-mode:
> > You need to install git to pull down the latest sources!
> > You needClojureandClojure-contrib (usually you cannot dowload
> > contrib bu
Hi,
On Dec 7, 10:21 am, Tzach wrote:
> (defmulti collide-with foo)
>
> (defmethod collide-with ["asteroid" "spaceship"] (print "Boom"))
> (defmethod collide-with ["asteroid" any] (print " Wiiissh"))
> (defmethod collide-with [any "spaceship"] (print "Wooossh"))
> (defmethod collide-with [any any
On 7 Dec 2009, at 11:15, Lauri Pesonen wrote:
> 2009/12/4 Steve Purcell :
>>
>> Here's what I do (in Cocoa Emacs 23) to make 'option' work the same in Emacs
>> as in other OS X apps:
>>
>> (setq mac-command-modifier 'meta)
>> (setq mac-option-modifier 'none)
>> (setq default-input-method "Mac
Hi,
I've write some python script for leiningen for Windows machines
without wget/curl.
I expect it is nicer than as-is bourne-shell-script version of 'lein'.
here is my little script:
http://github.com/ageldama/configs/blob/master/lein/lein.py
Thanks.
--
You received this message because y
That's great. Roland Sadowski has also written a Windows-friendly lein
script in PowerShell: http://gist.github.com/239210
On Dec 7, 8:15 am, "Jonghyouk, Yun" wrote:
> Hi,
>
> I've write some python script for leiningen for Windows machines
> without wget/curl.
>
> I expect it is nicer than as-
On Mon, 07 Dec 2009 06:53:38 -0500, Rich Hickey
wrote:
> Yes, methods are not really functions. Thinking about them as closures
> over the object is a good way to go - you can see that analogy in play
> when you consider recur, which works with these methods, but could not
> rebind 'this'. The
2009/12/7 Hugo Duncan
> On Mon, 07 Dec 2009 06:53:38 -0500, Rich Hickey
> wrote:
>
> > Yes, methods are not really functions. Thinking about them as closures
> > over the object is a good way to go - you can see that analogy in play
> > when you consider recur, which works with these methods, bu
2009/12/6 Bob Hutchison
>
> On 6-Dec-09, at 3:46 PM, Meikel Brandmeyer wrote:
>
> > Hi,
> >
> > Am 06.12.2009 um 21:29 schrieb Bob Hutchison:
> >
> >> It turns out that dispatching on play.foo.Foo is the only way that
> >> works. I was hoping ::f/Foo or f/Foo would work too (maybe my alias
> >> i
On Nov 30, 9:21 am, Dan Kefford wrote:
> OK... I'm trying to take Clojure for a spin on Project Euler problems.
> I have source files for each problem that I have solved and although I
> can refer to and invoke any one of them explicitly from a main class,
> I cannot seem to figure out how to re
On Dec 7, 9:07 am, Laurent PETIT wrote:
> 2009/12/7 Hugo Duncan
>
> > On Mon, 07 Dec 2009 06:53:38 -0500, Rich Hickey
> > wrote:
>
> > > Yes, methods are not really functions. Thinking about them as closures
> > > over the object is a good way to go - you can see that analogy in play
> > > whe
On Dec 7, 11:23 am, ataggart wrote:
> On Dec 7, 9:07 am, Laurent PETIT wrote:
>
>
>
>
>
> > 2009/12/7 Hugo Duncan
>
> > > On Mon, 07 Dec 2009 06:53:38 -0500, Rich Hickey
> > > wrote:
>
> > > > Yes, methods are not really functions. Thinking about them as closures
> > > > over the object is a
Every time I stick a println into some Clojure code to debug it, I
think to myself, "This is Lisp! I should be able to insert a repl
here!"
The problem is of course that Clojure's eval function doesn't know
about the surrounding lexical scope. So I started asking myself, what
is the simplest chang
On 7-Dec-09, at 12:17 PM, Laurent PETIT wrote:
> 2009/12/6 Bob Hutchison
>
>>
>> On 6-Dec-09, at 3:46 PM, Meikel Brandmeyer wrote:
>>
>>> Hi,
>>>
>>> Am 06.12.2009 um 21:29 schrieb Bob Hutchison:
>>>
It turns out that dispatching on play.foo.Foo is the only way that
works. I was hoping
> I'm pretty pleased with the results and wanted to show them off. More
> details here:
> http://georgejahad.com/clojure/debug-repl.html
Pretty slick work, George! Thanks for sharing!
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this g
On Dec 7, 12:37 pm, Bob Hutchison wrote:
> On 7-Dec-09, at 12:17 PM, Laurent PETIT wrote:
>
>
>
>
>
> > 2009/12/6 Bob Hutchison
>
> >> On 6-Dec-09, at 3:46 PM, Meikel Brandmeyer wrote:
>
> >>> Hi,
>
> >>> Am 06.12.2009 um 21:29 schrieb Bob Hutchison:
>
> It turns out that dispatching on pl
On 7-Dec-09, at 4:16 PM, ataggart wrote:
> On Dec 7, 12:37 pm, Bob Hutchison wrote:
>> On 7-Dec-09, at 12:17 PM, Laurent PETIT wrote:
>>> 2009/12/6 Bob Hutchison
>>
Yes! Thanks! The dispatch on type rather than class is the trick. I
actually ended up writing a macro, this is *much* bet
Hi,
I am writing because there seem to be missing functions in the API
webpage. The only one that I know for sure at the moment is the
filter function.
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@goo
hi,
why does that translation happen? is there some java issue/requirement?
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 - please
> why does that translation happen? is there some java issue/
> requirement?
I don't think '-' is valid in a Java class name.
http://java.sun.com/docs/books/jls/second_edition/html/lexical.doc.html#40625
user=> (Character/isJavaIdentifierPart \-)
false
user=> (Character/isJavaIdentifierPart \_
I've seen an example of launching a Clojure script from Java (http://
en.wikibooks.org/wiki/Clojure_Programming/
Tutorials_and_Tips#Invoking_Clojure_from_Java), but I've got an
application in which I'd like to run a REPL.
My app has its own JPanel for display results, and a text area for
input, so
On Dec 1, 9:56 pm, Rich Hickey wrote:
>
> There are 2 ways to make a deftype reach a protocol. First, you can
> implement the protocol directly in the deftype/reify, supplying the
> protocol where you do interfaces, and the methods of the protocol as
> methods of the type. The type will be made to
Hi,
Am 07.12.2009 um 21:37 schrieb Bob Hutchison:
>> Please note that in clojure, it's the dispatch on the class that's the
>> "trick", not on the type ;-)
>
> Sorry, I don't understand what you mean. Could you expand on that a bit?
Dispatch on the class (or interface) is sometimes the "trick"
On 7-Dec-09, at 4:05 PM, Meikel Brandmeyer wrote:
> Hi,
>
> Am 07.12.2009 um 21:37 schrieb Bob Hutchison:
>
>>> Please note that in clojure, it's the dispatch on the class that's
>>> the
>>> "trick", not on the type ;-)
>>
>> Sorry, I don't understand what you mean. Could you expand on that a
By golly, you're right. I'll take a look at why.
On Dec 7, 2:14 pm, cej38 wrote:
> Hi,
> I am writing because there seem to be missing functions in the API
> webpage. The only one that I know for sure at the moment is the
> filter function.
--
You received this message because you are subscr
> I don't think '-' is valid in a Java class name.
makes sense, and i learn something "new" every day...
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 m
On Sat, 2009-12-05 at 13:14 +0100, Konrad Hinsen wrote:
> On 4 Dec 2009, at 23:23, Cliff Wells wrote:
>
> > What isn't clear to me is exactly what a piece of paper provides
> > that an
> > electronic form doesn't (aside from inconvenience). I don't see any
>
> A clear legal status all over th
I am no expert at this, but this is what I have done
1. lein new mytestprj
2. go into the newly created dir and edit the project.clj and rename
from 'leiningen' to mytestprj (I think this is why your jar was
getting named leiningen.jar).
3. then do a 'lein deps' to copy the required libs into the
Hi all,
I am new to FP in general and I am trying to pick up Clojure. I am
having trouble thinking in FP terms.
I am trying to implement the Dijkstra algorithm for shortest paths in
Graph in Clojure. If this succeeds, I will implement all the advanced
graph algos I am learning in this course in C
I think the following is “looked down upon” or “discouraged“, but I
managed to sift through how clojure itself handles its own stuff in
java and I came up with the following.
Say, that you want to set *out*, *in*, and *err* in clojure to
something from Java before starting a REPL. Here is how I pa
I still think it would be neat if there was some DHTML coolness to
help narrow down the symbol names that come down the right side of the
page.
On Mon, Dec 7, 2009 at 4:00 PM, Tom Faulhaber wrote:
> By golly, you're right. I'll take a look at why.
>
> On Dec 7, 2:14 pm, cej38 wrote:
>> Hi,
>>
Yup, I heard that the first time :-)
It's coming, but not right this sec.
Tom
On Dec 7, 4:57 pm, Howard Lewis Ship wrote:
> I still think it would be neat if there was some DHTML coolness to
> help narrow down the symbol names that come down the right side of the
> page.
>
>
>
> On Mon, Dec 7,
Hi,
After git pull on new branch
commit 1da63ad10d2531264e86eb705a10b3cebc9b1067
Author: Rich Hickey
Date: Mon Dec 7 16:44:41 2009 -0500
init CLEAR_SITES
Got NPE in slime
java.lang.RuntimeException: java.lang.RuntimeException:
java.lang.RuntimeException: java.lang.RuntimeException:
java
I was getting this as well, but this was before the last 3 commits to new.
Did you wipe your old jars and class files and start afresh?
David
On Mon, Dec 7, 2009 at 8:31 PM, Feng wrote:
> Hi,
>
> After git pull on new branch
>
> commit 1da63ad10d2531264e86eb705a10b3cebc9b1067
> Author: Rich Hic
On Dec 7, 8:57 pm, David Nolen wrote:
> I was getting this as well, but this was before the last 3 commits to new.
> Did you wipe your old jars and class files and start afresh?
>
Yes, just to make sure not waste Rich's time. I did doubt and triple
checks, ant clean, find $HOME -name clojure\*.
Looking at the stacktrace it looks like this is because of swank_fuzzy.clj.
I can start up the SLIME Repl no problem, I see your exact same stack trace
only if I try to trigger fuzzy completion via C-c TAB.
David
On Mon, Dec 7, 2009 at 9:24 PM, Feng wrote:
>
>
> On Dec 7, 8:57 pm, David Nolen
http://github.com/jochu/swank-clojure/blob/master/src/main/clojure/swank/commands/contrib/swank_fuzzy.clj#L256
Is the offending line.
On Mon, Dec 7, 2009 at 9:34 PM, David Nolen wrote:
> Looking at the stacktrace it looks like this is because of swank_fuzzy.clj.
> I can start up the SLIME Repl
While we're throwing requests at Tom, it'd be nice if the special
forms were included in the api.
On Dec 7, 5:21 pm, Tom Faulhaber wrote:
> Yup, I heard that the first time :-)
>
> It's coming, but not right this sec.
>
> Tom
>
> On Dec 7, 4:57 pm, Howard Lewis Ship wrote:
>
>
>
> > I still thin
On Dec 7, 4:19 pm, ajay wrote:
> Hi all,
>
> I am new to FP in general and I am trying to pick up Clojure. I am
> having trouble thinking in FP terms.
>
> I am trying to implement the Dijkstra algorithm for shortest paths in
> Graph in Clojure. If this succeeds, I will implement all the advanced
Yes, fuzzy-completion seems the only way to trigger it. For what it's
worth, it did not happen if reset to
commit a3e95cf5a72b22cd0728aba152d5f77603b722fc
Author: Rich Hickey
Date: Fri Dec 4 11:22:04 2009 -0500
update example in reify doc
- Feng
On Dec 7, 9:34 pm, David Nolen wrote:
>
you can use recur. it calls the fn/loop it's contained in with new
args. (so, with the updated array and queue)
On Dec 7, 8:19 pm, ajay wrote:
> Hi all,
>
> I am new to FP in general and I am trying to pick up Clojure. I am
> having trouble thinking in FP terms.
>
> I am trying to implement the D
inc
Thanks for the hard work.
On 12/7/09, ataggart wrote:
> While we're throwing requests at Tom, it'd be nice if the special
> forms were included in the api.
>
> On Dec 7, 5:21 pm, Tom Faulhaber wrote:
>> Yup, I heard that the first time :-)
>>
>> It's coming, but not right this sec.
>>
>> To
It turns out the doc string for filter was dropped during a checkin
earlier this year. I surprised no one noticed sooner (I guess everyone
just knows how filter works).
I have filed ticket 219 with a patch and hopefully we'll get it into
1.1.
I didn't see any others missing, have you seen others?
I like that too. I'll have to think about how we'd do that.
On Dec 7, 8:11 pm, ataggart wrote:
> While we're throwing requests at Tom, it'd be nice if the special
> forms were included in the api.
>
> On Dec 7, 5:21 pm, Tom Faulhaber wrote:
>
> > Yup, I heard that the first time :-)
>
> > It's c
Thanks
I didn't know the costume hierarchy at all, it seems to be very
useful.
I understand it is coupled to the Java object hierarchy.
Is there a way to create similar util for strings, as I did on my
first example?
On Dec 7, 12:10 pm, Meikel Brandmeyer wrote:
> Hi,
>
> On Dec 7, 10:21 am, Tzach
55 matches
Mail list logo