Suppose I already have a function f that accepts 0 and 1 param:
(defn f
([] 0)
([ _ ] 1))
How do I extend it with additional version that takes 2 params?
Something like the following that does not override the original:
(defn f [ _ _ ] 2)
and makes all 3 work:
(f)
(f 1)
(f 1 2)
- Dmitry
--
On Fri, Jan 8, 2010 at 2:57 PM, Konrad Hinsen
konrad.hin...@fastmail.net wrote:
It's a bug. More specifically, a typo in a recent improvement. It is fixed
now, so please try again with the current version - or in fact go back to an
older version before December 28.
Thanks! I pulled the latest
Hi Nicolas,
The macro works fine. The problem is that the REPL tries to print the
result (which is the var you created) and the print multimethod does
not know what to do with your custom type, and the default method
throws an exception.
user= (defbar fuz (+ 1 1))
java.lang.ClassCastException:
I've gotten rid of the automatic loading of the library and
replacement of stub functions upon their first call.
While this seemed convenient I didn't like that the stub versions of
the functions could be passed around as objects without the user
knowing that it was not the real version being
I really hate emacs. And the solution in
http://www.google.com/url?sa=Dq=http://groups.google.com/group/clojure/browse_thread/thread/6a16bb89340f46d8/fb03dffa410e919a%3Flnk%3Dgst%26q%3Dharrop%2Bindent%23fb03dffa410e919ausg=AFQjCNFAyiZOBGMdhoXnFe1UaFrJQTgGUg
doesn't work
Any other way to format
Have you tried what I wrote in my above post ?
2010/1/9 Gabi bugspy...@gmail.com:
I really hate emacs. And the solution in
On Tue, Dec 22, 2009 at 4:18 PM, Gabi bugspy...@gmail.com wrote:
I need a simple command-line tool to indent Clojure source files.
Any recommendation ?
If all else fails, vim has a batch mode.
$ echo =G:wq indent-script
$ vim -s indent-script file-to-indent
right now it asks me to hit enter
On Fri, Jan 8, 2010 at 12:57 PM, Richard Newman holyg...@gmail.com wrote:
I don't want to have to use ELPA, or maven, or some other configuration
management thing to get basic tools like an editing environment for the
language up and running. Perhaps I should just bite the bullet and use the
Hi,
On Jan 8, 3:10 pm, tristan tristan.k...@gmail.com wrote:
I've been working on a problem where I want the user to be able to
input an equation in infix notation which includes variables and
convert that to a clojure fn that my program can call later.
You need to construct the form of the
Name: clarsec
Url: http://github.com/mmikulicic/clarsec
Author: Marko Mikulicic
Category: parsing
License: Apache License 2.0
Simple monadic parser trying to mimic Parsec and be usable. Not really
complete. Uses
Meikel Brandmeyer monad library.
--
You received this message because you are
Zef,
Can you compile files? My environment works fine by setting all
necessary clojure.jar, clojure-contrib.jar, swank-clojure.jar, ~/clj
(my own project directory) in swank-clojure-classpath. However, I have
difficulty to generate classes from the *.clj. E.g. I have a find.clj
in
Hi,
Am 09.01.2010 um 09:59 schrieb Dmitry Kakurin:
Suppose I already have a function f that accepts 0 and 1 param:
(defn f
([] 0)
([ _ ] 1))
How do I extend it with additional version that takes 2 params?
Something like the following that does not override the original:
(defn f [ _
Hello all,
I want to use the c.c.logging for all my logging purposes but I have a
few queries about `configuring' the logging system.
Ideally I would like to log to a file which is rotated regularly. It'd
be best if I can put this configuration in one place and change the
output to stdout
The macro works fine. The problem is that the REPL tries to print the
result (which is the var you created) and the print multimethod does
not know what to do with your custom type, and the default method
throws an exception.
That was it, thanks a lot.
- budu
--
You received this message
On Jan 3, 9:22 pm, Timothy Pratley timothyprat...@gmail.com wrote:
2010/1/4 Tom Hicks hickstoh...@gmail.com:
All the other code is there to parallel the functionality in 'subvec'.
Ah right, I see what you mean.
Calling count in the two argument form will realize the entire
sequence
Weird, it used to work for me when I tested it. And it appears it also
worked for some people on the thread ...
2010/1/9 Gabi bugspy...@gmail.com:
Yes. Didn't work. Even after fixing a bug in it (complained about
Character/isWhitespace ) it produced garbage
On Jan 9, 3:00 pm, Laurent PETIT
Hi all.
I'm working on implementing a solution for extracting slices of
multidimensional vectors, in the sense of vectors of vectors. I'm
taking the recursive route. I'm almost there, just have to work out a
few things. But I was wondering, this being a rather straightforward
need, perhaps it's
Yes. Didn't work. Even after fixing a bug in it (complained about
Character/isWhitespace ) it produced garbage
On Jan 9, 3:00 pm, Laurent PETIT laurent.pe...@gmail.com wrote:
Have you tried what I wrote in my above post ?
2010/1/9 Gabi bugspy...@gmail.com:
I really hate emacs. And the
Just found an easy and stupid way. Using Kate editor:
1, Tools-indentation-Lisp
2. Select the whole text and do Tools -Align
On Jan 9, 10:17 pm, Gabi bugspy...@gmail.com wrote:
Yes. Didn't work. Even after fixing a bug in it (complained about
Character/isWhitespace ) it produced garbage
On
I've reverted to the setup that you listed, Ramakrishnan. I spent
quite a few hours trying to figure out how to use ELPA + the forked
slime + the new swank clojure, but failed miserably (despite the kind
assistance of Phil and others on another thread).
I would agree that it would be nice to
Maybe you can post here an example code of how you used it ? Maybe I
missed something?
On Jan 9, 10:38 pm, Laurent PETIT laurent.pe...@gmail.com wrote:
Weird, it used to work for me when I tested it. And it appears it also
worked for some people on the thread ...
2010/1/9 Gabi
Shawn Hoover shawn.hoo...@gmail.com writes:
In updating Clojure Box to the latest I found that the defadvice form
has to be loaded before slime is loaded. (I didn't know about
ad-activate.) This would be a problem if you somehow require slime
before the ELPA's package-initialize is called,
Steven E. Harris s...@panix.com writes:
Phil Hagelberg p...@hagelb.org writes:
If someone would volunteer to fix it, I'd be thrilled. Nobody who is
interested in using CL and Clojure at the same time has stepped
forward so far, which is why it's currently broken.
Can you characterize what
Gabi wrote:
I really hate emacs.
...
Any other way to format lisp/clojure ?
http://www.vim.org/scripts/script.php?script_id=2501
--
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
Phil Hagelberg p...@hagelb.org writes:
There was some discussion about it a couple months ago:
I picked up the torch today, in hope that others will try again for a
better resolution:
http://thread.gmane.org/gmane.lisp.slime.devel/9178/focus=9383
--
Steven E. Harris
--
You received this
2010/1/10 Nicolas Buduroi nbudu...@gmail.com:
That was it, thanks a lot.
Ah great. My understanding is that type meta data should go on the
object not the var, but that integers for example do not support meta
data as they are java objects. Only things like vectors and hash maps
do. So you can
I've tried to add a new platform, but the repl fails to start. Then I
tried to build the latest version of Enclojure using clojure 1.1, but
couldn't get that working either. Has anyone else been able to get it
working with clojure 1.1?
--
You received this message because you are subscribed to
Try escaping it:
(println \foo\)
On Jan 8, 4:34 pm, Raoul Duke rao...@gmail.com wrote:
hi,
i'm using (read) and it seems to get rid of double quotes e.g.
(println foo)
is read as
(println foo)
as far as i can tell so far. how do i get the quotes to come through?
or don't i
Steven E. Harris s...@panix.com writes:
There was some discussion about it a couple months ago:
I picked up the torch today, in hope that others will try again for a
better resolution:
http://thread.gmane.org/gmane.lisp.slime.devel/9178/focus=9383
Thanks for digging. I'll keep this
Actually this is possible. (see http://xkcd.com/386/)
See the macro add-arity which I've put up here: http://gist.github.com/273349
This allows you to do things like:
user (add-arity keyword [ns name suffix] (keyword ns (str name -
suffix)))
#user$eval__6304$fn__6309
30 matches
Mail list logo