Re: Clojure Blogs | Yahoo Pipes | Clojure Pipe

2008-12-08 Thread Phil Hagelberg
Dan Larkin <[EMAIL PROTECTED]> writes: > It's been mentioned before but I'd like to see a planet.clojure.org à > la the planet planet powered sites (http://www.planetplanet.org/). I do a lot of work with feeds; I've been toying with the idea of porting Planet to Clojure. We use the Rome feed par

CLI launcher (was: Superficial barriers to entry)

2008-12-18 Thread Phil Hagelberg
Jan Rychter writes: > Let people use whatever they want, try their stuff from the command-line > and REPL, and once they get used to it, move up to Emacs and SLIME. Agreed. > I agree there are superficial barriers, though. I believe it is very > important for Clojure to: > > a) have an build

Re: Blogging About Clojure?

2008-12-19 Thread Phil Hagelberg
Jason writes: > I'm in the same boat: I just set up my first blog yesterday so I could > post some gotchas i've found and experiments i've done with clojure. > I went the route David suggests: dreamhost.com has a special now, $10 > for a domain and 6 months free hosting, and they have a one-clic

Re: CLI launcher

2008-12-19 Thread Phil Hagelberg
"Tom Emerson" writes: > On Thu, Dec 18, 2008 at 12:56 PM, Phil Hagelberg > wrote: >> This was one of the most disorienting things I encountered when starting >> with clojure. I'm used to codebases providing a bin/ directory or at >> least a shell script

Re: swank-clojure license

2008-12-30 Thread Phil Hagelberg
lpetit writes: > So I guess that if for clojure-dev (eclipse plugin for clojure) we > want to use it for interactivity with an external clojure environment, > and we want to start the environment from the plugin, we have a > problem : stop me if I'm wrong, but if any file of swank-clojure is > e

Re: swank-clojure license

2008-12-30 Thread Phil Hagelberg
lpetit writes: > I'm not sure. From what I remember, what you describe is more related > to LGPL ? No, the LGPL allows using the code in another program that is Free but not GPL-licensed. If you're just distributing some code from swank-clojure, licensing conflicts will never come into play. It

Re: swank-clojure license

2008-12-30 Thread Phil Hagelberg
lpetit writes: > So swank-clojure will not be hard-linked (at compilation time) to any > of clojure-dev code. Nor will it be dynamically linked to any clojure- > dev code at runtime : it will be dynamically linked to the clojure > environment launched by clojure-dev on behalf of the user. > > Bu

Re: shelling out, convenience function for Runtime.exec()

2009-01-02 Thread Phil Hagelberg
Chouser writes: > I've added shell-out to clojure-contrib, with an 'sh' function that > allows usage like: This is great; I was wondering where such a function was a couple weeks ago. Thanks! -Phil --~--~-~--~~~---~--~~ You received this message because you ar

Re: semi-structured program editing

2009-01-03 Thread Phil Hagelberg
Scott Bell writes: > http://mumble.net/~campbell/emacs/paredit.el > http://mumble.net/~campbell/emacs/paredit.html > > Should work out of the box with Clojure and Emacs. Out of the box is not so great, but clojure-mode.el comes with modifications to paredit for clojure. It's great, but it's a

Re: File organization & bootstrapping

2009-01-07 Thread Phil Hagelberg
> I think you may be working at too low a level with "load". You should > be able to accomplish the same thing with: > > (ns my-app > (:require package1 package2)) > > (package2/start-app) > > my_app, package1, and package2 all need to be immediately under a > directory (or JAR file

Re: File organization & bootstrapping

2009-01-07 Thread Phil Hagelberg
Craig McDaniel writes: > Connect to your running app from emacs by using "M-x slime-connect" > rather than "M-x slime". When you're done, use "M-x slime- > disconnect" (or from the REPL, "," then "disconnect") to leave your > process running. In addtion, including swank in your running > product

Re: clj-backtrace uses: screenshots and example code

2009-01-08 Thread Phil Hagelberg
Mark McGranaghan writes: > I'd also be happy to answer any questions you have about using the > library and to hear any general comments. This looks great! I love the way they're aligned. Have you looked at the way Rubinius (a smalltalk-style Ruby VM) prints backtraces? It's pretty similar, al

Re: configurable bash script to launch Clojure available

2009-01-15 Thread Phil Hagelberg
"Mark Volkmann" writes: > I think a script like this should be included with the Clojure > download. It's seems to me that everyone needs one and currently has > to write their own by copying example script code from the Getting > Started page. Strongly agree. If 1.0 is released without this it

Re: Another socket repl

2009-01-19 Thread Phil Hagelberg
"Stephen C. Gilardi" writes: > That looks really nice, Craig. I see you're a registered > contributor. Would you be up for including this in clojure-contrib? I noticed that very little of this code is specific to the REPL; the bulk of it is just dealing with creating and doing things with serve

Re: Another socket repl

2009-01-20 Thread Phil Hagelberg
Craig McDaniel writes: > On Jan 19, 11:45 am, Phil Hagelberg wrote: >> I noticed that very little of this code is specific to the REPL; the >> bulk of it is just dealing with creating and doing things with server >> sockets. Perhaps it could be included in clojure-contri

Installing SLIME and friends

2009-01-23 Thread Phil Hagelberg
So I've noticed one of the most common questions in #clojure from beginners is how to install SLIME. Working with SLIME can be messy work[1], so I've written some functionality to help out with that. If you check out my "installer" branch of clojure-mode[2] you can see the clojure-install comman

Re: Any way we can get this in clojure-contrib?

2009-01-23 Thread Phil Hagelberg
Chouser writes: > ...except of course that every external dependency is an increased > burden on the users of any code I write. It seems likely that a > pretty substantial percentage of use cases could be handled in a way > that would allow either Java lib to be used underneath. That way I > w

Re: Another socket repl

2009-01-23 Thread Phil Hagelberg
Craig McDaniel writes: >> I wonder if it wouldn't be a good idea to move the call to binding >> fromsocket-replinto accept-fn. It seems like a reasonable default to >> rebind *in* and *out* for the duration of the accepting function; the >> example uses this as does my application. > > I'm not s

Re: More SLIME woes

2009-01-23 Thread Phil Hagelberg
Tom Emerson writes: > I updated my entire Clojure environment today to the latest in source > control: slime, swank-clojure, clojure, clojure-contrib, clojure-mode. > Now SLIME is unhappy. It appears that the swank-clojure code has been > patched appropriately. I think the best way to banish th

Re: Simple Examples of Concurrency?

2009-01-27 Thread Phil Hagelberg
Keith Bennett writes: > I'm trying to wrap my head around Clojure's concurrency. I'm new to > Lisp-like languages, and the examples that I've found are a bit > complex. > > Can anyone point me to simple examples of how concurrency works in > Clojure? (Not just one-liners, but examples that act

Re: Simple Examples of Concurrency?

2009-01-28 Thread Phil Hagelberg
wubbie writes: > @mire.rooms/*rooms* is new to me. > could anybody explain to me? Sure thing. *rooms* is a ref in the mire.rooms namespace. So since we haven't used "refer" or "use" to draw all everything from mire.rooms into the current namespace, we prefix the var with its namespace to refer

Re: My SLIME installation diary

2009-02-04 Thread Phil Hagelberg
Seeing all these complicated steps that need to be reproduced made me wonder if it couldn't be automated. I've added an M-x clojure-install command to my fork of clojure-mode, so if you are wanting to get started with SLIME and Clojure, please give it a look. Installation and configuration shoul

Re: My SLIME installation diary

2009-02-04 Thread Phil Hagelberg
chris writes: > (defun get-classpath-list () > (if > (or >(eq 'windows-nt system-type) >(eq 'ms-dos system-type)) > (split-string (getenv "CLASSPATH") ";") > (split-string (getenv "CLASSPATH") ":"))) > > (setq swank-clojure-jar-path > (dev-dir "clojure/clo

Seattle Clojurians

2009-02-05 Thread Phil Hagelberg
I realize this comes a day late since the meeting just happened, but after seeing all these local group threads, I thought I'd mention that the Seattle Functional Group meets every month or so at various locations around Seattle: SeaFunc is Seattle. SeaFunc is functional. Functional language.

Re: My SLIME installation diary

2009-02-09 Thread Phil Hagelberg
bOR_ writes: > Had to use a different .emacs. Just autoload and add-to-list didn't > seem to load clojure-mode.el. That's correct; this will not load the code. It just sets it up so that the file gets loaded on-demand when you open a clojure file. I will add a note mentioning that the first tim

Re: Random elements

2009-02-11 Thread Phil Hagelberg
Jason Wolfe writes: >> Would you consider changing the names of these 2 functions ? >> >> random-permutation -> shuffle >> random-element -> one-of >> >> Shorter names are a trademark of clojure. >> "one-of" was taken straight from paip =) > > I'd be OK with shuffle, I guess, but I don't know if

Re: Random elements

2009-02-11 Thread Phil Hagelberg
Jason Wolfe writes: > OK, fine. Any objections to "shuffle" and "rand-elt", to parallel "rand-int"? I think that the bike shed should definitely be red. =) -Phil (http://en.wikipedia.org/wiki/Color_of_the_bikeshed) --~--~-~--~~~---~--~~ You received this mes

Re: My SLIME installation diary

2009-02-12 Thread Phil Hagelberg
bOR_ writes: >>> (push "/home/boris/.emacs.d" load-path) >>This is actually already on the load-path by default; no need to add it. > > Standard load-path on ubuntu didn't include ~/.emacs.d for me. Not > sure why not. You're right; my bad. > 1. Creating a .emacs with the load-path .emacs.d >

Reading... from a reader

2009-02-12 Thread Phil Hagelberg
I've got a problem where I have a reader (it's a java.io.BufferedReader that came from duck-streams, if that matters at all) and I want to call "read" on it. I'd expect to be able to do (read (reader my-file)), but this isn't OK because read needs a java.io.PushbackReader. It seems vaguely wrong

Re: Reading... from a reader

2009-02-12 Thread Phil Hagelberg
Phil Hagelberg writes: > I've got a problem where I have a reader (it's a java.io.BufferedReader > that came from duck-streams, if that matters at all) and I want to call > "read" on it. I should mention that I know *how* to do this: (read (java.io.PushbackRe

Re: Reading... from a reader

2009-02-12 Thread Phil Hagelberg
Rich Hickey writes: > Yes. Issue/patch welcome. Great; issue and patch attachment are here: http://code.google.com/p/clojure/issues/detail?id=79&colspec=ID%20Type%20Status%20Priority%20Reporter%20Owner%20Summary I haven't written much Java, but the implementation seems pretty straightforward.

Re: Reading... from a reader

2009-02-12 Thread Phil Hagelberg
Stuart Sierra writes: > I could change "duck-streams/reader" to return a PushbackReader > instead of a BufferedReader. Unfortunately, "readLine" is defined in > BufferedReader but NOT in PushbackReader. We need "readLine" for > "clojure.core/line-seq". So we can't have it both ways. Blame Ja

Re: Reading... from a reader

2009-02-12 Thread Phil Hagelberg
Mark Fredrickson writes: > While (read) taking an argument seems valid, I think you can do what > you want in the short term using binding: read actually already takes an argument, it just (without my patch) requires it to be a PushbackReader. > IIRC, duck-streams has a (with-reader ...) form

Re: let and binding have different ordering behavior

2009-02-12 Thread Phil Hagelberg
Mark Volkmann writes: >> Whoops, this caught me today. Whereas "let" evaluates its bindings >> sequentially, "binding" does not! Observe: >> >> (def a "a1") >> (def b "b1") >> >> (let [a "a2", b a] b) >> ;;=> "a2" >> >> (binding [a "a2", b a] b) >> ;;=> "a1" >> >> I wouldn't call this a bug, b

Re: Reading... from a reader

2009-02-12 Thread Phil Hagelberg
"Stephen C. Gilardi" writes: > Now I apply the patch and use the convenience it offers: > > user=> (def a (java.io.StringReader. "123[145]")) > #'user/a > user=> (read a) > 123 > user=> (read a) > 145 > > The "[" on the input stream was lost so the second obje

Re: My SLIME installation diary

2009-02-13 Thread Phil Hagelberg
David writes: > I have a small problem with clojure-mode in your setup. > > Since clojure-mode is autoloaded, it, and SLIME, aren't available > until I load a '.clj' file. > Starting SLIME, though, doesn't add the SLIME menu to the previously > loaded '.clj' buffer > (Newly loaded files get the

Re: how to emulate lisp's labels functionality?

2009-02-13 Thread Phil Hagelberg
wubbie writes: > Hi, do we have labels equiv. in clojure? > The code below is from OnLisp. Trying to convert to clj file, > but have minor difficulties. You can use "let" since variables and functions are kept in the same namespace. > (defun count-instances (obj lsts) > (labels ((instances-i

Re: how to learn clojure ?

2009-02-18 Thread Phil Hagelberg
MarisO writes: > All documentation I've seen about clojure assumes knowledge of lisp > which I dont have. I'm working on a screencast for PeepCode (http://peepcode.com) that is aimed at teaching Clojure to users of other dynamic languages. It's not ready yet, but it should be on sale in a week

Re: My SLIME installation diary

2009-02-18 Thread Phil Hagelberg
David writes: > I can't really claim to be handy with elisp, but I got by. > (Is there a guide to elisp functions anywhere? The Lisp > reference didn't include the Common Lisp emulation library, > and I never did find an equivalent to the clojure filter()). The Elisp CL emulation package is doc

Re: how can i do this in clojure

2009-02-19 Thread Phil Hagelberg
linh writes: > # ruby code > def foo(x, y) > x + y > end > > def bar > [1, 2] > end > > foo(*bar) # this is fine, the result will be 3 > foo(bar) # this is not ok, will raise exception > > bar returns an array of size 2, but foo expects 2 parameters not an > array. In Clojure, this would lo

Re: Reading... from a reader

2009-02-20 Thread Phil Hagelberg
"Stephen C. Gilardi" writes: > I see that issue 79 against Clojure requesting this change is still > open. If auto-wrapping of readers is no longer a change you'd like to > see, would you please either withdraw it (if you as the originator > have that capability) or add a comment to it requestin

Re: Clojure Naming Conventions

2009-02-21 Thread Phil Hagelberg
Mark Volkmann writes: > As best I can tell Clojure doesn't have a convention for constant names. Everything that's not expected to be rebound at runtime (*special-variables*) is by definition a constant (with the exception of refs, agents, and atoms). You don't need a special "constant naming c

Re: Clojure Naming Conventions

2009-02-21 Thread Phil Hagelberg
David Nolen writes: > The fact that the Clojure data structures are immutable and that some > of those data structures might be used logically constants are two > separate concerns. I don't understand what this means. What's the difference between using a value that doesn't change and using a v

Re: alternate syntax

2009-02-23 Thread Phil Hagelberg
Mark Volkmann writes: > The parens don't bother me. My concern though is that many people > won't take the time to learn Clojure primarily because of the parens. Rule one of programming: never code anything you're not going to use yourself. Unless you're getting paid to do it. Or something. >

Re: test-is integration via SLIME

2009-02-24 Thread Phil Hagelberg
Michel Salim writes: > That would be really neat! I'm having a bit of trouble setting it up, > though: > - When loading a .clj file in Emacs, it automatically triggers Slime This should happen only on test files, not every clojure file. > - However, the file is not actually loaded; I had to C

Re: Waterfront - The Clojure-based editor for Clojure

2009-02-25 Thread Phil Hagelberg
"Stephen C. Gilardi" writes: > I propose that we Clojure-using folks adopt CLOJURE_HOME as our > "standard" environment variable that can be used to find clojure.jar > and other interesting bits of Clojure. The proposed value of > CLOJURE_HOME is an absolute path to the top level of an svn check

Mathy operations on non-numerics (was "Adding" strings)

2009-02-26 Thread Phil Hagelberg
Peter Wolf writes: > Is there a good reason that + can't do the right thing as with other > Java and scripting languages? I think this would be popular with > non-LISPers. Putting a type check in + would slow down basic math, and there is a class of user who will complain loudly if basic mat

Re: Mathy operations on non-numerics (was "Adding" strings)

2009-02-26 Thread Phil Hagelberg
Laurent PETIT writes: > > Concatenation is not addition. I'm almost opposed to numeric operators > > all together. If we wrote (add 2 3), there would be no confusion at > > all about what (add "foo" 2) should do, because you'd be writing (conj > > "foo" (str 2)) > > Agree I agre

Re: Mathy operations on non-numerics (was "Adding" strings)

2009-02-26 Thread Phil Hagelberg
Allen Rohner writes: >> I agree regarding concatenation as well, but I think the case for >> comparison of non-numerics is still pretty strong. > > Are you referring to using <, >, =, with objects that implement > java.lang.Comparable? > > i.e. given x.compareTo(y) == -1 > (< x y) > => true > >

Re: Mathy operations on non-numerics

2009-02-27 Thread Phil Hagelberg
Christian Vest Hansen writes: >> Are you referring to using <, >, =, with objects that implement >> java.lang.Comparable? >> >> i.e. given x.compareTo(y) == -1 >> (< x y) >> => true >> >> I would find that useful. > > I think having <, >, <=, >= be based on Comparable has been discussed before.

Re: Mathy operations on non-numerics

2009-02-27 Thread Phil Hagelberg
David Nolen writes: > What about something like: > > (defn gt [str1 str2] >   (first (sort [str1 str2]))) > > (gt "Zoe" "Bob") ; -> "Bob" If nothing exists yet, defining <, >, <=, and >= in str-utils might work. -Phil --~--~-~--~~~---~--~~ You received this mes

Getting substrings with negative indices

2009-02-27 Thread Phil Hagelberg
It's a pretty common idiom in other languages for substring functions to count from the end if given a negative index. (substring "hello world!" 6 -1) ;; => "world" I'd be glad if Clojure's "subs" function could work like this. Should I create an issue and patch to implement it? -Phil --~--

Re: Clojure + Terracotta = Yeah, Baby!

2009-02-27 Thread Phil Hagelberg
Paul Stadig writes: > I've recently done some experimentation with Clojure and Terracotta. > I've detailed my experience at: > > http://paul.stadig.name/2009/02/clojure-terracotta-yeah-baby.html Very exciting; I'm looking forward to trying this out! Thanks for posting. -Phil --~--~-~-

[PATCH] Getting substrings counting from the end

2009-03-01 Thread Phil Hagelberg
Phil Hagelberg writes: > It's a pretty common idiom in other languages for substring functions > to count from the end if given a negative index. > > (substring "hello world!" 6 -1) ;; => "world" > > I'd be glad if Clojure's "subs&q

Re: [PATCH] Getting substrings counting from the end

2009-03-01 Thread Phil Hagelberg
Michael Wood writes: > Makes sense to me, but there's a bug in your function. You want (< % > 0) instead of (< 0 %). Quite right; good catch. thanks, Phil --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure

Re: Game of Life

2009-03-03 Thread Phil Hagelberg
lps540 writes: > I've written a small example of Conway's Game of Life using Clojure > and Swing. Comments/critiques are welcome. Interesting program! (for [x (range 32) y (range 48)] (ref-set cells (assoc (deref cells) [x y] (= 0 (rand-int 5) While

Re: Chrono date library

2009-03-05 Thread Phil Hagelberg
e library is meant to be used. Date processing is a common enough task that I think support for it should be included in contrib, especially considering how awkward the java.util.Date API is to use directly. If it's agreed that this is a good fit for contrib, we can create a Google Code

Re: Chrono date library

2009-03-05 Thread Phil Hagelberg
Cosmin Stejerean writes: > I like the API so far, although I'll probably have to wait for > timezone support before I can start using this. Would love some suggestions on what you'd expect the API to look like for this. Failing test cases would be even better. I haven't given it much thought ye

Re: Chrono date library

2009-03-05 Thread Phil Hagelberg
Allen Rohner writes: > I strongly recommend that you make sure you understand where and why > Joda differs from the Java standard lib. If you don't handle the cases > that Joda already does, you *will* have bugs. Interesting. So far everyone I've talked to who recommended Joda did so because th

Re: Chrono date library

2009-03-05 Thread Phil Hagelberg
Allen Rohner writes: > http://www.ociweb.com/jnb/jnbJul2008.html "As mentioned, one of the > problems with the JDK API is difficulty in calculating the number of > days between two different dates. To learn a bit about how to use Joda > Time, let's see how one can solve that problem a few diff

Re: What is Clojure NOT good for?

2009-03-06 Thread Phil Hagelberg
Konrad Hinsen writes: > As for what JVM languages are not good for in general, there is the > obvious domain of systems-level programming, and there are other > domains such as number crunching, where there is a severe lack of > good libraries in the Java world. The only other thing I can

Re: Workflow poll?

2009-03-06 Thread Phil Hagelberg
levand writes: > I use Emacs+Slime in windows (I'd prefer a Mac if I could afford one) > as my primary development environment. I start Emacs with a project- > specific batch file that adds all the libraries I use to the CLASSPATH > environment variable and then invokes Emacs, so all I have to d

Re: Chrono date library

2009-03-06 Thread Phil Hagelberg
Allen Rohner writes: > As far as I can tell, the JSR was approved to go into Java 7, but > there is some risk of them not being done by the deadline. JSR-310 is > a complete re-write, I assume for licensing reasons. Interesting. > One of the large advantages of Joda is that the API is construc

Re: What is Clojure NOT good for?

2009-03-06 Thread Phil Hagelberg
Luc Prefontaine writes: > I work with Ubuntu and all my frequently used tools are copied to RAM > (/tmpfs) at > boot time. My Java environment is there, Clojure, Eclipse, frequently used > librairies... > On top of that there's a daemon running to spot my frequently accessed files > and serve

Re: swank-clojure + slime

2009-03-08 Thread Phil Hagelberg
"youngblood.carl" writes: > Thanks Lucio, but you can see on git-hub that the head version of > core.clj uses lazy-seq: > > http://github.com/jochu/swank-clojure/blob/349cb3b93a7bd8bcc86ffd0fd5415d84ed5f4028/swank/core.clj The lazy-seq macro is what replaced lazy-cons. Swank-clojure *has* been

Re: On the importance of recognizing and using maps

2009-03-08 Thread Phil Hagelberg
Dan writes: >> I guess I want to advocate - don't merely replicate the things with >> which you are familiar. Try to do things in the Clojure way. If your >> logical structure is a mapping of names to values, please use a map. > > I tend to replace every instance of creating classes with creatin

Re: What is Clojure NOT good for?

2009-03-09 Thread Phil Hagelberg
bOR_ writes: > I'm not from the software engineers field, but how difficult is it for > some non-lisp, but java-savvy software writer to pick up a 600-line > clojure program and learn to understand it? I suspect it has more to do with people thinking they can't do it than any actual lack of abi

Re: Debugging support for clojure?

2009-03-10 Thread Phil Hagelberg
Tassilo Horn writes: > If not, is there better way than inserting gazillions of printlns to > check why and where a function doesn't do the right thing? Most definitely! Break your functions up into smaller pieces, then write tests for them using test-is. If your functions are hard to test, it'

Accuracy of *file*

2009-03-11 Thread Phil Hagelberg
I'm interested in getting the location on disk of the current file. It appears *file* provides this, but unfortunately it doesn't provide an absolute path. Inside the file /home/phil/src/mire/src/mire/rooms.clj: mire/rooms.clj I tried using java.io.File so I'd have access to getAbsolutePath,

Re: Accuracy of *file*

2009-03-12 Thread Phil Hagelberg
Paul Stadig writes: > I wrote these a while ago, and I'm not sure if they're still useful or not, > but I'll just send them along without any guarantee. I > have used them like (__FILE__) and (__DIR__) when I wanted to get access to > things relative to the current file. > > (defmacro __FILE__

Re: error messages with clojure-mode.el?

2009-03-15 Thread Phil Hagelberg
Raoul Duke writes: > i just tried using (load-file "foo.clj") to see if that loaded file > line numbers, but the errors still say no source found zero sorry > charlie. :-( I use C-c C-k to compile the current buffer via SLIME. It gives a regular backtrace in the *inferior-lisp* buffer for load-

Re: Symbols evaluated at compile time?

2009-03-16 Thread Phil Hagelberg
André Thieme writes: > But it also protects you from typos. And this can be even more > important. Imagine you have a complex program and accidently > made a typo, and this will go unnoticed for days and days, until > the program actually runs your code... If you go days and days without actual

Re: Symbols evaluated at compile time?

2009-03-16 Thread Phil Hagelberg
Laurent PETIT writes: > OK, so now is time for another ugly english translation of a french > proverb "before saying something, roll your tongue 8 times in your > mouth before speaking". I guess this could also be applied for e-mail Agreed, it could have been worded better. But keep in mind th

Re: Symbols evaluated at compile time?

2009-03-16 Thread Phil Hagelberg
Laurent PETIT writes: > 2009/3/16 Phil Hagelberg > > Laurent PETIT writes: > > > But please, think about it twice before saying people are > > irresponsible. Unit tests are not the only answer to bug-free and > > quality programs. > &

Improving the test suite

2009-03-16 Thread Phil Hagelberg
OK, so I've posted a fair amount of "smack talk" about test suites and how important they are--I figure it's time to help out. What are some ways in which test-clojure is lacking? How can I help improve the coverage? -Phil --~--~-~--~~~---~--~~ You received this

Re: Printing, Reading, and Serializing (+ bug?)

2009-03-17 Thread Phil Hagelberg
Jason Wolfe writes: > Finally, has anyone tried printing something with closures in it, and > then reading it back in another JVM instance? Closures are dependent upon their lexical environment. While you can serialize the code they contain, you can't serialize their whole lexical environment,

Enlive questions

2009-03-18 Thread Phil Hagelberg
I'm using the Enlive library, and so far I've been pretty impressed. The way it separates templates out into their own files and doesn't allow any logic to get mixed up with them is great. One thing I noticed is that its templates escape all strings passed to them. In my case I have some strings

Re: Going to ILC 2009?

2009-03-18 Thread Phil Hagelberg
Chas Emerick writes: > I am (from Sunday - Tuesday, anyway), along with another fellow from > Snowtide, and I think it'd be great to meet up with some other Clojure > programmers who might be there, too. I'm sure such things will happen > naturally, but I thought I'd start a thread here s

Re: Enlive questions

2009-03-18 Thread Phil Hagelberg
Tom Hickey writes: > Regarding your first question, you can use (net.cgrand.enlive-html/ > escaped your-string) to skip the escaping of your strings. Thanks, that's helpful. I've also noticed one more oddity. Consider this snippet: (deftemplate index "foo/bar/template.html" [articles] [:div

Re: Enlive questions

2009-03-19 Thread Phil Hagelberg
Christophe Grand writes: > I'm not quite happy with this behavior: I wanted to preserve the > brevity of setting content from a parameter without resorting to (text > my-parameter) but it makes things too irregular. This "feature" will > certainly go away as I'm planning a redesign. Yeah, I'm

Re: Enlive questions

2009-03-19 Thread Phil Hagelberg
Christophe Grand writes: > I see two advantages to using with-test: > * documentation/usage examples as you pointed out, Actually I meant that it's nicer for documentation to have the tests in a separate file since when you're trying to learn how to use the library initially, you don't care abo

Re: User contributed packages (Cabel, CPAN, etc)

2009-03-22 Thread Phil Hagelberg
Bradbev writes: > I feel that the next big growth phase for Clojure will be in the user > community and the code that we can generate. A good package manager > will help fuel that growth. I agree. The more I work with packages that have dependencies the more I realize that manually managing th

Re: Slime integration

2009-03-23 Thread Phil Hagelberg
Vagif Verdi writes: > When i use slime with lisp, it shows me function parameters, when > cursor is on a function name. But with clojure it only shows me > Evaluation Aborted. Is this because that feature not implemented, or i > setup something wrong ? Works for me. Would need more details to

Re: Full Clojure, Right Now! (tm)

2009-04-03 Thread Phil Hagelberg
Daniel Jomphe writes: > -- Emacs -- > No more works since I've pulled emacs-starter-kit's latest changes. 'M- > x slime' doesn't fire up clojure anymore; slime no more exists, in > fact. The last commit actually removed clojure-mode.el. Maybe they're > in the middle of reorganizing some things.

Re: doseq vs. map

2009-04-03 Thread Phil Hagelberg
Sean writes: > And now everything works great. What I don't understand is why the > doseq macro is required instead of the mapping operation. Could > somebody explain why Clojure has this different form for functions > that have side effects? My take on this is that map supports a functional

Re: clojure dependency management and build

2009-04-08 Thread Phil Hagelberg
Stuart Halloway writes: > Lancet is more at proof-of-concept stage than ready for heavy lifting > -- I am using a mix of Ant and Rake on my own Clojure stuff. :-) > > I am happy to contribute to solving some of these issues but don't > have time to lead the effort. I'm also quite willing to

Re: 3 new contribs: jar, classpath, find-namespaces

2009-04-19 Thread Phil Hagelberg
Stuart Sierra writes: > clojure.contrib.jar: > Small utilities for examining JAR files. I've got a need for an unpack-jar function. Would you like me to write that and submit it as a patch for clojure.contrib.jar? It would take a path to a jar file and a target directory at the very least, and

Re: Oracle and Clojure

2009-04-20 Thread Phil Hagelberg
Sean Devlin writes: > *Will Java continue to be open source? It is simply not possible for this to go away. Future development on Java _could_ be released under developer-hostile licenses, but this would probably be a good thing if the license were bad enough since it would make it obvious that

Re: The Path to 1.0

2009-04-20 Thread Phil Hagelberg
Rich Hickey writes: > If there is just a (def *version* {:major 1 :minor 0 :release 0}) > > my questions are: > > What happens after release to keep subsequent interim versions from > having the same 'version' as a release? Should we have a :status > attribute that is :release for releases and :

Re: The Path to 1.0

2009-04-20 Thread Phil Hagelberg
Stuart Sierra writes: > On Apr 20, 1:48 pm, Rich Hickey wrote: >> I imagine a (clojure-version) function returning: >> >> {:major 1 :minor 0 :release 0} > > I'd suggest calling :release something else, like :revision > or :patch. "release" sounds like a bigger number than major/minor. > Other

Re: Wrapper function for slime

2009-04-21 Thread Phil Hagelberg
Craig McDaniel writes: > Correction: > > (defun reset-swank () > > (defun run-slime (dir) Here's what I use: (plagiarized from Tim Dysinger) (defun slime-project (path) "Setup classpaths for a maven/clojure project & refresh slime" (interactive "GPath: ") (let ((original-dir default-dir)

Recursively delete files

2009-04-22 Thread Phil Hagelberg
I couldn't find an equivalent to "rm -rf" in the JDK, so I wrote these functions: (defn delete-file "Delete file f. Raise an exception if it fails." [f] (or (.delete (file f)) (throw (java.io.IOException. (str "Couldn't delete " f) (defn delete-file-recursively "Delete file f.

Re: Recursively delete files

2009-04-22 Thread Phil Hagelberg
André Thieme writes: > This could really be helpful for some fixtures during unit testing. That's exactly what I'm using it for. =) I think anyone else who has tests that write files is going to need something like this too, which is what made me think it'd be appropriate for contrib. > One mi

PeepCode screencast

2009-04-24 Thread Phil Hagelberg
ure-preview.mov Hope you like it! -Phil Hagelberg http://technomancy.us --~--~-~--~~~---~--~~ 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 To un

Re: PeepCode screencast

2009-04-24 Thread Phil Hagelberg
On Fri, Apr 24, 2009 at 2:08 PM, Scott Jaderholm wrote: > Thanks Phil! I just bought it and look forward to watching it this weekend. > > Are you planning something more advanced? We don't have any plans for that right now, but if it sells well it's definitely a possibility. -Phil --~--~--

Re: Getting slime-edit-definition to work with Clojure

2009-04-26 Thread Phil Hagelberg
On Sun, Apr 26, 2009 at 7:25 AM, Baishampayan Ghose wrote: > I am a Clojure newbie and I have been trying to get M-. > (slime-edit-definition) and the corresponding > M-,(slime-pop-find-definiton-stack) to work with Clojure. > > Right now, if I press M-. I get "Search failed" in he minibuffer. >

Re: Getting slime-edit-definition to work with Clojure

2009-04-28 Thread Phil Hagelberg
On Tue, Apr 28, 2009 at 2:33 AM, Baishampayan Ghose wrote: >>> It works for me. Are you trying to look up a built-in clojure function >>> or one from your own application? How did you install SLIME and >>> swank-clojure etc? > > Any ideas with the problem? I provided all the info in the earlier m

Re: Post 1.0 features

2009-04-28 Thread Phil Hagelberg
Marko Kocić writes: > Since Clojure seems like feature complete for 1.0 release, I am > starting to be curious what are the features planned for after 1.0 > release? You can check the issues list: http://code.google.com/p/clojure/issues/list These are mostly bug fixes rather than new featur

Re: Example Server in Clojure

2009-04-29 Thread Phil Hagelberg
Chris McClellen writes: > I ended up writing a chat server in clojure, thats weighs in at about > 189 lines of code (not counting comments and blank lines). I am > fairly new to clojure so I was hoping people could take a look at it > and give constructive comments about what I did right and wh

Re: Getting slime-edit-definition to work with Clojure

2009-04-29 Thread Phil Hagelberg
Baishampayan Ghose writes: > Can you kindly share your working dotfiles and enlighten me? I use M-x clojure-install plus (clojure-slime-config), since I wrote it. This this is _all_ you need for projects that don't have dependencies on third-party jars. For some other projects, I've been using

  1   2   3   4   5   6   7   8   9   10   >