Re: Raw strings

2013-03-17 Thread Softaddicts
I find raw string handling in XML simply ugly :) Of course I do have a strong opinion about how bad XML turned out from a typesetting tool to an industry wide cancer :) but cdata stuff basically breaks the XML structure. Visually speaking it's a mess, obviously it's relative, XML by itself is n

Re: FYI - Light Rail notes for Portland (fix)

2013-03-17 Thread Mike Coleman
On Sun, Mar 17, 2013 at 12:41 AM, Charlie Griefer wrote: > Does that look right to anybody who might be more familiar with the area? It I live here, and that's how I would do it. -mc -- -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to th

Re: Raw strings

2013-03-17 Thread Mark Engelberg
On Sun, Mar 17, 2013 at 6:07 PM, vemv wrote: > Reading a raw string stored in a file is already trivial :) > I'm aware that one can store a raw string in a file. But in many instances, this would be absurd. For the kind of rapid interactive development we have in Clojure, we don't necessarily

[ANN] Termito - a term rewriting library

2013-03-17 Thread Jonas
Hi I'm happy to announce the first release of termito[1]. Termito is a term rewriting library inspired by the kibit rule system. With termito you can write declarative term rewriting rules like (defrules zero-rules [(* 0 ?x) 0]) (defrules identity-rules [(* 1 ?x) ?x]

Re: ANN: core.logic 0.8.0

2013-03-17 Thread Ambrose Bonnaire-Sergeant
This is epic, and a long time coming! Thanks for the hard work David and congrats to the other contributors, especially Nada and Jonas! Thanks, Ambrose On Mon, Mar 18, 2013 at 3:50 AM, David Nolen wrote: > I'm happy to announce the release of core.logic 0.8.0. There are far too > changes, bug f

Re: ANN: core.logic 0.8.0

2013-03-17 Thread David Nolen
Hot on the heels of 0.8.0, 0.8.1! This is mostly to push out some nice catches from Jonas Enlund (who works on the Clojure linter Kibit). One cool addition is that featurec is now recursive so you can constrain & extract features of out nested maps with ease. http://github.com/clojure/core.logic/b

Re: Raw strings

2013-03-17 Thread vemv
> > Python has a notation for "raw strings" > Python also has multiple inheritance :) what I want to mean is that some features have dubious value, regardless of whether they made it to language X or Y. I'm working on a project right now where the lack of raw strings is > killing me.

Re: clojure.core/format localization problems

2013-03-17 Thread dabd
It seems like 1.7 changed how default Locales are read from the host: http://stackoverflow.com/questions/7107972/java-7-default-locale http://blog.ej-technologies.com/2011/12/default-locale-changes-in-java-7.html On Sunday, March 17, 2013 10:40:19 PM UTC, dabd wrote: > > I'm having this problem ag

Re: Can I get a string like ":cities" as a keyword without getting the double "::"?

2013-03-17 Thread larry google groups
Thanks all. read-string seems obvious now that you all suggest it. On Sunday, March 17, 2013 3:01:14 PM UTC-4, Michael Klishin wrote: > > > 2013/3/17 JvJ > > >> Use read-string. >> >> user> (read-string ":cities") >> :cities >> > > And if the input may be coming from untrusted sources, please u

Re: clojure.core/format localization problems

2013-03-17 Thread dabd
I'm having this problem again. I start the repl with nrepl-jack-in. Also starting it on the command line with 'lein repl' shows the same problem. What is causing the JVM to lose the default locale settings (at least in regard to number formatting)? Thanks. On Sunday, March 10, 2013 12:39:57 A

Re: [ClojureScript] Re: Moving ClojureScript to Clojure 1.5.0 & data.json dependency

2013-03-17 Thread David Nolen
Done! On Sun, Mar 17, 2013 at 4:49 PM, Darrick Wiebe wrote: > On Friday, 1 March 2013 11:41:26 UTC-8, David Nolen wrote: > > Now that Clojure 1.5.0 is out the door I'd like to make ClojureScript > depend on it. This would allow me to merge in the source map branch which > is a work in progress

Re: FYI - Light Rail notes for Portland (fix)

2013-03-17 Thread Charlie Griefer
On Mar 16, 2013, at 9:24 PM, Rich Morin wrote: > The cost of a taxi from Portland Intl. Airport (PDX) > to the Clojure/West hotel (Courtyard by Marriott) is > listed (by the hotel) as about $35 one way. > > To save money, you can take the (TriMet) light rail: > > * Walk to the Portland Intl. M

ANN: core.logic 0.8.0

2013-03-17 Thread David Nolen
I'm happy to announce the release of core.logic 0.8.0. There are far too changes, bug fixes, and enhancements to cover here. For the most part the miniKanren portion of core.logic has been left unchanged from the standpoint of the user. The biggest change is the inclusion of extensible constraint l

Re: Can I get a string like ":cities" as a keyword without getting the double "::"?

2013-03-17 Thread Michael Klishin
2013/3/17 JvJ > Use read-string. > > user> (read-string ":cities") > :cities > And if the input may be coming from untrusted sources, please use clojure.edn/read-string (Clojure 1.5+). -- MK http://github.com/michaelklishin http://twitter.com/michaelklishin -- -- You received this message b

Re: Can I get a string like ":cities" as a keyword without getting the double "::"?

2013-03-17 Thread Jim - FooBar();
aaa of course, if you do want to *read* the keyword in, use read-string...there is no point in getting rid of the ':' and then essentially re-inserting it! Jim On 17/03/13 18:51, JvJ wrote: Use read-string. user> (read-string ":cities") :cities On Sunday, 17 March 2013 14:42:38 UTC-4, larr

Re: Can I get a string like ":cities" as a keyword without getting the double "::"?

2013-03-17 Thread JvJ
Use read-string. user> (read-string ":cities") :cities On Sunday, 17 March 2013 14:42:38 UTC-4, larry google groups wrote: > > > I have been doing stuff like (str type-as-keyword) to push values into > HTML forms, which leaves me with a string like ":cities" when the HTML > forms are submitted.

Re: Can I get a string like ":cities" as a keyword without getting the double "::"?

2013-03-17 Thread Jim - FooBar();
On 17/03/13 18:42, larry google groups wrote: (st/replace (str (:name item)) #":" "") #(apply str (next %)) Jim -- -- 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 that posts from

Can I get a string like ":cities" as a keyword without getting the double "::"?

2013-03-17 Thread larry google groups
I have been doing stuff like (str type-as-keyword) to push values into HTML forms, which leaves me with a string like ":cities" when the HTML forms are submitted. I might fetch them like: (let [this-item (get-in request [:params "answers"])) If I then do: this-item-as-keyword (keyword this-i

Re: FYI - Light Rail notes for Portland (fix)

2013-03-17 Thread Paul deGrandis
There is no need to change trains. Stay on the Red line (the one you got on at the airport) and take it to pioneer square. That will be about three blocks from the hotel. Paul On Saturday, March 16, 2013 9:24:42 PM UTC-7, Rich Morin wrote: > > The cost of a taxi from Portland Intl. Airport (PDX

Re: Imported Java lib can't find classes compiled on the fly

2013-03-17 Thread Víctor M . Valenzuela
There's the alternative signature Class.forName(String, boolean, ClassLoader). I got the Java side to use that instead of a plain Class.forName, passing it a custom ClassLoader (see my immediately previous reply). On Sun, Mar 17, 2013 at 12:38 PM, Marko Topolnik wrote: > No built-in Java mechanis

Re: Laziness in filter

2013-03-17 Thread bruce li
Ah, it works. It is really chunked sequences. Thanks. Having been using clojure for half a year, it keeps really bringing me surprise and fun :) 2013/3/17 Marko Topolnik > This is one of the most frequenly-asked questions and a source of surprise > to practically every new Clojure user. An upda

Re: Constructing java classes from a string containing the class name

2013-03-17 Thread Dave Snowdon
Great! Many thanks. Dave On Sunday, 17 March 2013 08:18:27 UTC, dennis wrote: > > Sorry,it's getDeclaredConstructor: > > (-> klassname (Class/forName) (. getDeclaredConstructor String int) > (.newInstance host port)) > > > 2013/3/17 dennis zhuang > > >> You can get the constructor and instance it

Re: Imported Java lib can't find classes compiled on the fly

2013-03-17 Thread Marko Topolnik
No built-in Java mechanism (such as Class/forName) relies on the context classloader, that's just a mechanism that was supposed to help other frameworks manage class loading. Every such framework would have to explicitly getContextClassLoader to use it. On Sunday, March 17, 2013 4:05:51 AM UTC+

Re: Laziness in filter

2013-03-17 Thread Marko Topolnik
This is one of the most frequenly-asked questions and a source of surprise to practically every new Clojure user. An update to the official documentation on lazy sequences would surely help a lot here. -marko On Sunday, March 17, 2013 9:18:05 AM UTC+1, Evan Mezeske wrote: > > I'd guess that wha

Re: Laziness in filter

2013-03-17 Thread dennis zhuang
Yep,it's chunked sequence,just like batch processing. You can use the seq1 function in fogus blog. 2013/3/17 Evan Mezeske > I'd guess that what you're seeing is related to chunked sequences: > http://blog.fogus.me/2010/01/22/de-chunkifying-sequences-in-clojure/ . > > > On Sunday, March 17, 2013

Re: Generate static methods at runtime?

2013-03-17 Thread Marko Topolnik
On Sunday, March 17, 2013 8:31:24 AM UTC+1, vemv wrote: > Yeah I guess it could work, did you have in mind something like > programmatically running `lein compile`? > Yes, just about, but even simpler: you just call *compile*, *load, load-file * or similar while binding *compile-files* to true (

Re: Imported Java lib can't find classes compiled on the fly

2013-03-17 Thread dennis zhuang
You can make the clojure class loader by yourself: (import '(clojure.lang RT)) (def class-loader (RT/makeClassLoader)) user=> (.loadClass class-loader "user.Foo") user.Foo 2013/3/17 vemv > Most definitely :) But that something is hard/confusing should'nt be > enough reason to give up. > > >

Re: Laziness in filter

2013-03-17 Thread Evan Mezeske
I'd guess that what you're seeing is related to chunked sequences: http://blog.fogus.me/2010/01/22/de-chunkifying-sequences-in-clojure/ . On Sunday, March 17, 2013 1:12:17 AM UTC-7, bruce li wrote: > > Hello, everyone. I'm writing some code that utilizes the lazy sequence. > But I found somethi

Laziness in filter

2013-03-17 Thread bruce li
Hello, everyone. I'm writing some code that utilizes the lazy sequence. But I found something strange. Here is how: The code is like: (first (filter some-expensive-io urls)) The code is aimed to find the first result of the operations on the urls that is not nil. However, it seems that the io op

Constructing java classes from a string containing the class name

2013-03-17 Thread Dave Snowdon
I need the ability to create one of a number of java classes which have constructors taking a known list of parameters. There are a large enough number of classes that having a set of conditions testing for each class name would be unmanageable. The classes are from a third-party jar file so I cann

Re: Generate static methods at runtime?

2013-03-17 Thread Víctor M . Valenzuela
Yeah I guess it could work, did you have in mind something like programmatically running `lein compile`? Can the JVM handle .class files written on the fly? Anyway, for my particular problem I don't need runtime-compiled static methods anymore. On Sun, Mar 17, 2013 at 7:34 AM, Marko Topolnik wro