Hi Sean,
Thank you very much.
I changed read-string to str. And it worked fine now. So is ".toString"
working fine.
for [[k v] props] [(keyword k) (.toString v)]
regards
Manas
On Saturday, April 15, 2017 at 2:28:16 AM UTC+1, Sean Corfield wrote:
>
> Trying to convert arbitrary strings to Cl
Trying to convert arbitrary strings to Clojure objects via read-string is
rather dangerous – read-string can execute arbitrary code (if the string
happens to look like a tagged literal).
Aside from that, read-string is only going to read the first expression from
the string:
Hi
I am trying to compare two eclipse preferences files with a piece of code
I picked from internet
Some of the values in the file are version numbers and clojure is throwing
number format error. How to force clojure read the properties as strings.
CompilerException java.lang.NumberForm
On Mar 26, 1:34 pm, Victor Rodriguez wrote:
> (defmacro with-out-as
> [f & body]
> `(with-open [w# (writer ~f)]
> (binding [*out* w#]
> �...@body)))
I've added something very similar to this to clojure.contrib.duck-
streams.
-Stuart Sierra
--~--~-~--~~~---
sweet :)
- Korny
On Fri, Mar 27, 2009 at 4:34 AM, Victor Rodriguez wrote:
>
> On Tue, Mar 24, 2009 at 11:05 PM, Korny Sietsma wrote:
> > It'd be nice to have a macro that worked more like the first example -
> > "spit" is great for one-liners, but the fact that it opens and closes the
> > file
On Tue, Mar 24, 2009 at 11:05 PM, Korny Sietsma wrote:
> It'd be nice to have a macro that worked more like the first example -
> "spit" is great for one-liners, but the fact that it opens and closes the
> file each time you call it seems a bit painful for anything more complex.
> Something that
ome of the examples
>> >>> interesting.
>> >>>
>> >>> http://paste.pocoo.org/show/109498/
>> >>>
>> >>> On Mar 24, 11:20 am, e wrote:
>> >>> > is there something as simple as this in clojure?
>>
>>> On Mar 24, 11:20 am, e wrote:
> >>> > is there something as simple as this in clojure?
> >>> >
> >>> > whole python program:
> >>> >
> >>> > of = open(filename,"w")
> >>> >
gt;> > of.write("hello")
>>> > of.close()
>>> >
>>> > I checked the api and looked around the wiki and google quickly and saw
>>> > how
>>> > to use java's stuff to do it ... but, welll...
>>> >
)
>> > of.write("hello")
>> > of.close()
>> >
>> > I checked the api and looked around the wiki and google quickly and saw
>> how
>> > to use java's stuff to do it ... but, welll...
>> >
>> > I noticed "
gt; to use java's stuff to do it ... but, welll...
> >
> > I noticed "slurp" in the api for reading ... but only the whole file at
> once
> > (read() but no readline()). Is there something symmetrical for writing
> > (outputting)? Is there a web page calle
he api for reading ... but only the whole file at once
> (read() but no readline()). Is there something symmetrical for writing
> (outputting)? Is there a web page called "File IO" somewhere?
>
> Thanks.
--~--~-~--~~~---~--~~
You received this me
On Mar 25, 2009, at 5:52 AM, Paul Drummond wrote:
Anyone else hate the names 'slurp' and 'spit' as much as me?
You're not alone there.
http://groups.google.com/group/clojure/browse_frm/thread/d8064dbb94c5cd2c/bce36a47121d6faf?lnk=gst&q=slurp+name#bce36a47121d6faf
IMO changing these names w
2009/3/25 e :
> For example, "slurp" is, perhaps, marginally better than "read" because it
> may help express that it reads the whole file.
Anyone else hate the names 'slurp' and 'spit' as much as me? IMO
changing these names would be a great idea whether these functions are
moved up to core or
On Tue, Mar 24, 2009 at 10:19 PM, e wrote:
> I'm interested to know what the process/priority is on bubbling things up
> from contrib into the core. Is a discussion under way about going through
> it all?
>
> I also think it's good to have cross-language conventions sometimes unless
> there are
I'm interested to know what the process/priority is on bubbling things up
from contrib into the core. Is a discussion under way about going through
it all?
I also think it's good to have cross-language conventions sometimes unless
there are compelling reasons.
For example, "slurp" is, perhaps, m
It'd be nice to have a macro that worked more like the first example -
"spit" is great for one-liners, but the fact that it opens and closes the
file each time you call it seems a bit painful for anything more complex.
Something that ends up working like:
(with-out-as "test.txt"
(println "hello
On Mar 24, 11:53 pm, e wrote:
> does anyone else think that should be more fundamental like the python
> example? imagine saying that out loud to your friend who asks . . . and the
> amount of noise, visually:
>
> "use clojure dot contrib dot duck dash streams".
>
> perhaps it is already the h
i guess another way to say this is that I can see both sides of the argument
... on one side, it shouldn't be a priority to resolve problems that java
already provides when there are probably other more pressing issues. And
it's part of the design decision to allow users to leverage java libraries
does anyone else think that should be more fundamental like the python
example? imagine saying that out loud to your friend who asks . . . and the
amount of noise, visually:
"use clojure dot contrib dot duck dash streams".
perhaps it is already the hope that it will "spit" will eventually sit ne
On Mar 24, 12:42 pm, Parth Malwankar
wrote:
> user=> (with-open [f (writer (file "test.txt"))]
> (binding [*out* f]
> (println "hello world !!!")))
Or even more simply:
(use 'clojure.contrib.duck-streams)
(spit "test.txt" "Hello, world!\n")
-Stuart Sierra
--~--~-~
!!!")))
nil
user=>
% cat test.txt
hello world !!!
%
clojure.contrib.duck-stream has an interesting set of
functions.
Parth
> I noticed "slurp" in the api for reading ... but only the whole file at once
> (read() but no readline()). Is there s
uot;hello")
> of.close()
>
> I checked the api and looked around the wiki and google quickly and saw how
> to use java's stuff to do it ... but, welll...
>
> I noticed "slurp" in the api for reading ... but only the whole file at
> once (read() but no
ed "slurp" in the api for reading ... but only the whole file at once
(read() but no readline()). Is there something symmetrical for writing
(outputting)? Is there a web page called "File IO" somewhere?
Thanks.
--~--~-~--~~~---~--~~
You received t
24 matches
Mail list logo