Re: :require farms in Clojure?

2011-07-20 Thread pmbauer
Something akin to the clj-nstools ns+ in clojure proper would sure make life easier. -- 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 new members are moderated - please

Re: BUG REPORT: ClojureScript : Portable Path Support

2011-07-20 Thread pmbauer
If ClojureScript isn't "mavenified", how else do you easily make it a dependency in a web application? -- 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 new members are

Re: BUG REPORT: ClojureScript : Portable Path Support

2011-07-20 Thread pmbauer
I know. But the sorts of (presently non-portable) scripts in "scripts" (see bootstrap, repl) ad-hoc test strategy, etc in ClojureScript are begging for dependency management and a build tool. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post t

Re: Excellent intro to core.logic

2011-07-20 Thread Meikel Brandmeyer
Hi, Am Mittwoch, 20. Juli 2011 15:28:58 UTC+2 schrieb Ambrose Bonnaire-Sergeant: > > I also dropped the whole walkthrough with typedo, and replaced it with an > interesting (but much easier) look at geto. > See "Utility Function: geto" for the new section. > > https://github.com/frenchy64/Logic-

ClojureScript Presentation - video

2011-07-20 Thread Harrison Maseko
Hi all, I did not watch the live cast of Rich's presentation on ClojureScript. Could someone please point me to a video or audio recording of the presentation if there's one somewhere on the Web? Thanks, -h. -- You received this message because you are subscribed to the Google Groups "Clojure" gr

Re: BUG REPORT: ClojureScript : Portable Path Support

2011-07-20 Thread Sean Corfield
On Wed, Jul 20, 2011 at 9:34 PM, pmbauer wrote: > Even better would be ClojureScript with maven support Didn't Rich say he hopes Maven doesn't come anywhere near ClojureScript? :) -- Sean A Corfield -- (904) 302-SEAN An Architect's View -- http://corfield.org/ World Singles, LLC. -- http://world

BUG REPORT: ClojureScript : Portable Path Support

2011-07-20 Thread pmbauer
PS re: 3rd point (portable helper scripts) Even better would be ClojureScript with maven support - much bigger effort, sure. I'd be willing to help work on that and submit some patches/plugins if that was an authorized direction. -- You received this message because you are subscribed to the G

Re: clojure.java.jdbc 0.0.5 available

2011-07-20 Thread Sean Corfield
On Wed, Jul 20, 2011 at 7:18 AM, Shantanu Kumar wrote: > JDBC Batch-insert is not supposed to return a list of generated keys. There may be multiple autogenerated keys in a single row - not common, I suspect, but possible. So normally with c.j.j, you'll get back a sequence with a single generated

Re: Problem Running ClojureScript on OpenJDK

2011-07-20 Thread db
I had the same problem with open jdk on ubuntu. It looks like open jdk has the class, but drops the 'internal' from the package name. You can remove the 'internal' in two places in compiler.clj and it seems to work. Longer term, the implementation-specific internal package should be removed or so

Re: The Last Programming Language

2011-07-20 Thread Luc Prefontaine
I worked a lot in several assembler implementations in the 80/90s and creating self-rewriting code was still common. I remember creating a program crawling in memory on an IBM 370 compatible computer by copying itself before jumping in its new instance, I wrote this one as an amusement :) I ne

BUG REPORT: ClojureScript : Portable Path Support

2011-07-20 Thread pmbauer
Per instructions from redinger and jgehtland (patch addressing one issue attached). Three separate issues so far re: path support on windows * compiler path regex is not portable, cljs/compiler.clj:1096 (see attached patch, thanks amalloy for the assist) * generated JS has path problems on win

Re: Excellent intro to core.logic

2011-07-20 Thread Ambrose Bonnaire-Sergeant
Thanks Brent, fixed! https://github.com/frenchy64/Logic-Starter/wiki/_compare/70c2518e77c3a52b38645f656c03149b31edcb32...837b794bedf93c959982533e8bdd12ef4fecf141 Ambrose On Thu, Jul 21, 2011 at 8:46 AM, Brent Millare wrote: > Should the example: > > (run* [q] > (geto 'g >[['f :

Re: Problem Running ClojureScript on OpenJDK

2011-07-20 Thread David Soria
Okay, it's a GNU classpath problem, as they don't include sun.* namespaces. Sadly javax.script.ScriptEngineManager is available and returns an impl of javax.script.Scriptable, which refers to some rhino engine that is in the classpath, but the concrete needed sun.org.mozilla.internals.Context is no

Re: Problem with Leiningen 1.6.1 in Windoes

2011-07-20 Thread Matjaz Gregoric
Could you try using the master version of lein.bat? There have been a couple of patches applied since 1.6.1 that might help with your issue. You can get the latest version here: https://raw.github.com/technomancy/leiningen/master/bin/lein.bat Make sure to change the version number to 1.6.1 before

Problem Running ClojureScript on OpenJDK

2011-07-20 Thread David Soria
Hi, I try to run ClojureScript rev e4ad8ed60ca05645e0ac96362d4c6ef1e1a2bd6f my environment is: Fedora Linux 15 java version "1.6.0_22" OpenJDK Runtime Environment (IcedTea6 1.10.2) (fedora-58.1.10.2.fc15- x86_64) OpenJDK 64-Bit Server VM (build 20.0-b11, mixed mode) After bootstrapping, I try to

Re: Excellent intro to core.logic

2011-07-20 Thread Brent Millare
Should the example: (run* [q] (geto 'g [['f :- Integer]] Integer) (== q true)) ;=> () The type association ['g :- Integer] does not occur in the environment [ ['f :- Integer] ], so geto succeeds. Read "so geto fails" instead? since the result is ()? On Jul 20,

[ANN] ClojureScript

2011-07-20 Thread Christopher Redinger
In case you missed the announcement streamed from this evening's NYC Clojure Group. https://github.com/clojure/clojurescript Clojure to JS compiler. Power of Clojure. Reach of JavaScript. Please use this Clojure mailing list for ClojureScript discussion. We plan to have a recording of tonight'

Re: :require farms in Clojure?

2011-07-20 Thread Phil Hagelberg
stu writes: > Yes -- this is the kind of thing I was wondering about (although > Chas' answer is immediately useful too--thanks). > > At this point I'm wondering if this is an idiomatic way to work > with Clojure namespaces especially in larger projects with many sub- > components as name

Re: principle of least surprise

2011-07-20 Thread Tamreen Khan
It's because functions such as reduce, map, reverse, etc. only work on sequences, so they have to call seq on that argument. Strings just happen to be seq-able but calling seq on one returns a list of characters, so the result is one too. Reverse always returns a sequence and strings aren't technic

Re: :require farms in Clojure?

2011-07-20 Thread stu
On Jul 20, 4:19 pm, Meikel Brandmeyer wrote: > I think he wants more something like this: > > (ns require.farm) > > (def xxx '[[foo.bar [a :as a] [b :as b]] frob.nicate]) > (def yyy '[[foo.bar.c :as c]]) > > (ns require.userA >   (:require [require.farm :as requires])) > > (apply require requires

principle of least surprise

2011-07-20 Thread Basi Lambanog
Hello, Any reason for the change in type after some operations, for example: user=> (type (reverse "abc")) clojure.lang.PersistentList user=> (type "abc") java.lang.String Since reverse operates on a string, shouldn't the result be a string as well? There's a few more of these type re-casting af

Problem with Leiningen 1.6.1 in Windoes

2011-07-20 Thread Arie van Wingerden
Hi, the self-install worked ok, and I checked that the jar is present in: C:\Documents and Settings\Administrator\.lein\self-installs\leiningen-1.6.1-standalone.jar But the "lein deps" for a project gets stuck: D:\src\Clojure\test2>lein deps Exception in thread "main" java.lang.NoClassDefFoundEr

Re: The Last Programming Language

2011-07-20 Thread Vivek Khurana
On Wed, Jul 20, 2011 at 7:52 PM, daly wrote: > > A justification of homoiconicisty is that programs == data. > > A clever soul named Von Neumann made the observation that machines > were controlled by external commands (i.e. programs) to operate on > things (i.e. data). His insight was to unify

Re: The Last Programming Language

2011-07-20 Thread daly
Leave it to XKCD to figure out the last word on this :-) http://www.xkcd.com On Wed, 2011-07-20 at 10:22 -0400, daly wrote: > On Tue, 2011-07-19 at 22:16 -0700, Sean Corfield wrote: > > On Tue, Jul 19, 2011 at 5:14 PM, Adam Richardson > > wrote: > > > the value placed on the last language being

Re: Constructing clj-http Get Query

2011-07-20 Thread octopusgrabbus
That's it. Thanks. user=> (client/get "http://MailVerify/Lookup/chkAddr.asp"; {:query- params {"CA" "1", "STREET" "909 FROTHINGVALE ST", "STREET2" " ", "CITY" "MADEUPVILLE", "STATE" "MA", "ZIP" "02474"}}) On Jul 20, 10:49 am, Mark Rathwell wrote: > You need to specify the base url string as the

Re: Constructing clj-http Get Query

2011-07-20 Thread Mark Rathwell
You need to specify the base url string as the first argument, and the map is an optional second argument: (client/get "http://..."; {:query-params {"CA" ...}}) On Wed, Jul 20, 2011 at 10:46 AM, octopusgrabbus wrote: > On Jul 20, 10:26 am, Ulises wrote: > > try passing a map such as {:query-pa

Re: Constructing clj-http Get Query

2011-07-20 Thread octopusgrabbus
On Jul 20, 10:26 am, Ulises wrote: > try passing a map such as {:query-params {"CA" ca, "street" street ...}}. > I've tried a few variations of the following but with no luck. (client/get {:query-params {"CA" "1", "STREET" "625 OX ST", "STREET2" " ", "CITY" "SPRINGFIELD", "ZIP" "9"}}) java.l

Re: Constructing clj-http Get Query

2011-07-20 Thread Michael Wood
On 20 July 2011 16:38, octopusgrabbus wrote: > Thanks. That creates a great URL string, but when passed into (client/ > get > gets this error: > > java.lang.IllegalArgumentException (NO_SOURCE_FILE:0) When you get that, try: (.printStackTrace *e) It might give you more useful information about

Re: Constructing clj-http Get Query

2011-07-20 Thread octopusgrabbus
Thanks. That creates a great URL string, but when passed into (client/ get gets this error: java.lang.IllegalArgumentException (NO_SOURCE_FILE:0) cmn On Jul 20, 10:24 am, Mark Rathwell wrote: > (require '[clj-http.client :as client]) > > (defn make-url [ca street-1 street-2 city state zip] >   (

Re: Constructing clj-http Get Query

2011-07-20 Thread Mark Rathwell
> try passing a map such as {:query-params {"CA" ca, "street" street ...}}. Yes, much cleaner, sorry about that: (require '[clj-http.client :as client]) (def q { "CA" "xx" "STREET" "123 Some St" "STREET2" "Apt 24" "CITY" "New York" "STATE" "NY" "ZIP" "10026"}) (client/get "http://MailVerify/Loo

Re: Constructing clj-http Get Query

2011-07-20 Thread Ulises
try passing a map such as {:query-params {"CA" ca, "street" street ...}}. On 20 July 2011 16:24, Mark Rathwell wrote: > > (require '[clj-http.client :as client]) > (defn make-url [ca street-1 street-2 city state zip] >   (let > [url "http://MailVerify/Lookup/chkAddr.asp?CA=%s&street=%s&STREET2=%s

Re: Constructing clj-http Get Query

2011-07-20 Thread Mark Rathwell
(require '[clj-http.client :as client]) (defn make-url [ca street-1 street-2 city state zip] (let [url " http://MailVerify/Lookup/chkAddr.asp?CA=%s&street=%s&STREET2=%s&CITY=%s&STATE=%s&ZIP=%s "] (format url ca street-1 street-2 city state zip))) (client/get (make-url "xxx" "123 Some St" "A

Re: The Last Programming Language

2011-07-20 Thread daly
On Tue, 2011-07-19 at 22:16 -0700, Sean Corfield wrote: > On Tue, Jul 19, 2011 at 5:14 PM, Adam Richardson wrote: > > the value placed on the last language being > > homoiconic (without much justification) > > Yeah, that was definitely a weak point of his talk. I thought there > was a lot of inte

Re: clojure.java.jdbc 0.0.5 available

2011-07-20 Thread Shantanu Kumar
On Jul 20, 4:15 pm, Mark Nutter wrote: > > * Add support for databases that cannot return generated keys (e.g., HSQLDB) > >  - insert operations silently return the insert counts instead of > > generated keys > >  - it is the user's responsibility to handle this if you're using > > such a databa

Constructing clj-http Get Query

2011-07-20 Thread octopusgrabbus
I've been looking at the examples for clj-http. I'm trying to map the perl string (below) to clj-http's parameters. $gInputUrl = "http://MailVerify/Lookup/chkAddr.asp"; . "?CA=" . $gCa . "&STREET=" . $gAddrSubst1 . "&STREET2=" . $gAddrSubst2 . "&CITY=" . $gCity . "&STATE=" . $gState . "&ZIP=" . $z

tools.logging 0.2.0 released

2011-07-20 Thread Aaron Bedra
Alex Taggart has been busy with upgrades to tools.logging recently and a few people have asked for a new release. I cut 0.2.0 last night and it is in Central now and available for use. Cheers, Aaron Bedra -- Clojure/core http://clojure.com -- You received this message because you are subscri

Re: Fixing Java Apache Class error

2011-07-20 Thread octopusgrabbus
On Jul 20, 9:45 am, Islon Scherer wrote: > Mark is right, you should use lein (or cake) repl instead of trying to run > clojure on command line. Thanks. There is no reason I can't do that. It works. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To

Re: Fixing Java Apache Class error

2011-07-20 Thread Islon Scherer
Mark is right, you should use lein (or cake) repl instead of trying to run clojure on command line. -- 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 new members are mod

Re: Fixing Java Apache Class error

2011-07-20 Thread Mark Rathwell
Is there a reason you can't just use 'lein repl' (or 'cake repl') since this appears to be a lein or cake project? Then you don't need to worry about specifying classpaths, everything in your project is automatically placed on the classpath. On Wed, Jul 20, 2011 at 9:35 AM, octopusgrabbus wrote:

Re: Fixing Java Apache Class error

2011-07-20 Thread Aaron Bedra
Not to derail this too much, but what do you need from clj-http? On 07/20/2011 09:35 AM, octopusgrabbus wrote: Same problem. I'm starting Clojure like this, and have rebuilt clj- http with cake deps exec java -cp /usr/share/java/jline.jar:/usr/share/java/clojure.jar:/ usr/share/java/clojure-co

Re: Fixing Java Apache Class error

2011-07-20 Thread octopusgrabbus
Same problem. I'm starting Clojure like this, and have rebuilt clj- http with cake deps exec java -cp /usr/share/java/jline.jar:/usr/share/java/clojure.jar:/ usr/share/java/clojure-contrib.jar:/usr/share/java/commons- logging-1.1.1.jar:/home/cnorton/git_build/clj-http/clj- http-0.1.3.jar"$extra_c

Fixing Java Apache Class error

2011-07-20 Thread octopusgrabbus
When I do this: Clojure 1.2.1 user=> (require '[clj-http.client :as client]) I get this error: java.lang.ClassNotFoundException: org.apache.http.HttpRequest (core.clj:1) Does this mean I'm missing a java component? Thanks. cmn -- You received this message because you are subscribed to the Go

Re: Fixing Java Apache Class error

2011-07-20 Thread octopusgrabbus
I've already tried this, and it did not fix the problem. http://www.java-samples.com/showtutorial.php?tutorialid=674 On Jul 20, 9:21 am, octopusgrabbus wrote: > When I do this: > > Clojure 1.2.1 > user=> (require '[clj-http.client :as client]) > > I get this error: > > java.lang.ClassNotFoundExce

Re: Fixing Java Apache Class error

2011-07-20 Thread Islon Scherer
It seems like you didn't put the apache HTTP client jars in your path. Are you using leiningen? If so you only need to run "lein deps" and it will download the dependencies. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send

Re: Excellent intro to core.logic

2011-07-20 Thread Ambrose Bonnaire-Sergeant
Hi Meikel, On Tue, Jul 19, 2011 at 2:27 PM, Meikel Brandmeyer wrote: > Hi Ambrose, > > I haven't been exposed to logic programming besides the examples David > posted to the list. I found your tutorial very easy to follow and to read. I > have two minor nit-picks. > > >1. I understand, that

Re: Excellent intro to core.logic

2011-07-20 Thread David Nolen
On Wed, Jul 20, 2011 at 3:45 AM, Ambrose Bonnaire-Sergeant < abonnaireserge...@gmail.com> wrote: > On Wed, Jul 20, 2011 at 3:34 PM, Tassilo Horn wrote: >> >> > Here's the relevant Jira issue, feel free to voice your opinion. >> > >> > http://dev.clojure.org/jira/browse/LOGIC-10 >> >> I had a quic

Re: (count-all str1 str2)

2011-07-20 Thread Ken Wesson
By the way, if I had to hazard a guess I'd say he's computing a distance of some kind between the two strings, possibly the Hamming distance, and possibly for a spellchecker or something similar. Though spellcheckers generally do their comparisons on strings small enough that O(n^3) asymptotic beha

Re: (count-all str1 str2)

2011-07-20 Thread Ken Wesson
On Wed, Jul 20, 2011 at 7:32 AM, Baishampayan Ghose wrote: > On Wed, Jul 20, 2011 at 11:04 AM, Payam Mahmoudian > wrote: >> It's appreciated if you could help me to convert following C code into >> clojure: >> >> float qTR(char *s1, char *s2) >> { >>    int    p,pl,q=0,r,s1l=strlen(s1),s2l=strle

Re: Error running Clojure 1.3 in Eclipse

2011-07-20 Thread Chas Emerick
On Jul 20, 2011, at 1:24 AM, Sean Corfield wrote: > On Tue, Jul 19, 2011 at 4:57 PM, Chas Emerick wrote: >> Depends on what you're using out of contrib 1.2.0. There are a number of >> namespaces that do not run afoul of the changes in Clojure 1.3.0. > > Good to know some parts do work. So far

Re: (count-all str1 str2)

2011-07-20 Thread Baishampayan Ghose
On Wed, Jul 20, 2011 at 11:04 AM, Payam Mahmoudian wrote: > It's appreciated if you could help me to convert following C code into > clojure: > > float qTR(char *s1, char *s2) > { >    int    p,pl,q=0,r,s1l=strlen(s1),s2l=strlen(s2); > >    for (p=0;p        for (pl=1;pl<=s1l-p;pl++) >          

Re: [ANN] clojure.java.jdbc 0.0.5 available

2011-07-20 Thread Ken Wesson
On Wed, Jul 20, 2011 at 7:15 AM, Mark Nutter wrote: >> * Add support for databases that cannot return generated keys (e.g., HSQLDB) >>  - insert operations silently return the insert counts instead of >> generated keys >>  - it is the user's responsibility to handle this if you're using >> such a

Re: (count-all str1 str2)

2011-07-20 Thread Payam Mahmoudian
Hi, I am a newbie to clojure. It's appreciated if you could help me to convert following C code into clojure: float qTR(char *s1, char *s2) { intp,pl,q=0,r,s1l=strlen(s1),s2l=strlen(s2); for (p=0;p wrote: > That works well. Thank you very much! > Tuba > > On Jul 19, 1:47 am, Meikel

Re: [ANN] clojure.java.jdbc 0.0.5 available

2011-07-20 Thread Mark Nutter
> * Add support for databases that cannot return generated keys (e.g., HSQLDB) >  - insert operations silently return the insert counts instead of > generated keys >  - it is the user's responsibility to handle this if you're using > such a database! If I'm understanding this correctly, this means

Re: The Last Programming Language

2011-07-20 Thread Nick Zbinden
Maybe the PLOT language is intressting to people here. It has syntax and a very powerful macro system. http://users.rcn.com/david-moon/PLOT/ -- 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

Re: The Last Programming Language

2011-07-20 Thread Ken Wesson
On Tue, Jul 19, 2011 at 9:04 PM, daly wrote: > I believe that Robert missed the fundamental point though. It is > NOT just the space of ideas that makes lisp "the right language". > Another key reason is "impedance matching". (An impedance mismatch > is when you hook a soda straw to a firehose). >

Re: Excellent intro to core.logic

2011-07-20 Thread Ambrose Bonnaire-Sergeant
On Wed, Jul 20, 2011 at 3:34 PM, Tassilo Horn wrote: > > > Here's the relevant Jira issue, feel free to voice your opinion. > > > > http://dev.clojure.org/jira/browse/LOGIC-10 > > I had a quick look at your patch but I'm not sure if all of them comply > with the usual clojure conventions. For exam

Re: Excellent intro to core.logic

2011-07-20 Thread Tassilo Horn
Ambrose Bonnaire-Sergeant writes: Hi Ambrose, >> > Ambrose has submitted a patch which I need to go over. Even so, I >> > don't think docstrings are going to help you that much. >> >> It doesn't teach you logic programming, but at least it could explain >> the arguments. Something like: >> >> (

Re: Excellent intro to core.logic

2011-07-20 Thread Ambrose Bonnaire-Sergeant
On Wed, Jul 20, 2011 at 2:40 PM, Tassilo Horn wrote: > David Nolen writes: > > Hi David, > > > Ambrose has submitted a patch which I need to go over. Even so, I > > don't think docstrings are going to help you that much. > > It doesn't teach you logic programming, but at least it could explain >