Default values for fields of a defrecord?

2010-08-27 Thread Darren Austin
Hi folks, Is there a way to specify default values for the fields of a defrecord? Or barring that, is there a way to override or augment the constructor for the record? That is, if I have: (defrecord Foo [a b c d e f g]) I want to be able to create a new Foo with: (Foo.) and have default val

Re: making code readable

2008-12-29 Thread Darren Austin
I don't know CL that well myself, but I think the convention is to use + for constants (i.e. defconst) where * is used for global variables (i.e. defparameter). In that case the + convention doesn't really make sense in clojure as it doesn't have any notion of a constant reference type. --Darren

Loading a resource file from the class path?

2008-12-20 Thread Darren Austin
Hey folks, I am probably missing something obvious here, but is there an good way to open a resource file that is relative to the current class path? I want to bundle up some data files with my .clj source in a .jar file. >From the clojure code, I need to open these data files. I looked at Class

Re: slime fu

2008-11-17 Thread darren . austin
Maybe it was just my setup, but that didn't work for me. What did work was: (add-hook 'slime-connected-hook 'slime-redirect-inferior-output) --Darren On Nov 17, 11:42 am, "Bill Clementson" <[EMAIL PROTECTED]> wrote: > You could add the following to your .emacs file: > > (add-hook 'slime-mode-

Re: Standard Error to the REPL under Slime?

2008-11-13 Thread darren . austin
Awesome. Not sure how I missed that. Thanks. --Darren On Nov 13, 5:37 pm, Brian Carper <[EMAIL PROTECTED]> wrote: > On Nov 13, 5:07 pm, Allen Rohner <[EMAIL PROTECTED]> wrote: > > > On Nov 7, 3:00 am, [EMAIL PROTECTED] wrote: > > > > Hey folks, > > > > Is there a way to get the System.err dir

Standard Error to the REPL under Slime?

2008-11-07 Thread darren . austin
Hey folks, Is there a way to get the System.err directed to the slime-repl clojure buffer instead of (or in addition to) inferior-lisp buffer? I looked through the docs, but I didn't see anything obvious. Thanks! --Darren --~--~-~--~~~---~--~~ You received this

Re: avoiding duplication using multi-methods

2008-09-01 Thread darren . austin
On Aug 31, 8:48 pm, Parth Malwankar <[EMAIL PROTECTED]> wrote: > Hello, > > I have a situation in which different multi-methods > need similar behavior with different arguments. > > So they call the same function (one-or-two below) > with the arguments. E.g. > >     (defmulti what-num (fn [x] x))