I think it's important that Clojure be good at exploring Java
libraries. Helpful and correct error messages are important for this.
I often go looking for a function at the REPL, like so:
user=> substring
java.lang.Exception: Unable to resolve symbol: substring in this
context (NO_SOURCE_FILE:
Has the inverse of slurp been added to the core libraries yet? Like this:
(spit "Some text" "/foo.txt")
to make a file called 'foo.txt' containing "Some text".
By the way, it appears that Clojure (or Java) doesn't recognize ~, as
in (slurp "~/foo.txt"). True?
--~--~-~--~~
Thanks, Stuarts!
On Nov 16, 10:06 am, Stuart Sierra <[EMAIL PROTECTED]>
wrote:
> Yes, spit is in clojure.contrib.duck-streams.
>
> Java doesn't support "~", but if you want the home directory you can
> get it with
> (System/getProperty "user.home")
> -Stuart
>
> On Nov 16, 9:18 am, Stuart Hallowa
For the File / IO things, skip the Java libs - they are pretty low
level. Go with the Jakarta Commons libs:
http://commons.apache.org/io/description.html , as Stuart has
recommended elsewhere.
On Mon, Nov 24, 2008 at 6:48 AM, Stuart Sierra
<[EMAIL PROTECTED]> wrote:
>
> It's useful to know the s
Seconded. As far as I can tell all you can do is go to Sourceforge
and poke around in the source code:
http://clojure-contrib.svn.sourceforge.net/viewvc/clojure-contrib/trunk/src/clojure/contrib/
On Wed, Nov 26, 2008 at 12:26 AM, Ralf Bensmann
<[EMAIL PROTECTED]> wrote:
> ?
>
> On Mon, Nov 24, 2
It's very handy to be able to type in a symbol at the REPL and see its value.
On Sun, Nov 30, 2008 at 10:15 AM, Mark Volkmann
<[EMAIL PROTECTED]> wrote:
>
> On Sun, Nov 30, 2008 at 10:35 AM, Paul Barry <[EMAIL PROTECTED]> wrote:
>>
>> It's a minor thing, but wouldn't it be a good idea to put (de
Right, the outer parenthesis denote a list. That list contains only
one element. The element is the vector ["qui" "ui" "i"]
On Thu, Dec 11, 2008 at 9:43 PM, Stephen C. Gilardi wrote:
>
> In the latter case the result is a seq containing a single element:
> the vector. There is nothing to sort/
Why aren't all sequences callable, i.e. why don't they all implement
IFn? I'd like to use lists like this sometimes.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To post to this group, send email
Then why are sets callable? Not that I'm complaining - I found it
handy, then came to wonder why lists aren't.
-Ethan
> I'd just like to add to this discussion that maps and vectors are
> functions not just because it's neat or possible, with the
> implementation one of many possibilities, but
te"
> collection the way vectors and maps are. There isn't a good way to
> conceptualize that as a function.
>
> I've probably just made this more confusing, but that's the best I
> could come up with.
>
> -Stuart Sierra
>
> On Jan 12, 6:51 pm, Ethan
10 matches
Mail list logo