Re: Cognitect joins Nubank!

2020-07-24 Thread David Powell
> I think this will *compound interest* in the language!
>

Nice.  And congratulations Clojure team!

-- 
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 be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/clojure/CAEBWtKjXgrJLEZUeeNbjARAsuFBvyqF9YQr%2B1pikZa5D42kLmg%40mail.gmail.com.


Re: ANN: clj-windows-1.0-alpha - Clojure installer and CLI tools for windows 10

2018-11-06 Thread David Powell
Just wondering...

You know how the escaping of double quotes with backslashes gets pretty
messy in windows because single quotes aren't used, well does it need to be?

As I understand it, in Windows the command line is just a string (as
returned by GetCommandLine), and it is broken up into things like argv as a
covenience by the C stdlib, Java, or whatever else.

Wondering if you could just grab the raw command line and parse the command
line yourself to avoid the user having to add backslashes everywhere?

On Fri, 3 Aug 2018, 17:42 Alex Miller  Hi Fredrick,
>
> I am working on a Powershell port and Windows install for Clojure and clj
> and I hate to have your out there as a non-official but identically named
> set of things. Is there some way to make this less official looking and/or
> make it more obviously not the official one?
>
> Alex
>
>
> On Friday, August 3, 2018 at 11:36:09 AM UTC-5, frericksm wrote:
>>
>> Hi,
>> long demanded - at least by myself -  i put together the missing
>> installer for clojure and cli for windows 10.
>>
>> URL: https://github.com/frericksm/clj-windows/releases/tag/v1.0-alpha
>> 
>>
>>
>>
>>
>> --
> 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 be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: read-line is limited to 4095 chars

2017-09-26 Thread David Powell
I'm not experiencing this on Windows...  Could it be that your
terminal or tooling is limiting the input to 4096 characters?

On Tue, Sep 26, 2017 at 2:20 PM, Alex Miller  wrote:
> Please file a jira enhancement. Changes could include updating the doc
> string, or adding a new arity to read-line that takes a size and passes it
> through to the buffered reader.
>
>
> On Tuesday, September 26, 2017 at 6:28:26 AM UTC-5,
> baptiste.fonta...@oscaro.com wrote:
>>
>> Hello there,
>>
>> I was using read-line to read a large line and found it limits its input
>> to 4095 chars. I tested this on both Clojure 1.8.0 and 1.9.0-beta1.
>>
>> Steps to reproduce:
>>
>> $ lein new foo
>> $ cd foo
>> $ lein repl
>> ...
>> => (count (read-line))
>>
>> Then enter a line that’s longer than 4095 characters; I used 8000 a's.
>>
>> Expected output:
>>
>> 8000
>>
>> Actual output:
>>
>> 4095
>>
>> No matter the real length of your input, it’ll always be truncated to 4095
>> chars if it’s longer.
>>
>> This is not in the documentation so I assume it’s either an implementation
>> bug or a documentation miss. I wanted to know which one it is before trying
>> to fix it.
>>
>> I’ve done some research and it appears to be a limitation of the
>> BufferedReader’s readLine method that uses a buffer of either 4k or 8k
>> depending on the implementation. Should we (1) work around this limit in the
>> code so that read-line does actually read a whole line or (2) just update
>> the documentation to note this limit?
>>
>> Thanks,
>>
>> -- Baptiste Fontaine
>
> --
> 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 be patient with your
> first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
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 be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Get Lein to run 32-bit JVM on Windows

2016-07-05 Thread David Powell
I think you need to set LEIN_JAVA_CMD to affect the jvm actually used to
start leiningen itself.

On Tue, Jul 5, 2016 at 9:35 AM, JvJ  wrote:

> Is it possible to configure Leiningen to run a 32-bit JVM by default?
> I've already tried changing the LEIN_CMD and JAVA_HOME to the x86
> executable paths, but it still runs the amd64 JVM.
>
> Any tips?  I'm doing this for overtone, since it doesn't support amd64 on
> Windows.
>
> --
> 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 be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ANN] Clojure 1.9.0-alpha5

2016-06-08 Thread David Powell
Do uri? and bytes? really have generator support implemented?  I couldn't
seem to get that to work.

-- 
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 be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Using map inc fails on windows

2016-01-11 Thread David Powell
this doesn't happen for me, it looks like you have something weird going on
with your environment.

how are you starting your repl?

what does (clojure-version) return?

has map somehow been redefined?  is your namespace importing something that
clobbers map?  does (doc map) print the standard docs for that function?


On Mon, Jan 11, 2016 at 5:08 PM, Igwe Ogba  wrote:

>
>
> 
> Hello. I'm still a Clojure newbie and had a bit of code return what seems
> to be the wrong value.
>
>
>
> 
> After typing in (map inc [1 2 3 4]) I would expect to get [2 3 4 5].
> However my Clojure repl returns [1 2 3 4]. This is happening on windows.
> I've included a screenshot as well. Is this sort of behaviour (where the
> wrong answer appears) normal in Clojure and are there any implications for
> real time code?
>
> --
> 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 be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Need help setting up Emacs for Clojure on Windows 8

2015-10-26 Thread David Powell
(There shouldn't actually be any problem using ~ from within emacs in
Windows though - emacs will automatically handle it - I do it all the
time.  It is probably related to emacs using
"C:\Users\jason\AppData\Roaming" as its home directory though.)

On Mon, Oct 26, 2015 at 6:09 PM, Daniel Higginbotham 
wrote:
>
> Sorry you're having trouble! Does this help?
https://www.reddit.com/r/Clojure/comments/3pn3fo/clojure_for_the_brave_and_true_updated_to_match/cw8h8qy
>

-- 
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 be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Libraries for dealing with DNS

2015-10-19 Thread David Powell
I've not used it, but Java comes with a DNS provider for JNDI too:

https://docs.oracle.com/javase/8/docs/technotes/guides/jndi/jndi-dns.html



On Mon, Oct 19, 2015 at 12:50 PM, Pierre-Yves Ritschard 
wrote:

> Hi Kyle,
>
> If you don't mind synchronous queries, "InetAddress/getByName" will do the
> job just fine and use your system resolving parameters.
> http://docs.oracle.com/javase/6/docs/api/index.html?java/net/InetAddress.html#getByName
>
> Cheers,
>   - pyr
>
> On Mon, Oct 19, 2015 at 9:56 AM, JvJ  wrote:
>
>> DNS clients happen to be my job.  If you can't find one, maybe I'll
>> conttibute to something.
>>
>> --
>> 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 be patient with
>> your first post.
>> To unsubscribe from this group, send email to
>> clojure+unsubscr...@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/clojure?hl=en
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "Clojure" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to clojure+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> 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 be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: procrun - banging my head!

2015-07-20 Thread David Powell
Running the .exe directly from a console window might help, as it will show
you any errors as console output.

I use a similar set up, but pass the parameters on the command-line rather
than via environment variables.  I set StartMode=jvm,
StartClass=com.example.Start, and leave StartMethod unset (so it just calls
-main).

Try and see if you can get it working with a Java class first maybe?  If
that works confirm that your jar is an uberjar and contains the expected
class file.

(Note that I did have issues with the Stop mechanism - it didn't seem to
run in the same classloader, so I had to use a small Java stub to stop the
service using a special HTTP request)


On Mon, Jul 20, 2015 at 12:54 PM, Colin Yates colin.ya...@gmail.com wrote:

 Hi all,

 I am trying to get my Clojure app deployable on Windows using procrun, and
 I am running into a brick wall.

 I can install the service, but when I start it I get an error: Windows
 could not start the ... on Local Computer. For more information, review the
 System Event Log... The System Event Log has an Error but absolutely no
 useful information.

 Any suggestions welcome!

 My procure configuration is:

 --- start
 REM user configuration below
 set INST_DIR=c:\test

 REM  DO NOT MODIFY 
 REM Dist layout
 set SERVICE_NAME=MyTestService
 set PR_INSTALL=%INST_DIR%\dist\prunsrv.exe
 set LOGS_DIR=%INST_DIR%\logs

 REM Service log configuration
 set PR_LOGPREFIX=%SERVICE_NAME%
 set PR_LOGPATH=%LOGS_DIR%
 set PR_STDOUTPUT=%LOGS_DIR%\stdout.txt
 set PR_STDERROR=%LOGS_DIR%\stderr.txt
 set PR_LOGLEVEL=Info

 REM Path to java installation
 set PR_CLASSPATH=%INST_DIR%/dist/my.jar

 REM Startup configuration
 set PR_STARTUP=manual
 set PR_STARTMODE=auto
 set PR_STARTCLASS=test.prod
 set PR_STARTMETHOD=startSystem

 REM Shutdown configuration
 set PR_STOPMODE=auto
 set PR_STOPCLASS=test.prod
 set PR_STOPMETHOD=stopSystem

 REM JVM configuration
 set PR_JVMMS=256
 set PR_JVMMX=1024
 set PR_JVMSS=4000

 REM Install service
 %INST_DIR%/dist/prunsrv.exe //US//%SERVICE_NAME%

 --- end

 My test.prod class:

 --- start
 (ns test
   (:require [environ.core :as env]
 [test.systems :refer [core-system]]
 [com.stuartsierra.component :as component]
 [util.heartbeat :as heartbeat])
   (:gen-class
:methods [^{:static true} [startSystem [[Ljava.lang.String;] void]
  ^{:static true} [stopSystem [[Ljava.lang.String;] void]]))

 (def db {:subprotocol jtds:sqlserver
  :subname (env/env :database-subname)
  :user(env/env :database-user)
  :password(env/env :database-password)})

 (def system (core-system db))

 (defn -startSystem [ args]
   (println Starting system.)
   (alter-var-root #'system component/start)
   (let [heartbeat-listener-registry (:heartbeat-listener-registry system)]
 (heartbeat/start heartbeat-listener-registry))
   (println System started.))

 (defn -stopSystem [ args]
   (println Stopping system.)
   (alter-var-root #'system component/stop)
   (println System stopped.))

 (defn -main [ args]
   (let [arg (first args)]
 (if (= stop arg)
   (-startSystem)
   (-stopSystem
 --- end


  --
 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 be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en
 ---
 You received this message because you are subscribed to the Google Groups
 Clojure group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


-- 
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 be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: clojure don't support .clj source code file by utf-8.

2015-07-13 Thread David Powell
On Mon, Jul 13, 2015 at 2:52 PM, Luc Préfontaine 
lprefonta...@softaddicts.ca wrote:

 BG is right on it. I hit this problem a decade ago (roughly :)).
 UTF-8 files with no BOM are not handled properly on windows.
 It assumes that they are ASCII coded. That works partially (both character
 sets have the same
 encoding for many characters) but eventually fails.


 Make sure that the files have a BOM. You can do this on a per file basis
 using an IDE
 (Eclipse, ...) or if you can use bash scripts to do this if you have
 access to a u*x environment.
 I did not find an equivalent native windows tool but they might be some to
 do this in batch.

 Luc P.


Clojure source files are expected to be in UTF-8 and Clojure on Windows
doesn't require a BOM.

In fact, Clojure files must not contain a BOM because it isn't considered
to be whitespace by the clojure parser and will cause the error Unable to
resolve symbol: ? in this context.

Some software, such as Windows notepad uses the presence of a BOM to detect
UTF-8, but that can be overridden in the File | Open dialog.  Other than
that, the behaviour of the BOM on Clojure between Linux and Windows should
be the same - this stuff is all handled by Java code in the JDK - not by
the Windows platform.

-- 
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 be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: clojure don't support .clj source code file by utf-8.

2015-07-13 Thread David Powell
 * On Notepad++ went to the Encoding menu and selected Encoding in UTF-8
 w/o BOM. Saved the file. When running lein run on the cmd.exe console it
 works but it outputs garbage instead of any non-ascii character (see
 http://i.imgur.com/H0rngyq.png)


This is as expected.
Garbage characters are output because *out* is bound to the platform
default encoding.  The platform default encoding will never be UTF-8 on
Windows - it is likely to be something like Windows-1252, which is
incapable of encoding those characters.

* To trigger the compilation error, change the encoding of the file in
 Notepad++ to Encoding in UTF-8. Save the file. When running lein run
 this time it will not compile and complains about being unable to resolve a
 symbol (see http://i.imgur.com/3SHegTH.png) ... however, if you type the
 contents of the file in the cmd.exe console (with type
 src\utf8test\core.clj) you'll see there's some extra garbage chars before
 the namespace declaration.


This is because the BOM is not a valid character in the Clojure syntax.
Perhaps it would be a reasonable enhancement for Clojure to treat the BOM
as whitespace.

-- 
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 be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Advice when running java -jar rather than a managed server like tomcat?

2015-05-26 Thread David Powell
I use procrun as a service wrapper on Windows.
https://commons.apache.org/proper/commons-daemon/procrun.html
It is configured by the command-line used to install it, and generally
works with little fuss.

I use InnoSetup to create a windows installer.
For the runtime class path, I just use something like, java -cp
conf;myuberjar.jar mypackage.main


On Tue, May 26, 2015 at 12:38 PM, Colin Yates colin.ya...@gmail.com wrote:

 Hi,

 I am venturing into new territory using http-kit, as I usually use a
 'managed' web server container like tomcat and have a few questions about
 packing and running a JAR file:

  - are there are convenient service wrappers for windows and/or Linux
  - any best practice around managing class path for things like logback.xml

 I have a jar created from lein uberjar and java -jar the.jar works, but
 this seems a long way away from automated deployment :).

 Any advice welcome - thanks!

 --
 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 be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en
 ---
 You received this message because you are subscribed to the Google Groups
 Clojure group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


-- 
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 be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Memoize in the real world

2014-12-09 Thread David Powell
If you want to use memoize, then the clojure.core.memoize provides a more
tunable version, which supports clearing the cache if required.
https://github.com/clojure/core.memoize/blob/master/docs/Using.md

-- 
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 be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Demoralising experience trying to install on Win 7

2014-10-25 Thread David Powell
Hi,

I wrote the leiningen installer for Windows.  It was working.
It simply downloads lein.bat from Leinignen stable, and provides a working
wget, and configures things.

I'm not sure what is going on, but for some reason call was added in
certain places in the bat file in 2.5.0, and this seems to have broken
everything?



On Sat, Oct 25, 2014 at 10:23 PM, Herwig Hochleitner hhochleit...@gmail.com
 wrote:

 I'd like to chime in with my view on the experiences, that clojure and
 haskell provide, respectively, if only to highlight some of the upshots.

 Clojure has been staying very true to its perception as a hosted
 language. This caters to my needs very well, because I've found in every
 real project, that I eventually had to take control of the enviroment, that
 my programs run in.
 Of course, this also means that during setup, I tend to get exposure to
 intermediate steps, configuration choices and possibly confusing initial
 results.
 Leiningen does an amazing job at providing a stable, well defaulted, yet
 configurable (dare I say 'canonical') platform to host clojure in (unless
 it fails during bootstrap ;-) and it's a testament to the aptitude of its
 maintainers, as well as clojure's, that it's possible to maintain leiningen
 in this quality with such loose coupling to clojure itself _and_ such
 minimal breakage during updates.

 I think the philosophy of haskell is not that different. It has been
 self-hosted for some time, but it's core is also very transparent and clean.
 Coming from clojure, I circumvented haskell-platform (also due to its
 outdated packages at the time) and jumped straight to developing with
 cabal, leiningen-style. An experience, that made me ever so slightly more
 grateful for leiningen and by extension, maven.
 Haskell Platform sure is a very comforting one-click solution to get set
 up and it has this officially sanctioned flavor to it. To this end, I'm
 keen on any developments, that Alex might spark at Cognitect.

 kind regards
 ​

 --
 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 be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en
 ---
 You received this message because you are subscribed to the Google Groups
 Clojure group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


-- 
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 be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How do I track down a painfully long pause in a small web app?

2014-09-15 Thread David Powell
Use the jvisualvm tool that comes with the jdk- you should be able to
connect to the clojure process.

Looking at the memory usage graphs, and if the heap size is banging against
the max heap size, then you might just be using too small a heap size - try
upping it.

You can also install the visualgc plugin for jvisualvm to get more info on
timings.


Alternatively go to the Threads pane, and click Thread Dump during the 30
second pause - you should be able to confirm what actual code is running at
this point, which might give a clue to what is going on.


If you have a memory leak, the Heap Dump button on the Monitor tab lets you
interactively explore all memory in the jvm.  If there is a lot of
something, that might be the thing that is leaking.



On Mon, Sep 15, 2014 at 7:55 AM, François Rey fmj...@gmail.com wrote:

 GC would be the first suspect, but then it could also be combined with a
 swap issue, or a JVM bug.
 Have a look at this article, which ends with a concrete list of things to
 do:
 https://blogs.oracle.com/poonam/entry/troubleshooting_long_gc_pauses


 --
 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 be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en
 --- You received this message because you are subscribed to the Google
 Groups Clojure group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


-- 
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 be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Presentation about Clojure

2014-08-21 Thread David Powell
For me the most practical benefit of Clojure is how easy it makes
combining, transforming, and processing data from various sources.
Just as SQL is better for querying a relational database than writing
a load of imperative for-loops; Clojure's functional transformations
of immutable data are far more productive, concise, and reusable than
writing the equivalent imperative code in your application.


On Thu, Aug 21, 2014 at 11:06 AM, Cecil Westerhof
cldwester...@gmail.com wrote:
 I am far from an expert on Clojure, but I am thinking about giving a talk
 about it on an Open Source event.

 Any tips about what to treat and what not to treat?

 I will have about 45 minutes.

 --
 Cecil Westerhof

 --
 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 be patient with your
 first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en
 ---
 You received this message because you are subscribed to the Google Groups
 Clojure group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.

-- 
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 be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Clojure production environment

2014-08-20 Thread David Powell
 Wait... some people *don't* run everything on linux? o_O

[raises hand]

embedded jetty + lein uberjar + lein libdir + windows + commons procrun

-- 
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 be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Clojure production environment

2014-08-20 Thread David Powell
Nah, everything works pretty awesomely.
The only minor issue I can think of is enlive template reloading not
working properly out of the box.
Clojurescript and Lein have had some Windows issues in the distant
past, but they are fine now.

90% of past issues have been caused by some code somewhere converting
between file:// URLs and filesystem paths in some dodgy way.  (Paths
with spaces in aren't an edge-case on Windows)

On Wed, Aug 20, 2014 at 12:24 PM, Bruce Durling b...@otfrom.com wrote:
 David,

 You are a braver man than me. ;-)

 Do you encounter any windows only issues?

 cheers,
 Bruce

 On Wed, Aug 20, 2014 at 12:12 PM, David Powell djpow...@djpowell.net wrote:
 Wait... some people *don't* run everything on linux? o_O

 [raises hand]

 embedded jetty + lein uberjar + lein libdir + windows + commons procrun

 --
 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 be patient with your 
 first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en
 ---
 You received this message because you are subscribed to the Google Groups 
 Clojure group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.



 --
 @otfrom | CTO  co-founder @MastodonC | mastodonc.com
 See recent coverage of us in the Economist http://econ.st/WeTd2i and
 the Financial Times http://on.ft.com/T154BA

 --
 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 be patient with your 
 first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en
 ---
 You received this message because you are subscribed to the Google Groups 
 Clojure group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.

-- 
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 be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: clojurescript introduction

2014-07-31 Thread David Powell
For the absolute basics, you could try:
http://swannodette.github.io/2013/10/27/the-essence-of-clojurescript/

On Thu, Jul 31, 2014 at 11:27 AM, Paweł Rozynek pro...@gmail.com wrote:
 hi

 is there something similar to http://clojurescriptone.com/ that actually
 works? unfortunately one is failing on 3rd command from tutorial which is
 'lein bootstrap'.
 id appreciate some good learning materials suggestions for clojurescript.

 regards
 PR

 --
 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 be patient with your
 first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en
 ---
 You received this message because you are subscribed to the Google Groups
 Clojure group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.

-- 
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 be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Is Korma still a good current choice for DB backend?

2014-07-23 Thread David Powell
I'm using honeysql for constructing dynamic queries (eg conditionally
adding complex clauses).  It feels a bit more composable to me, and seemed
much easier to add the OR of several clauses to a query etc.



On Tue, Jul 22, 2014 at 1:28 PM, Michael Klishin 
michael.s.klis...@gmail.com wrote:

 On 22 July 2014 at 16:10:31, Jonathon McKitrick (jmckitr...@gmail.com)
 wrote:
   Development and support seem to have slowed down. Are there
  newer or better choices out there with momentum right now?

 Just use clojure.jdbc or clojure.java.jdbc with a validation library
 (Validateur,
 Schema, Bouncer,  etc).

 There is no rush to use the newest hotness in the Clojure community so
 Korma
 should work OK if that's what you want.
 --
 @michaelklishin, github.com/michaelklishin

 --
 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 be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en
 ---
 You received this message because you are subscribed to the Google Groups
 Clojure group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


-- 
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 be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ANN] Leiningen 2.4.0

2014-06-10 Thread David Powell
I'm getting a 403 error on
https://leiningen.s3.amazonaws.com/downloads/leiningen-2.4.0-standalone.jar
when I run lein upgrade...
Is this just me?


On Tue, Jun 10, 2014 at 3:31 PM, Sun Ning classicn...@gmail.com wrote:

 I have been using lein-release (https://github.com/
 relaynetwork/lein-release) for a while. It's surely nice to see this
 feature built into core.


 On Tue 10 Jun 2014 06:11:06 PM CST, Atamert Ölçgen wrote:

 Thanks for bringing deploy-repositories to my attention, I didn't know
 it was there.



 On Tue, Jun 10, 2014 at 5:22 AM, Phil Hagelberg p...@hagelb.org
 mailto:p...@hagelb.org wrote:


 Greetings!

 I'm pleased to announce the release of Leiningen 2.4.0, our most
 significant release in quite some time. The star of the show is
 the new
 `release` task, which can automate all the common steps behind the
 release of a new version of a library.

 The idea is that `lein release` will run a series of tasks you've
 specified as release steps. This defaults to running the equivalent of
 these commands:

 * lein vcs assert-committed
 * lein change version leiningen.release/bump-version release
 * lein vcs commit
 * lein vcs tag
 * lein deploy
 * lein change version leiningen.release/bump-version patch
 * lein vcs commit
 * lein vcs push

 The `vcs` and `change` tasks are also new. The `vcs` subtasks
 above are
 self-explanatory, but the `change` task allows for programmatic
 modification of any given key in defproject using an arbitrary
 function,
 without altering formatting or comments. Out of the box we ship a
 function to bump version numbers, but you can call functions from
 plugins, and we hope to add more built-in functions in future
 releases.

 Note that the release task runs `lein deploy` rather than `lein deploy
 clojars`; this is in order to prevent accidental deploys of private
 artifacts to Clojars. In order to deploy an open source library to
 Clojars it's necessary to add `:deploy-repositories {releases
 :clojars}`
 to your project.clj file.

 Other highlights include fixes to the search task to report index
 download progress, improved multi-field queries, and the default
 to make
 useful uberjars even when not AOTing a -main function.

 A full list of significant changes:

 * Allow aliases to splice in values from the project map. (Phil
 Hagelberg)
 * Allow plugins to override built-in tasks. (Phil Hagelberg)
 * Add `release` task for automating common release steps. (Wayne
 Warren, Chris Truter, Phil Hagelberg)
 * Add `change` task for programmatc `project.clj` manipulation.
 (Chris Truter, Max Barnash)
 * Abort when `defproject` contains duplicate keys. (Peter Garbers)
 * Add `vcs` task to automate version control. (Phil Hagelberg,
 Wayne Warren)
 * Automatically `clean` before `deploy` to avoid AOT in libraries.
 (Phil Hagelberg)
 * Emit warnings to stderr. (Andy Chambers)
 * Use `clojure.main` for uberjars that don't declare their own
 `:main`. (Phil Hagelberg)
 * Allow templates to load from `:plugin-repositories`. (Phil
 Hagelberg)
 * Fix a race condition on printing during dependency resolution.
 (Phil Hagelberg)
 * Allow `new` templates to operate on existing directories with
 `--force` option. (Matthew Blair)
 * Fix `search` task to allow queries on multiple fields. (Colin Jones)
 * Fix a bug where errors in `run` task were mis-reported. (Gary
 Fredericks)
 * Report download progress of search indices. (Matthew Blair)
 * Protection from harmful `:clean-targets` settings. (Craig McDaniel)
 * Faster loading of help text. (David Grayson, Ryan Mulligan)
 * Add `LEIN_SILENT` option to suppress `*info*` output. (Phil
 Hagelberg)

 As usual, for those who manually installed `lein upgrade` will pull in
 the latest, and `lein upgrade 2.3.4` will back it down to the previous
 version if you run into any issues.

 Thanks to all the contributors who made this happen!

 -Phil

 ps. The Clojars artifacts for this release are still pending
 investigation of some deploy issues, but they should be right
 around the
 corner.






 --
 Kind Regards,
 Atamert Ölçgen

 -+-
 --+
 +++

 www.muhuk.com http://www.muhuk.com


 --
 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 be patient
 with your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en
 ---
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To unsubscribe from this group and stop receiving emails 

Re: Experiencing extremely slow performance on raspberry pi (model b)

2014-05-12 Thread David Powell
Yeah I had similar issues.  I guess the standard JDK is a bit a heavyweight
for the raspberry pi.

I wonder if clojurescript on nodejs might be an easier route?


On Mon, May 12, 2014 at 10:40 AM, C K Kashyap ckkash...@gmail.com wrote:

 Hi,

 I finally got my robotic vehicle working using raspberry pi. I was hoping
 to make it do tricks using the clojure repl - however, I found that repl
 took well over 2 minutes to start. Is that normal or are folks seeing
 better performance?

 Regards,
 Kashyap

 --
 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 be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en
 ---
 You received this message because you are subscribed to the Google Groups
 Clojure group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


-- 
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 be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: determining repl environment vs. uberjar environment?

2014-05-08 Thread David Powell
There are some hacky possibilities - eg testing for *1, but I don't think
there is a definitive way; there are many repls too (the clojure.main repl,
lein repl, lighttable), and a technique might not work on all of them.

Probably best to have some helper function you call from the repl, and have
that return the status code.  Then make your -main call that, followed by
System/exit with the return value.




On Thu, May 8, 2014 at 2:23 PM, Dave Tenny dave.te...@gmail.com wrote:

 When running as an uberjar, i.e. java -jar myapp.jar [args]
 the return code of the process to the shell is very important.
 System/exit is how that return code is sent.


 On Thu, May 8, 2014 at 9:20 AM, James Reeves ja...@booleanknot.comwrote:

 Having your application call System/exit directly is often indicative of
 some unnecessary coupling in your code.

 Under what circumstances does your application need to exit?

 - James


 On 22 April 2014 17:59, Dave Tenny dave.te...@gmail.com wrote:

 I have an app I'm building.  It calls System/exit.  That doesn't works
 so well if I'm debugging in the REPL however.

 What's the preferred method of determining whether I'm in REPL mode
 interaction vs running as a standalone app?

 Also, long as I'm asking and being lazy, does the -main function return
 value translate to a System/exit value if it's numeric?
 Or is System/exit the way to go?

 --
 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 be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en
 ---
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To unsubscribe from this group and stop receiving emails from it, send
 an email to clojure+unsubscr...@googlegroups.com.

 For more options, visit https://groups.google.com/d/optout.


  --
 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 be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en
 ---
 You received this message because you are subscribed to a topic in the
 Google Groups Clojure group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/clojure/KZJQsmOeiHc/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to
 clojure+unsubscr...@googlegroups.com.

 For more options, visit https://groups.google.com/d/optout.


  --
 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 be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en
 ---
 You received this message because you are subscribed to the Google Groups
 Clojure group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


-- 
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 be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Update

2014-04-29 Thread David Powell
The JVM is very class-oriented.  It is basically designed for Java, and
corresponds pretty much to the things you can do in Java.  Code belongs to
methods which belong to classes, and calls are made using java method
calling conventions.  Data has to be stored in primitives, arrays, or
objects; and arrays aren't particularly to-the-metal in Java anyway.

The Byte Code Verifier keeps what you do fairly simple - eg you can't just
leave things in the stack and jump to another method.

Even if you wanted to do anything a bit different, the performance of the
JVM all comes from the assumptions made while executing the bytecodes at
runtime.  If you did anything very weird, you'd probably find that these
optimizations didn't kick in.



On Tue, Apr 29, 2014 at 9:25 AM, Divyansh Prakash 
divyanshprakas...@gmail.com wrote:

 Why are Clojure features defined in terms of Java classes, instead of as
 bytecode primitives?
 For eg: Cons is a class containing two objects: first and rest.
 Is this only to achieve Java interoperability, or is there more to it?

 --
 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 be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en
 ---
 You received this message because you are subscribed to the Google Groups
 Clojure group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


-- 
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 be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: dependencies from github

2014-03-27 Thread David Powell
If you checkout the package to checkouts/not-really-trusted-package, then
that version will automatically be used instead.
https://github.com/technomancy/leiningen/blob/master/doc/TUTORIAL.md#checkout-dependencies

-- 
Dave



On Thu, Mar 27, 2014 at 9:16 AM, t x txrev...@gmail.com wrote:

 Hi,

 ## Context:

   * I'm using lein.
   * In my project.clj, I have something like:

 :dependencies[ [org.clojure/clojure 1.5.1]
   [org.clojure/clojurescript 0.0.-2173]
   [not-really-trusted-package version]]

   Now, I don't like pulling not-really-trusted-package, which can
 change under me. Instead I'd prefer to:

   (1) git fork the not-really-trusted package to
 github/txrev319/not-really-trusted
   (2) have lein pull from github/txrev319/not-really-trusted

 ## Question:

   How do I achieve the above?

 Thanks!

 (I still don't trust the package, but atleast I want to use the same
 untrusted package every time.)

 --
 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 be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en
 ---
 You received this message because you are subscribed to the Google Groups
 Clojure group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


-- 
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 be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: dependencies from github

2014-03-27 Thread David Powell
On Thu, Mar 27, 2014 at 10:23 AM, David Powell d...@djpowell.net wrote:

 If you checkout the package to checkouts/not-really-trusted-package, then
 that version will automatically be used instead.

 https://github.com/technomancy/leiningen/blob/master/doc/TUTORIAL.md#checkout-dependencies


(Though this is intended more as a local developer convenience rather than
something that you would want to use in a public project.  A private
clojars build as Ray suggested above might be more appropriate)

-- 
Dave

-- 
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 be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: transient map bug?

2014-03-06 Thread David Powell
Something like this would work:

(persistent!
  (reduce
(fn [r x] (assoc! r x -))
(transient {})
(range 100)))


Which is just:

(reduce
  (fn [r x]
(assoc r x -))
  {}
  (range 100))

...but with transient applied to the input, and persistent! applied to the
output.





On Thu, Mar 6, 2014 at 2:49 PM, Andy Fingerhut andy.finger...@gmail.comwrote:

 What your code is doing is sometimes called bashing transients in
 place.  See some discussion here:
 http://clojuredocs.org/clojure_core/clojure.core/assoc!

 As explained there, you should always use the return value of assoc!, just
 as you would always use the return value of assoc.

 Andy


 On Thu, Mar 6, 2014 at 6:17 AM, Sergey Kupriyanov sku...@gmail.comwrote:

 Try to use transient map, but it has size limit to 8 keys.

 (let [hm (transient {})]
   (doseq [x (range 100)]
 (assoc! hm x -))
   (persistent! hm))

  {0 -, 1 -, 2 -, 3 -, 4 -, 5 -, 6 -, 7 -}

 What's wrong with my code?

 I think it is a bug.
 Transient map don't change type from PersistentArrayMap to
 PersistentHashMap.

  --
 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 be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en
 ---
 You received this message because you are subscribed to the Google Groups
 Clojure group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.


  --
 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 be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en
 ---
 You received this message because you are subscribed to the Google Groups
 Clojure group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.


-- 
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 be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: map and lazy sequence

2014-02-28 Thread David Powell
Not everything is chunked, but data-structures like vectors produce
chunked-seqs.


On Fri, Feb 28, 2014 at 5:06 PM, Jim - FooBar(); jimpil1...@gmail.comwrote:

 Clojure works on a chunked basis for performance reasons...THe size of a
 chunk is 32 elements - thus you would actually get 32 printouts if you
 supplied a collection larger than 31 elements.

 Jim



 On 28/02/14 17:04, Andy Smith wrote:

 Hi,

 Can someone correct my misunderstanding here. I was lead to believe that
 map produced a lazy sequence, so why do I get three printed trace lines in
 the following code :

 user= (take 1 (map #(do (println (str trace: %)) %) [1 2 3]))
 (trace:1
 trace:2
 trace:3
 1)

 Thanks for your help

 Andy
 --
 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 be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en
 ---
 You received this message because you are subscribed to the Google Groups
 Clojure group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.


 --
 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 be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en
 --- You received this message because you are subscribed to the Google
 Groups Clojure group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.


-- 
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 be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: IE compatibility of clojurescript, Element undefined problem

2013-12-16 Thread David Powell
The clojure.browser namespace does try to extend a protocol to js/EventType
- which IE6 doesn't have, but if you use third party alternatives, raw
javascript DOM manipulation, or Google Closure, then things should work in
IE6.


On Mon, Dec 16, 2013 at 12:59 PM, Xiangtao Zhou tao...@gmail.com wrote:

 hi all,

 I'm new for clojurescript.  I found there is compatibility problem under
 IE6,  closurescript use Element which IE 6 dos not have.

 Line 34266, Element.prototype.clojure$browser$event$EventType$ = true;

 Is clojurescript give up IE6?


 Joe

  --
 --
 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 be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en
 ---
 You received this message because you are subscribed to the Google Groups
 Clojure group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.


-- 
-- 
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 be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [ClojureScript] Re: Next ClojureScript Release: 1 more ticket

2013-11-20 Thread David Powell
It still isn't working on Windows.

At
https://github.com/clojure/clojurescript/blob/047dbb3d2bd7c3a2e00805ec2f2480e449451521/src/clj/cljs/closure.clj#L750

path is either a file:// url or something
like: /C:/Temp/cstest2/out/cljs/core.js - which is a bit mangled, and is
caused by calling .getPath on a file URL.

But (keys (::comp/compiled-cljs @env/*compiler*)) are absolute File paths
with backslashes, eg C:\Temp\cstest2\out\cljs\core.js


I think calling .getPath on a file:// URL or URI might be questionable
unless you are going to carefully relativize it before you do anything with
it.


Also note that the changes on master use java.io.File.toPath() which
requires Java 7.


We should probably check that everything works with paths with spaces in
too.  Whatever process converts files to urls needs to know to apply url
escaping.

-- 
-- 
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 be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [ClojureScript] Re: Next ClojureScript Release: 1 more ticket

2013-11-20 Thread David Powell
I think a good approach might be to:

Keep everything as file:// urls given that we need to use urls anyway
for.jar references.

Never call .getPath on a URI / URL - it undoes the URL escaping that we
want, and it returns weird /c:/ things on Windows that don't work as
anything.

Write our own URL relativizer that works on file url's and can cope with
urls where result starts with ../ rather than falling back to an absolute
url  as Java's methods do.

-- 
-- 
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 be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: running command when lein repl starts

2013-11-19 Thread David Powell
Hmm, maybe you need to use this:
https://github.com/technomancy/leiningen/blob/master/sample.project.clj#L209

-- 
Dave



On Tue, Nov 19, 2013 at 5:51 PM, Andy Smith the4thamig...@googlemail.comwrote:

 Ok valid point, but I still get the same kind of errors?

  --
 --
 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 be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en
 ---
 You received this message because you are subscribed to the Google Groups
 Clojure group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.


-- 
-- 
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 be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: running command when lein repl starts

2013-11-19 Thread David Powell
Hmm, no it is just a syntax thing with your project, This works:

(defproject test 1.0.0-SNAPSHOT
  :description FIXME: write description
  :dependencies [[org.clojure/clojure 1.5.1]
 [org.clojure/math.numeric-tower 0.0.2]]
  :repl-options {:init (use 'clojure.math.numeric-tower)}
)

You had closed the opening paren on the :dependencies line.  And
:dependencies isn't allowed inside :repl-options, which was causing the
org.clojure error.


-- 
Dave



On Tue, Nov 19, 2013 at 5:56 PM, David Powell djpow...@djpowell.net wrote:

 Hmm, maybe you need to use this:

 https://github.com/technomancy/leiningen/blob/master/sample.project.clj#L209

 --
 Dave



 On Tue, Nov 19, 2013 at 5:51 PM, Andy Smith 
 the4thamig...@googlemail.comwrote:

 Ok valid point, but I still get the same kind of errors?

  --
 --
 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 be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en
 ---
 You received this message because you are subscribed to the Google Groups
 Clojure group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
-- 
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 be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: running command when lein repl starts

2013-11-19 Thread David Powell
I tend to work on files in emacs or an IDE, with a linked repl, rather than
at a raw repl, so the file I'm working on will tend to have an ns directive
that will require the appropriate namespaces, so I just eval that when I
open the file.



On Tue, Nov 19, 2013 at 6:05 PM, Andy Smith the4thamig...@googlemail.comwrote:

 yes, Ive seen that but it doesnt seem to help me greatly. Just out of
 curiosity how do you generally setup your repl so it already includes these
 kind of common libraries? I dont really want to be typing lots of 'use'
 commands into the repl every time i start it. Is using leiningen the wrong
 way to do this?

 --
 --
 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 be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en
 ---
 You received this message because you are subscribed to the Google Groups
 Clojure group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.


-- 
-- 
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 be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Request for help optimising a Clojure program

2013-10-23 Thread David Powell
When you say it is spending 99% of its time in PersistentHashSet.cons, is
that the time spent in just that method, or the time spent in that method
and the methods that it calls?

Given that (set ...) is one of the first things called by (solve..), and
that its contents are produced lazily by a for comprehension, if you are
looking at the total time spent in PersistentHashSet.assoc, then maybe that
will be particularly slow.  Not that that solves the problem, but I was
wondering if PersistentHashSet.assoc might be a red herring.

Also, out of interest, are you using a sampling profiler, or an
instrumenting one?


Sometimes the built-in hprof profiler is good for this sort of thing:

java -Xrunhprof:cpu=times,depth=4 -Xmx2g -jar
target\chess-clojure-0.1.0-SNAPSHOT-standalone.jar

  - you can use either cpu=times for instrumenting, or cpu=samples for
sampling.

It is nice because the depth parameter lets you find hotspots including a
few steps up the stacktrace (4 in this case).  And you can use Ctrl-\ /
Ctrl-Break / SIG_QUIT to get it to dump the current stats while the program
is still running to see if some methods are getting worse over time.




On Wed, Oct 23, 2013 at 1:36 PM, Paul Butcher p...@paulbutcher.com wrote:

 On 23 Oct 2013, at 13:18, Timothy Baldridge tbaldri...@gmail.com wrote:

 Great! you have a profiler, use that. Find the hotspots, use YourKit to
 find where the .cons is being called from, find things to optimize, and go
 from there. This is exactly the same process I would use any optimizations
 I attempted.


 I fear I may have failed to convey the question I'm trying to answer.

 I'm sure that I could create a faster solution in Clojure - that's not the
 question I'm trying to answer though.

 What I'm trying to answer is why the *exact same* algorithm implemented in
 Scala is 1000x faster.

 As far as I know, the Scala version of the algorithm creates exactly as
 many sets and performs exactly as many set operations as the Clojure does.
 But the Clojure version is 1000x slower. That strikes me as very strange
 and worth getting to the bottom of?

 I have, of course, looked at the result of the profiler. And what it seems
 to be saying is that set operations in Clojure are ruinously slow. I'm not
 sure that I believe that though - I can't think of any reason why Clojure's
 sets should be 1000x slower than Scala's? So I'm asking for the help of
 this list.

 Of course, I can't rule out the possibility that I've failed to convert
 the Scala version to Clojure and they're actually implementing very
 different algorithms - but I've had several people look at the
 implementations and confirm that they appear to be the same. Nevertheless,
 if there is a problem there, I'd also be interested to find it as I'm sure
 that it will teach me something.

 --
 paul.butcher-msgCount++

 Snetterton, Castle Combe, Cadwell Park...
 Who says I have a one track mind?

 http://www.paulbutcher.com/
 LinkedIn: http://www.linkedin.com/in/paulbutcher
 MSN: p...@paulbutcher.com
 AIM: paulrabutcher
 Skype: paulrabutcher

  --
 --
 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 be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en
 ---
 You received this message because you are subscribed to the Google Groups
 Clojure group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.


-- 
-- 
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 be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: finding retained head

2013-09-11 Thread David Powell
jvisualvm has an innocuous button called Dump Memory or something.
You'd expect it to write out a core dump or something, but actually it
opens up a GUI which lets you interactively explore all of the objects on
the heap.  It is pretty amazing.  Much better than jhat, which I've found
to be really flakey.

Good for finding Classloader leaks too, or just generally finding where all
your memory has gone via the Compute Retained Sizes option.

-- 
-- 
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 be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [ANN] Leiningen 2.3.2 released

2013-08-21 Thread David Powell
Have you tried http://leiningen-win-installer.djpowell.net/ - it should
work...

-- 
Dave



On Wed, Aug 21, 2013 at 6:13 AM, Sean Corfield seancorfi...@gmail.comwrote:

 Upgrading on Mac/Linux was painless as usual - and everything here
 seems to run fine with 2.3.2 - but Windows continues to be a pain in
 the rear...

 You can't lein upgrade so I updated the version string in lein.bat and
 tried lein self-install:

 C:\Users\Seanlein self-install
 Downloading Leiningen now...
 SYSTEM_WGETRC = c:/progra~1/wget/etc/wgetrc
 syswgetrc = C:\gow/etc/wgetrc
 --2013-08-20 22:01:41--

 https://cloud.github.com/downloads/technomancy/leiningen/leiningen-2.3.2-standalone.jar
 Resolving cloud.github.com... 54.240.188.252, 54.230.71.6, 54.230.70.21,
 ...
 Connecting to cloud.github.com|54.240.188.252|:443... connected.
 WARNING: cannot verify cloud.github.com's certificate, issued by
 `/C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert High Assurance
 CA-3':
   Self-signed certificate encountered.
 WARNING: certificate common name `*.cloudfront.net' doesn't match
 requested host name `cloud.github.com'.
 HTTP request sent, awaiting response... 403 Forbidden
 2013-08-20 22:01:41 ERROR 403: Forbidden.

 Failed to download

 https://cloud.github.com/downloads/technomancy/leiningen/leiningen-2.3.2-standalone.jar

 You can't download that file via a browser either:

 This XML file does not appear to have any style information associated
 with it. The document tree is shown below.
 Error
 CodeAccessDenied/Code
 MessageAccess Denied/Message
 RequestIdBBF8809DA1520371/RequestId
 HostId
 Laq6Bi6lZlah+zalsro6LbnHl2hKt0fDsZO1Tvu6spiEjq8CghIMHLDSwk7XTm+k
 /HostId
 /Error

 I have HTTP_CLIENT set to wget --no-check-certificate -O as a global
 environment variable.

 Is this just a problem upgrading from 2.1.3 that is - finally - going
 to be a thing of the past from now on, or is there still work to do?

 Sean


 On Tue, Aug 20, 2013 at 3:11 PM, Phil Hagelberg p...@hagelb.org wrote:
 
  Hello everybody.
 
  I'm happy to announce the release of Leiningen 2.3.2, a minor bugfix
  release over 2.3.1. Changes include the following:
 
  * Write `.nrepl-port` file for better tool interoperability. (Phil
 Hagelberg)
  * Support targeted upgrades in `lein.bat`. (Shantanu Kumar)
  * Warn when projects rely on implicit AOT of `:main`. (Phil Hagelberg)
  * Fix a bug where implicit AOT of `:main` was disabled. (Phil Hagelberg)
  * Disable profile isolation by default. Will be back in 3.x. (Phil
 Hagelberg)
 
  The biggest change here the disabling of profile isolation (a new by
  default due to incompatibilities with certain projects that hard-code
  paths. Profile isolation was a new feature in 2.3.0 described in the FAQ:
 
  Leiningen supports isolating different profiles by their target
  directory. Simply specify `:target-path target/%s` in order to have
  each profile set use a different directory for generated files. Then you
  can put your `:aot` settings in the `:uberjar` profiles, and the .class
  files created from the AOT process will not affect normal development
  use. You can specify the profile-isolated `:target-path` in your `:user`
  profile if you want it applied across all the projects you work on.
 
  I still recommend using profile isolation since it helps avoid a number
  of subtle gotchas around stale AOT files and user-level dependencies
  being visible with downstream consumers, but you now have to opt-in to
  this feature by setting :target-path as described above.
 
  We've also fixed a bug where setting :main without setting :aot would no
  longer implicitly compile the :main namespace. It's still recommended to
  be explicit about what :aot you need, (in the :uberjar profile if
  applicable) but the old behaviour has been restored.
 
  You'll also want to add a .gitignore entry for the new .nrepl-port file
  which we're using for improved cross-tool compatibility; discussion of
  that feature is here:
 https://github.com/technomancy/leiningen/issues/1296
 
  Thanks!
 
  -Phil



 --
 Sean A Corfield -- (904) 302-SEAN
 An Architect's View -- http://corfield.org/
 World Singles, LLC. -- http://worldsingles.com/

 Perfection is the enemy of the good.
 -- Gustave Flaubert, French realist novelist (1821-1880)

 --
 --
 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 be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en
 ---
 You received this message because you are subscribed to the Google Groups
 Clojure group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.


-- 
-- 

Re: [ANN] Leiningen 2.3.2 released

2013-08-21 Thread David Powell
On Wed, Aug 21, 2013 at 5:57 PM, Sean Corfield seancorfi...@gmail.comwrote:

 Does that work to upgrade an already installed version of Leiningen?


Not really.  But if you took your existing leiningen off the path, and ran
the installer it might get things up and running:
It bundles a wget with an appropriate ca file, downloads the latest stable
lein.bat, lets you select a JDK path from those available, and it ensures
that lein.bat is on the path.

-- 
Dave

-- 
-- 
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 be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Can we please deprecate the :use directive ?

2013-07-24 Thread David Powell
I usually :use clojure.pprint and clojure.repl.  Nobody was hurt.

For everything else, I use :require/as.

-- 
Dave



On Tue, Jul 23, 2013 at 7:27 PM, Gary Trakhman gary.trakh...@gmail.comwrote:

 We should scour clojuresphere for uses of 'use' and automatically post
 github issues to the projects of interest, and redefine the ns macro to
 issue a warning with use.

 Does anyone actually like 'use'?

 Require is always more evident.


 On Tue, Jul 23, 2013 at 2:17 PM, Jozef Wagner jozef.wag...@gmail.comwrote:

 +1, :use is IMO an antipattern.

 I hate it mainly in blogs, where they explain some new API. They :use
 like 3 namespaces and you have to guess which fn is from which ns :)

 JW


 On Tuesday, July 23, 2013 5:50:50 PM UTC+2, Greg Slepak wrote:

 I think I read somewhere that :use is no longer encouraged, but I could
 be mistaken.

 From what I've read, it seems like most people agree that Clojure has
 too many ways of including/importing/**referencing/requiring/using
 things:

 http://blog.8thlight.com/**colin-jones/2010/12/05/**
 clojure-libs-and-namespaces-**require-use-import-and-ns.htmlhttp://blog.8thlight.com/colin-jones/2010/12/05/clojure-libs-and-namespaces-require-use-import-and-ns.html

 The above gives a very nice explanation of all the various difference,
 but it also acknowledges their complexity.

 Since :use uses :require, and since :require can do everything that :use
 can, can we simplify Clojure programming a bit for newcomers by deprecating
 the use of :use? The situation in ClojureScript is even worse because it
 adds :require-macros on top of all the other ways of including files.

 Ideally, it would be awesome if there was just a single directive for
 everything, but perhaps there's some complicated low-level reason why
 that's not possible. :-\

 Thoughts?

 Thanks,
 Greg

 P.S. If this has already been brought up you have my sincere apologies.

 --
 Please do not email me anything that you are not comfortable also
 sharing with the NSA.

  --
 --
 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 be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en
 ---
 You received this message because you are subscribed to the Google Groups
 Clojure group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




  --
 --
 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 be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en
 ---
 You received this message because you are subscribed to the Google Groups
 Clojure group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
-- 
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 be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Functions that return seqs

2013-07-02 Thread David Powell
If you really need to write functions that are polymorphic on collections
type, then you can use the idiom:

(defn some-fn
  [xs]
  (into (empty xs)
...
  ))

But there is value in having the return type of a function to be
predictable.

-- 
Dave

-- 
-- 
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 be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [ANN] alpacas: a new Clojure source viewer

2013-06-05 Thread David Powell
Personally, I think there is too much guesswork involved in understanding
what the LGPL means re Java.

For example, from http://jtds.sourceforge.net/license.html, a Java library:

Using jTDS is considered to be dynamic linking; hence our interpretation of
 the LGPL is that the use of the unmodified jTDS source or binary does not
 affect the license of your application code.


The authors were kind enough to say what their interpretation of the
license is - most LGPL libraries don't; but what if you distribute an LGPL
library with an application as an uberjar - that may well be outside of
what is permitted - I don't know.  Is it outside the spirit of the 6b) of
the LGPL, which seems to be intended to allow the user to easily swap in
implementations.

It just seems easier to stick to EPL, especially if you want to allow
commercial use of the library.



On Wed, Jun 5, 2013 at 2:48 PM, John Gabriele jmg3...@gmail.com wrote:

 On Tuesday, June 4, 2013 4:24:49 PM UTC-4, Gary Trakhman wrote:

 Just fyi, most clojure libs are published under EPL or Apache licenses,
 of course the choice is up to you :-).  GPL has some restrictions that
 would prevent the lib from being used in many projects.

 from the EPL wikipedia page: 'The EPL 1.0 is not 
 compatiblehttp://en.wikipedia.org/wiki/License_compatibility with
 the GPL, and a work created by combining a work licensed under the GPL with
 a work licensed under the EPL cannot be lawfully distributed.'


 LGPL is also a fine choice for Clojure libs.

 -- John

  --
 --
 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 be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en
 ---
 You received this message because you are subscribed to the Google Groups
 Clojure group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
-- 
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 be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: is there a way to use clojure.main/repl from lein?

2013-05-27 Thread David Powell
The project.clj files in pedestal contain an alias definition:

:aliases {dumbrepl [trampoline run -m clojure.main/main]}

You could try something like that.

--
Dave


On Mon, May 27, 2013 at 6:48 PM, Stuart Halloway
stuart.hallo...@gmail.comwrote:

 I thought I wanted some of the affordances, but not the nrepl connection
 (e.g. get to reply's standalone eval mode).

 But it turns out that for my use case, I don't need any of that, so
 calling clojure.main directly is the right thing.

 Thanks,
 Stu


 On Mon, May 27, 2013 at 11:27 AM, Laurent PETIT 
 laurent.pe...@gmail.comwrote:

 Hello,

 What about

 lein run -m clojure.main

 ?


 2013/5/27 Stuart Halloway stuart.hallo...@gmail.com:
  As opposed to tools.nrepl?
 
  Thanks,
  Stu
 
  --
  --
  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 be patient with
 your
  first post.
  To unsubscribe from this group, send email to
  clojure+unsubscr...@googlegroups.com
  For more options, visit this group at
  http://groups.google.com/group/clojure?hl=en
  ---
  You received this message because you are subscribed to the Google
 Groups
  Clojure group.
  To unsubscribe from this group and stop receiving emails from it, send
 an
  email to clojure+unsubscr...@googlegroups.com.
  For more options, visit https://groups.google.com/groups/opt_out.
 
 

 --
 --
 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 be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en
 ---
 You received this message because you are subscribed to the Google Groups
 Clojure group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.



  --
 --
 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 be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en
 ---
 You received this message because you are subscribed to the Google Groups
 Clojure group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
-- 
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 be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [ANN] Instaparse 1.0.0

2013-04-13 Thread David Powell
Would it be possible to have an option to tag the parse tree with meta-data
indicating the character offset (or line  column)?

-- 
Dave

-- 
-- 
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 be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Leiningen exception when run inside a project

2013-04-10 Thread David Powell
Btw - I have created an installer for leiningen on Windows, that makes sure
that your JDK is set up properly.

http://leiningen-win-installer.djpowell.net


On Wed, Apr 10, 2013 at 10:30 AM, Dmytro Kozhukhar dkozhuk...@gmail.comwrote:

 SOLVED

 Just installed JDK instead of JRE and it works ok.


 On Wed, Apr 10, 2013 at 12:09 PM, Dmytro Kozhukhar 
 dkozhuk...@gmail.comwrote:

 It does not seem so, I tried this on new project, created with 'lein new
 app helloworld'
 it has source generated by lein in ./src/helloworld/core.clj :

 (ns helloworld.core
   (:gen-class))

 (defn -main
   I don't do a whole lot ... yet.
   [ args]
   ;; work around dangerous default behaviour in Clojure
   (alter-var-root #'*read-eval* (constantly false))
   (println Hello, World!))


 On Wednesday, April 10, 2013 12:02:04 PM UTC+3, Adam Clements wrote:

 Your project.clj probably has unmatched brackets, this error means it
 hit the end of a file it was reading while still scanning for a closing
 bracket.
 On 10 Apr 2013 09:22, Dmytro Kozhukhar dkozh...@gmail.com wrote:

 Hello everyclojurer!

 Today I have problem with installing lein on WinXP.

 Lein run just fine in any folder, except it is a folder with project.
 If I run 'lein repl' or 'lein run' then I get this error:

 D:\lein\helloworldlein run
 Exception in thread main clojure.lang.LispReader$**ReaderException:
 java.lang.Ru
 ntimeException: EOF while reading string
 at clojure.lang.LispReader.read(**LispReader.java:220)
 at clojure.core$read.invoke(core.**clj:3407)
 at clojure.core$read.invoke(core.**clj:3405)
 at clojure.main$eval_opt$fn__**6602.invoke(main.clj:306)
 at clojure.main$eval_opt.invoke(**main.clj:306)
 at clojure.main$initialize.**invoke(main.clj:327)
 at clojure.main$script_opt.**invoke(main.clj:353)
 at clojure.main$main.doInvoke(**main.clj:440)
 at clojure.lang.RestFn.invoke(**RestFn.java:619)
 at clojure.lang.Var.invoke(Var.**java:445)
 at clojure.lang.AFn.**applyToHelper(AFn.java:202)
 at clojure.lang.Var.applyTo(Var.**java:532)
 at clojure.main.main(main.java:**37)
 Caused by: java.lang.RuntimeException: EOF while reading string
 at clojure.lang.Util.**runtimeException(Util.java:**219)
 at clojure.lang.LispReader$**StringReader.invoke(**
 LispReader.java:461)
 at clojure.lang.LispReader.**readDelimitedList(LispReader.**
 java:1148)
 at clojure.lang.LispReader$**ListReader.invoke(LispReader.**
 java:982)
 at clojure.lang.LispReader.**readDelimitedList(LispReader.**
 java:1148)
 at clojure.lang.LispReader$**ListReader.invoke(LispReader.**
 java:982)
 at clojure.lang.LispReader.**readDelimitedList(LispReader.**
 java:1148)
 at clojure.lang.LispReader$**ListReader.invoke(LispReader.**
 java:982)
 at clojure.lang.LispReader.**readDelimitedList(LispReader.**
 java:1148)
 at clojure.lang.LispReader$**ListReader.invoke(LispReader.**
 java:982)
 at clojure.lang.LispReader.read(**LispReader.java:185)
 ... 12 more


 Any Ideas what goes wrong?

 --
 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clo...@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+u...@**googlegroups.com
 For more options, visit this group at
 http://groups.google.com/**group/clojure?hl=enhttp://groups.google.com/group/clojure?hl=en
 ---
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To unsubscribe from this group and stop receiving emails from it, send
 an email to clojure+u...@**googlegroups.com.
 For more options, visit 
 https://groups.google.com/**groups/opt_outhttps://groups.google.com/groups/opt_out
 .



  --
 --
 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 be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en
 ---
 You received this message because you are subscribed to a topic in the
 Google Groups Clojure group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/clojure/a7XppadjUzM/unsubscribe?hl=en.
 To unsubscribe from this group and all its topics, send an email to
 clojure+unsubscr...@googlegroups.com.

 For more options, visit https://groups.google.com/groups/opt_out.




  --
 --
 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 be patient with

Re: [ANN] Instaparse 1.0.0

2013-04-09 Thread David Powell
Looks awesome.

Would it be possible to plug in support for the ABNF[1] notation that the
IETF use?  Might be useful for implementing standards.  Mostly just a
different syntax for repetition, and has support for comments.

[1] http://www.rfc-editor.org/std/std68.txt

-- 
Dave

-- 
-- 
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 be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Disable undocumented #= reader macro to prevent unsafe code injection?

2013-04-09 Thread David Powell
On Tue, Apr 9, 2013 at 6:03 PM, rebcabin bc.beck...@gmail.com wrote:

 Hello -- I would like to use Clojure to build a safe code-remoting
 application for query injection (moving queries closer to the data for
 affinity and privacy). One alternative for this application is to read
 Clojure code from strings WITHOUT evaluating it, then analyze the presented
 code and / or eval it with a custom eval function in a sandbox. It's easier
 to do this in Clojure than in JavaScript because it's easier to write a
 custom eval in Clojure than in JavaScript.

 One problem with my plan is that the #= reader macro evaluates the code at
 read-time, before I have a chance to analyze or sandbox it. The workarounds
 seem to be disabling or removing the #= reader macro or writing my own
 custom reader (in addition to a custom evaluator).

 I'd be grateful for guidance and advice.


#= was an issue that was addressed in Clojure 1.5.  (Though you should use
1.5.1 which fixes a memory leak).

The read and read-string [1] functions have always been controllable by
setting *read-eval* [2] to nil or false to disable the eval-reader.
 However, in Clojure 1.4 and below, this still allowed execution of record
and class constructors, which probably isn't desired.
In Clojure 1.5.1 setting *read-eval* to nil or false should (I think)
disable all eval-on-read facilities.  (Though I'd get a second opinion on
that before relying on it)


Clojure 1.5.1 also brought the new clojure.edn [3] namespace, which provide
safe reading of clojure data structures as data, but doesn't support all of
the features of the reader that might be used in code.  For your usage, it
sounds like this might be unsuitable.

[1]
http://clojure.github.io/clojure/clojure.core-api.html#clojure.core/read-string
[2]
http://clojure.github.io/clojure/clojure.core-api.html#clojure.core/*read-eval*
[3] http://clojure.github.io/clojure/clojure.edn-api.html

-- 
-- 
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 be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Disable undocumented #= reader macro to prevent unsafe code injection?

2013-04-09 Thread David Powell
Also - take a look at:
https://github.com/flatland/clojail

-- 
Dave

-- 
-- 
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 be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Where is clojure.inspector namespace

2013-04-07 Thread David Powell
On Sun, Apr 7, 2013 at 10:36 AM, Josh Kamau joshnet2...@gmail.com wrote:


 I keep getting this :
 ClassNotFoundException clojure.inspector  java.net.URLClassLoader$1.run
 (URLClassLoader.java:366)

 when i try to do this :
  (clojure.inspector/inspect (range 10))

 Do i need to require/use or add any dependency ?


It is shipped with clojure.  clojure.inspector is the namespace name, so
you'll need to require that namespace before you can use it:

  (require 'clojure.inspector)
  (clojure.inspector/inspect (range 10))

If you were writing real code, you'd normally use the ns form to require
namespaces.

-- 
Dave

-- 
-- 
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 be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Analog to Scheme's partition in Clojure?

2013-04-04 Thread David Powell
 I thought about map destructuring but I don't think it works with boolean
 keys. I think this is good enough though:


You could use the long-form of map destructuring:

(let [{odd true even false} (group-by odd? (range 1 10))]
  (println odd)
  (println even))

-- 
Dave

-- 
-- 
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 be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: why can I re-use local variables if Clojure is immutable?

2013-04-02 Thread David Powell
On Tue, Apr 2, 2013 at 8:09 PM, larry google groups 
lawrencecloj...@gmail.com wrote:


 Does anyone actually write Clojure code like this, or is it considered bad
 form?



I do quite often.

I think the new 1.5 threading macros are probably considered better form
where they are appropriate, but there are no practical disadvantages to
code written that way, other than stylistic ones, and sometimes it is
clearer to build up the construction of a value in multiple steps via let
shadowing.

-- 
Dave

-- 
-- 
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 be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: ANN: Windows installer for Leiningen

2013-03-31 Thread David Powell
Interesting.  Yes this is a problem with lein.bat rather than the installer.

Leiningen recently added support for powershell because it was assumed that
powershell would always be installed, but in fact that isn't the case.  The
installer bundles curl as a fallback for when powershell isn't installed.

The error suggests that you have powershell installed, but that it isn't
working for some reason.

Could you tell me what version of windows you are using?  Do you have any
unusual network setup - eg, are you behind a proxy?

Did the installer successfully download lein.bat to ~/.lein/bin/lein.bat?

Can you see if this command completes without errors:

  curl 
https://leiningen.s3.amazonaws.com/downloads/leiningen-2.1.2-standalone.jar;
-o test.jar


If powershell is going to be a problem, then it might be easier for
leiningen to lower powershell below curl in the priority list.

-- 
Dave

-- 
-- 
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 be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: ANN: Windows installer for Leiningen

2013-03-31 Thread David Powell
Also, can you check what version of powershell you have?

  powershell -Command echo $host.version

-- 
Dave

-- 
-- 
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 be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: ANN: Windows installer for Leiningen

2013-03-31 Thread David Powell
 powershell -Command  {param($a,$f)
 (new-object System.Net.WebClient).DownloadFile($a, $f)} %~2 %~1


Ah, yeah.  %~1 and %~2 strip the quotes off the parameters, which isn't a
good idea.
Something like this should work:


 powershell -Command  {param($a,$f)
 (new-object System.Net.WebClient).DownloadFile($a, $f)} %~2 %~1



 [I can't believe both that in 2013 MS Windows does not handle such
 cases, and that Windows Administrators still create User profiles with
 spaces inside]


To be fair, whilst batch file syntax is horrible, it is more a lein.bat
problem in this case.  If we pass two parameters without quotes, and one
has spaces in, it isn't surprising that it gets interpreted wrongly.

I'll submit a patch to fix the handling of profiles with spaces in them in
lein.bat


-- 
Dave

-- 
-- 
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 be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: ANN: Windows installer for Leiningen

2013-03-31 Thread David Powell
Hi,

But there is a second problem. It (apparently) tries two save the jar file
 in
 C:\Users\Username\.lein\self-installs\leiningen-x.y.z-standalone.jar

 But it looks like it doesn't deal correctly with spaces in the path. If
 your Username
 were to be John Doe, only the part in front of the space is used as the
 install path.

 So the leiningen jar-file would actually be a file named John in the
 directory C:\Users,
 instead of C:\Users\John
 Doe\.lein\self-installs\leiningen-x.y.z-standalone.jar.


I think all of these problems, and Robertos issue are caused by the same
lein.bat.  The permissions problem is probably because the spaces in the
profile are causing lein to attempt to write outside of the user profile.

I think that this patch fixes the issue:
https://github.com/djpowell/leiningen/commit/bd9e2e25508cfc01889057349b133941ff4fc379

It seems that quotes around powershell parameters on the command-line need
to be triple-double-quoted :)

-- 
Dave

-- 
-- 
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 be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: ANN: Windows installer for Leiningen

2013-03-31 Thread David Powell
 That's correct, now it works! :)


Great.  The patch has been accepted by leiningen, so it should be in the
next release.


 IMHO the patch should be just the line 83 of your file, the other
 quoted variables are URLs (which cannot have spaces). Note that
 :DownloadFile, when calls powershell, inverts the order of its
 arguments.


The extra quotes seem to be an artifact of passing the arguments on the
command-line.  The actual arguments to the DownloadFile method in .NET
aren't expected to contain quotes.

From inside powershell itself, this works:

  (new-object System.Net.WebClient).DownloadFile(
https://raw.github.com/technomancy/leiningen/stable/bin/lein.bat;, with
space\file name.txt)

So the extra quotes probably won't harm on either parameter.

-- 
Dave

-- 
-- 
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 be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Getting array length

2013-03-30 Thread David Powell
It seems that .length isn't a real field at the JVM level - it is just part
of the Java - the language.  The JVM has a special arraylength op-code for
getting the length of arrays.

On Sat, Mar 30, 2013 at 5:17 PM, Alice dofflt...@gmail.com wrote:

 Why doesn't (.length (int-array 5)) work?
 Why should I use alength or count instead?

 --
 --
 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 be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en
 ---
 You received this message because you are subscribed to the Google Groups
 Clojure group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
-- 
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 be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




ANN: Windows installer for Leiningen

2013-03-30 Thread David Powell
Hi,

I've put together an installer for Leiningen on Windows:
http://leiningen-win-installer.djpowell.net/

Hopefully it should make it a bit easier for Windows people to get
Leiningen and a Clojure repl up and running.

It requires a JDK to be installed first, but other than that there aren't
any dependencies.
It should work on Windows XP and above, 32-bit or 64-bit.  With or without
powershell available.

The installer should take the hassle out of setting up paths and
environment variables, and changing them when new JDKs are installed.

The current version is beta1.  If you've got any feedback then give me an
email.

-- 
Dave

-- 
-- 
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 be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Reader bug?

2013-03-28 Thread David Powell
Internally they might be the same thing, but lexically they aren't; eg,
Clojure string literals can wrap over multiple lines, and Java strings
can't.

On Thu, Mar 28, 2013 at 8:19 PM, Mark Engelberg mark.engelb...@gmail.comwrote:

 According to the Java docs, Java strings support eight escape characters.
 http://docs.oracle.com/javase/tutorial/java/data/characters.html
 One of the valid escape characters is \'

 Clojure strings are supposed to be the same as Java strings, but when I
 type the following string into the Clojure REPL, I get an error that \' is
 an unsupported escape character:
 \'

 Does Clojure have some intentional reason for not fully supporting the
 spec for Java strings, or is this just a bug?

 --Mark

 --
 --
 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 be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en
 ---
 You received this message because you are subscribed to the Google Groups
 Clojure group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
-- 
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 be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: why am I hitting the 64k method limit on a var?

2013-03-26 Thread David Powell
On Tue, Mar 26, 2013 at 10:40 AM, Marko Topolnik
marko.topol...@gmail.comwrote:

 What exactly is getting compiled into a class here? Not the map itself, I
 believe; that wouldn't even cause this error.

 From general clues, the code that builds your config map is being compiled
 into a method. Without AOT compilation this shouldn't be happening, but I'm
 surprised it's happening even with AOT.


Java classes can contain code, and primitive constants, everything else,
even array initialisers in Java, have to be compiled into initialiser code
that builds the data-structure.

I'd guess that this would be a pretty big map to run to over 64k though -
though I think Clojure has a single initialiser method that initialises all
vars in the namespace, so it is tha total that is important.

I think AOT is irrelevant - the same classes get compiled whether they are
AOT'd or not.

-- 
-- 
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 be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: why am I hitting the 64k method limit on a var?

2013-03-26 Thread David Powell
On Tue, Mar 26, 2013 at 5:48 PM, larry google groups 
lawrencecloj...@gmail.com wrote:


  I'd guess that this would be a pretty big map to run to over 64k though
 - though
  I think Clojure has a single initialiser method that initialises all
 vars in the
  namespace, so it is tha total that is important.


 It certainly seems as if it is the whole namespace that is being compiled.
 The startup file was fine for a while, when I had maybe 3k or 4k of data
 that I was holding in a map, which told the software about the different
 types of data it needed to work on. But then my company gave me a list of
 all search node numbers that we have used to structure the way we make
 calls to Solr. The most obvious place for me to put this was in that same
 map, so I could use it to build search queries on the fly, but, as I said,
 I then ran into the 64k limit.

 I guess, moving forward, I will store the data in MongoDb and I will read
 into that var once the app is running.


Yeah, top-level defs get compiled into a *namespace__init.class* class -
you can verify this by AOT compiling then using *javap -c* on the class
file.

Something like:

(def config (read (clojure.java.io/resource my_file.clj)))


will overcome the limitation

-- 
Dave

-- 
-- 
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 be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: cannot get more than 94 fibonacci numbers - integer overflow

2013-03-25 Thread David Powell
On Mon, Mar 25, 2013 at 3:24 PM, Jim foo.bar jimpil1...@gmail.com wrote:

 On 25/03/13 15:22, Ben Wolfson wrote:

 The 94th fibonacci number is greater than Long/MAX_VALUE, so it
 overflows. It is using longs.


 I seeshouldn't Clojure auto-promote it to a BigInt then?


It doesn't by default.

There are two options:

a) artithmetic is polymorphic, and given a bigint argument, will use bigint
arithmetic, so use 0N as suggested.

b) use the auto-promoting arithmentic forms: +'  -'  *'  inc'  etc.

Clojure used to do auto-promotion, but it is off by default now as it has a
significant performance impact.  In Java, a slot can either be a primitive
or an object, so the auto-promoting forms are forced to box primitive
objects in java.lang.Long wrappers.

-- 
-- 
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 be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: why am I hitting the 64k method limit on a var?

2013-03-25 Thread David Powell
You might be better off putting the config into a file, and then read-ing
it.  That way it never gets compiled into a class, and just stays as a data
structure.

On Mon, Mar 25, 2013 at 9:23 PM, larry google groups 
lawrencecloj...@gmail.com wrote:

 Are vars subject to Java's 64k limit on methods? I started an app a few
 months ago and I was putting all the config into into a var:

 (def app-config
 {
  :cites {
;; more here
}

  :slides {
;; more here
}
  :questions {
;; more here
}
 }


 Then I guess I added too much and I started getting the error regarding
 the 64k limit. Is this expected?

 Why can I add more than 64k to a var, but I can not define it that way at
 compile time?


  --
 --
 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 be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en
 ---
 You received this message because you are subscribed to the Google Groups
 Clojure group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
-- 
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 be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Using transients within fold

2013-03-14 Thread David Powell
As a temporary hack, perhaps you could implement a deftype
ReduceToTransient wrapper that implements CollReduce by calling reduce on
the parameter, and then calling persistent! on the return value of reduce.
 You'd also need to implement CollFold so that the partitioning function
produces wrapped results.

Would that work?

-- 
Dave



On Thu, Mar 14, 2013 at 1:02 PM, Meikel Brandmeyer (kotarak) 
m...@kotka.dewrote:

 You could use the proposed change (second link) and use a patched clojure
 in your application.

 Meikel

  --
 --
 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 be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en
 ---
 You received this message because you are subscribed to the Google Groups
 Clojure group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
-- 
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 be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: What causes the text that I print to the terminal to become mangled garbage?

2013-03-13 Thread David Powell
pprint uses refs internally rather than vars.  I was always a bit
suspicious about that...  Perhaps transaction retries are happening?


On Wed, Mar 13, 2013 at 3:19 PM, larry google groups 
lawrencecloj...@gmail.com wrote:

  tl;dr concurrency is hard

 Jason, if it was just a concurrency issue, it would happen when I use
 pprint. But the above mess only seems to happen with a very specific
 combination of Timbre and thread measuring functions.






 On Wednesday, March 13, 2013 12:16:46 AM UTC-4, Jason Lewis wrote:

 tl;dr concurrency is hard

 Jason Lewis

 Email  jasonl...@gmail.com

 Twitter@canweriotnow http://twitter.com/canweriotnow

 Blog   http://decomplecting.org

 About http://about.me/jason.lewis


 On Tue, Mar 12, 2013 at 11:27 PM, Michael Klishin 
 michael@gmail.comwrote:

 2013/3/13 larry google groups lawrenc...@gmail.com

  At least some of this mangled text is coming from this function, which
 is called at startup and then runs in its own thread


 If your app itself prints stuff to stdout/stderr, it is likely to be
 interleaved with the output from the spying thread.
 Thread execution order and time slicing is non-deterministic and nothing
 synchronizes writing to stdout/stderr
 to enforce ordering.
 --
 MK

 http://github.com/**michaelklishin http://github.com/michaelklishin
 http://twitter.com/**michaelklishin http://twitter.com/michaelklishin

 --
 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clo...@googlegroups.com

 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+u...@**googlegroups.com

 For more options, visit this group at
 http://groups.google.com/**group/clojure?hl=enhttp://groups.google.com/group/clojure?hl=en
 ---
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To unsubscribe from this group and stop receiving emails from it, send
 an email to clojure+u...@**googlegroups.com.

 For more options, visit 
 https://groups.google.com/**groups/opt_outhttps://groups.google.com/groups/opt_out
 .




  --
 --
 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 be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en
 ---
 You received this message because you are subscribed to the Google Groups
 Clojure group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
-- 
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 be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: strange interop behaviour/issue

2013-03-12 Thread David Powell
It looks like:

public String[] tag(String[] sentence, Object[] additionaContext);

wasn't originally present in the API, and was added in:

http://svn.apache.org/viewvc/opennlp/trunk/opennlp-tools/src/main/java/opennlp/tools/postag/POSTaggerME.java?r1=1245855r2=1294177

It sounds like you might have more than one version of the class on your
classpath perhaps, or at least aren't using the code you think you're using?




On Tue, Mar 12, 2013 at 2:38 PM, Jim - FooBar(); jimpil1...@gmail.comwrote:

 On 12/03/13 14:31, Marko Topolnik wrote:

 What explains the occurrence of these extra signatures that you don't
 mention above? It's hard to answer without having the full picture.


 they are deprecated...there are 5 .tag() overloads in total. 2 of them are
 deprecated (the one accepting List and the one accepting String)...the
 other 3 are ok but I'm missing one (the one taking 2 arrays)! I just
 discovered there is another one missing (the topKSequences taking 2
 arrays)!!!

 the full picture is that 2 separate overloads don't show when calling
 getMethods()/**getDeclaredMethods() even though they are both public!
 Having decompiled the jar I can confirm that the 2 methods are indeed
 present! In fact I was using them a week ago! I'm at a loss here...any help
 will be greatly appreciated...

 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 new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscribe@**googlegroups.comclojure%2bunsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/**group/clojure?hl=enhttp://groups.google.com/group/clojure?hl=en
 --- You received this message because you are subscribed to the Google
 Groups Clojure group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to 
 clojure+unsubscribe@**googlegroups.comclojure%2bunsubscr...@googlegroups.com
 .
 For more options, visit 
 https://groups.google.com/**groups/opt_outhttps://groups.google.com/groups/opt_out
 .




-- 
-- 
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 be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Windows Installation

2013-03-10 Thread David Powell
I've made installers for clojure-based programs using InnoSetup before, and
wouldn't mind doing it if people think it is a good idea.

There would be a few choices around Java...

a) Assume that a JDK is installed
b) Check for java and direct the user to Oracle's site to download JDK 7 if
it is missing
c) Bundle an embedded JRE + JDK redistributables

(If we haven't bundled a JDK we'd need to ensure that the JDK bin directory
is on the path, else javac won't work)

-- 
Dave













On Sat, Mar 9, 2013 at 4:28 PM, Brent Millare brent.mill...@gmail.comwrote:

 Does anyone see value in a wizard for lein? Does anyone know how to write
 a wizard, preferably with a scripting language, or xml, rather than c++?
 And can you alter system variables from within the wizard?


 On Saturday, March 9, 2013 8:18:44 AM UTC-5, BJG145 wrote:

 As long as you have wget, that works fine. Only problem I've found so far
 is that lein new app followed by lein check throws an error, but it
 looks like people are on the case.

 https://github.com/**technomancy/leiningen/issues/**863https://github.com/technomancy/leiningen/issues/863



 On Saturday, March 9, 2013 11:24:04 AM UTC, Jonathan Fischer Friberg
 wrote:

 My experience:

 1. Download lein.bat
 2. Run it

 Jonathan



 On Sat, Mar 9, 2013 at 10:23 AM, BJG145 benmag...@gmail.com wrote:

 Perhaps this general anti-Windows attitude is what Windows-based
 newcomers to Clojure find off-putting...


 On Saturday, March 9, 2013 3:55:59 AM UTC, James Ashley wrote:

 Since I've seen a few recent posts about this experience, I figured
 I'd share mine:

 0a) Install cygwin. I don't understand how any programmer stuck using
 windows can get by without it
 1) Install the Oracle JDK
 1a) Add javac to my PATH (I added a symbolic link to javac.exe inside
 cygwin in a directory that was already in my
 PATH: ~/bin)
 2) Download the lein install script as text from the leiningen home
 page.
 3) Copy it over to my cygwin directory
 4) Search/replace to replace the HTML entities with the real thing. I
 think this was a matter of amp; and gt;
 5) It was already executable, so just run it (naming it lein.sh rather
 than lein.bat was important). I got errors about
 certificates and permissions. They mentioned instructions about
 setting up an environment variable (something
 about something like `export DOWNLOAD=curl --trusting %1`...that
 wasn't it, but it was along the same lines).
 I believe that it's some weirdness in the account settings (I have
 other issues along the same lines in totally
 unrelated packages), but I suppose I could have just installed some
 horrible virus. Oh, well.
 6) Create a new project
 7) Change project.clj to use clojure 1.5
 8) `lein repl` inside cygwin didn't work correctly. CLASSPATH was all
 windows-style, which confused cygwin. So
 basic clojure.core pieces weren't found.
 8a) I suspect I could have set up, say, powershell, to make this work.
 But that's stupid, and I don't have time
 to waste on it.
 9) nrepl-jack-in inside emacs worked fine.
 9a) I'm using an init.el from other systems that already have clojure
 set up. But there isn't anything fancy or
 special or customized about it. Just standard configuration stuff that
 I've found on bare-minimal blog posts
 10) Add a symlink to lein in ~/bin.

 I guess that probably looks big and scary. Windows users are used to a
 pretty GUI that they ignore and click
 Next a lot. I dont have a lot of sympathy.

 I haven't done anything meaningful here at all. But the bare-bones
 part of the installation process Just Worked.

 Thank you *so* much to all the people who have worked so hard to make
 this as simple as it is!

 Respectfully,
 James

  --
 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clo...@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+u...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/**group/clojure?hl=enhttp://groups.google.com/group/clojure?hl=en
 ---
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To unsubscribe from this group and stop receiving emails from it, send
 an email to clojure+u...@googlegroups.com.
 For more options, visit 
 https://groups.google.com/**groups/opt_outhttps://groups.google.com/groups/opt_out
 .




  --
 --
 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 be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en
 ---
 You received this message because you are subscribed to the Google Groups

Re: Clojurescript bug

2013-03-05 Thread David Powell
You could try the lein-outdated plugin.

  https://github.com/ato/lein-outdated

It looks at your project.clj, and tells you if there are newer versions of
any of your dependencies, and if so, what they are.

Eg:

  lein outdated

  [org.clojure/clojurescript 0.0-1586] is available but we use 0.0-971

-- 
Dave



On Tue, Mar 5, 2013 at 1:26 PM, Tom Hall thattommyh...@gmail.com wrote:

  Sure, just add it as an explicit dependency to your project. In fact,
  your example uses r1450 only because you've got an explicit dependency
  on it, as lein-cljsbuild 0.3.0 uses r1552 by default, so you could
  also drop the explicit dependency. It's best to use the latest release
  though.

 Cheers, I must be dumb as I cant see the latest version number on the
 github page.
 Googleing takes me to
 http://mvnrepository.com/artifact/org.clojure/clojurescript/0.0-971
 but im guessing
 http://mvnrepository.com/artifact/org.clojure/clojurescript/0.0-1586
 is the latest

 How is one to find this information out?

 Tom

 --
 --
 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 be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en
 ---
 You received this message because you are subscribed to the Google Groups
 Clojure group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
-- 
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 be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Hello World not found

2013-03-05 Thread David Powell
It looks like the (unofficial) Clojure chocolatey package, installs its own
clj.bat file.

The -m package.name syntax only works for clojure packages that are on
your classpath, and that script doesn't put the current directory on the
classpath.  You might have better luck with something like:

  clj -i hello.clj -e (hello/-main)

However,

Clojure 1.2 is pretty ancient; and I don't think many people are using
chocolatey to install clojure.
(Many of the linux package managers are similarly out of date).

You would probably be better off looking at using Leiningen instead for
your Clojure installation.

-- 
Dave



On Tue, Mar 5, 2013 at 3:35 PM, MC Andre andrew.penneba...@gmail.comwrote:

 Clojure can't find hello.clj in the current directory when run as clj -m 
 hello.


 Trace:

   C:\Documents and Settings\apenneba\Desktoptype hello.clj

   (ns hello
   (:gen-class))

   (defn -main [ args]
 (println Hello World!))

   C:\Documents and Settings\apenneba\Desktopclj -m hello
   Exception in thread main java.io.FileNotFoundException: -m (The 
 system cannot find the file specified)
 at java.io.FileInputStream.open(Native Method)
 at java.io.FileInputStream.init(Unknown Source)
 at java.io.FileInputStream.init(Unknown Source)
 at clojure.lang.Compiler.loadFile(Compiler.java:5817)
 at clojure.main$load_script.invoke(main.clj:221)
 at clojure.main$script_opt.invoke(main.clj:273)
 at clojure.main$main.doInvoke(main.clj:354)
 at clojure.lang.RestFn.invoke(RestFn.java:458)
 at clojure.lang.Var.invoke(Var.java:377)
 at clojure.lang.AFn.applyToHelper(AFn.java:174)
 at clojure.lang.Var.applyTo(Var.java:482)
 at clojure.main.main(main.java:37)


 System:


 * Clojure 1.2.0

 * Chocolatey 0.9.8.20

 * Windows XP SP3

  --
 --
 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 be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en
 ---
 You received this message because you are subscribed to the Google Groups
 Clojure group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
-- 
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 be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Wrong clojure version depending on lein dependencies (was: ANN: Clojure 1.5)

2013-03-04 Thread David Powell
On Mon, Mar 4, 2013 at 2:01 PM, Meikel Brandmeyer (kotarak) 
m...@kotka.dewrote:

 Hi Chas,

 Am Montag, 4. März 2013 14:33:29 UTC+1 schrieb Chas Emerick:

 There are a lot of reasons for this, but #1 for me is that few people
 understand the implications of version ranges, either downstream of their
 published libraries or when they are consuming a library and place a range
 around its resolution.  If you do, and your team does, then by all means,
 go hog-wild with version ranges in your in-house libraries and
 applications, where you can control versioning schemes, correspondences
 between APIs and versions, and so on.  However, none of those standards
 apply in the commons, so ranges like the one that provoked the problem in
 this case ([org.clojure/clojure [1.2,1.5)]) are counterproductive (i.e.
 there is no reason to prospectively exclude an unreleased version unless
 you're certain that API changes will break the library in question).
  Granted, the fallback resolution of the Leiningen/Pomegranate/Aether triad
 fall down badly, which exacerbates the problem; again, that's being worked
 on, but the solution still won't help in this situation where a library
 blocks out e.g. 1.5.0, but a downstream user/library explicitly specifies
 1.5.0.


 Ok. So instead of the range I specify [org.clojure/clojure 1.2]. What
 does that mean? Now I either excluded *all* clojure versions not= 1.2 or
 the version number doesn't mean anything. Then we should get rid of it
 completely and just specify the dependency without it. (It seems there
 maven poms which do exactly that? o.O)


(Disclaimer - I'm no Maven expert)

1.2 in this case is a soft dependency on 1.2.  This is probably what
you want.


http://docs.codehaus.org/display/MAVEN/Dependency+Mediation+and+Conflict+Resolution#DependencyMediationandConflictResolution-DependencyVersionRanges


This differs from [1.2,1.5), which is a hard dependency of 1.2 = ver 
1.5

I don't know the exact details, but a soft dependency basically means, that
the library would like 1.2, but if something else ends up requiring 1.3 or
something, then that will be ok.  This way the top-level application can
ultimately decide which versions are included.  This seems to be the most
flexible, and repeatable option.


Version ranges aren't for communicating what versions of libraries you have
tested against - that is best done out-of-band.  If you include a version
range, like the one above, you are saying that you want the software to
fail to build if something ends up requiring 1.5.  This probably isn't
useful, as it will just lead to difficult to fix problems for library
consumers.  I guess the only time you might want a maximum version to be
specified, is if that version exists, and is known to be incompatible with
your library.

-- 
-- 
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 be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Wrong clojure version depending on lein dependencies (was: ANN: Clojure 1.5)

2013-03-04 Thread David Powell
On Mon, Mar 4, 2013 at 2:55 PM, Wolodja Wentland babi...@gmail.com wrote:

 On Mon, Mar 04, 2013 at 14:42 +, David Powell wrote:

  1.2 in this case is a soft dependency on 1.2.  This is probably what
 you
  want.
 
  http://docs.codehaus.org/display/MAVEN/
  Dependency+Mediation+and+Conflict+Resolution#
  DependencyMediationandConflictResolution-DependencyVersionRanges

 Then why declare a versioned dependency in the first place?


It effectively declares a lower-bound on the version number.

-- 
Dave

-- 
-- 
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 be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: ANN: Clojure 1.5

2013-03-01 Thread David Powell
works for me... do you have some sort of version conflict perhaps?

user= (clojure-version)
1.5.0
user= (require '[clojure.core.reducers :as r])
nil
user= (r/fold + (range 1000))
499500



On Fri, Mar 1, 2013 at 4:46 PM, Tassilo Horn t...@gnu.org wrote:

 Stuart Halloway stuart.hallo...@gmail.com writes:

 Hi Stu,

  We are pleased to announce the release of Clojure 1.5.

 Great, except that if I change my project's dependency from 1.5.0-RC17
 to 1.5.0, I get this error when trying to lein test.  With RC17, it
 works just fine.

 --8---cut here---start-8---
 % lein test
 Exception in thread main java.lang.RuntimeException:
 java.io.FileNotFoundException: Could not locate
 clojure/core/reducers__init.class or clojure/core/reducers.clj on classpath:
 at clojure.lang.Util.runtimeException(Util.java:165)
 at clojure.lang.Compiler.eval(Compiler.java:6476)
 at clojure.lang.Compiler.eval(Compiler.java:6455)
 at clojure.lang.Compiler.load(Compiler.java:6902)
 at clojure.lang.RT.loadResourceScript(RT.java:357)
 at clojure.lang.RT.loadResourceScript(RT.java:348)
 at clojure.lang.RT.load(RT.java:427)
 at clojure.lang.RT.load(RT.java:398)
 at clojure.core$load$fn__4610.invoke(core.clj:5386)
 at clojure.core$load.doInvoke(core.clj:5385)
 at clojure.lang.RestFn.invoke(RestFn.java:408)
 at clojure.core$load_one.invoke(core.clj:5200)
 at clojure.core$load_lib.doInvoke(core.clj:5237)
 at clojure.lang.RestFn.applyTo(RestFn.java:142)
 at clojure.core$apply.invoke(core.clj:602)
 at clojure.core$load_libs.doInvoke(core.clj:5271)
 at clojure.lang.RestFn.applyTo(RestFn.java:137)
 at clojure.core$apply.invoke(core.clj:604)
 at clojure.core$use.doInvoke(core.clj:5363)
 at clojure.lang.RestFn.invoke(RestFn.java:408)
 at funnyqt.emf$eval154$loading__4505__auto155.invoke(emf.clj:1)
 at funnyqt.emf$eval154.invoke(emf.clj:1)
 at clojure.lang.Compiler.eval(Compiler.java:6465)
 at clojure.lang.Compiler.eval(Compiler.java:6455)
 at clojure.lang.Compiler.load(Compiler.java:6902)
 at clojure.lang.RT.loadResourceScript(RT.java:357)
 at clojure.lang.RT.loadResourceScript(RT.java:348)
 at clojure.lang.RT.load(RT.java:427)
 at clojure.lang.RT.load(RT.java:398)
 at clojure.core$load$fn__4610.invoke(core.clj:5386)
 at clojure.core$load.doInvoke(core.clj:5385)
 at clojure.lang.RestFn.invoke(RestFn.java:408)
 at clojure.core$load_one.invoke(core.clj:5200)
 at clojure.core$load_lib.doInvoke(core.clj:5237)
 at clojure.lang.RestFn.applyTo(RestFn.java:142)
 at clojure.core$apply.invoke(core.clj:602)
 at clojure.core$load_libs.doInvoke(core.clj:5271)
 at clojure.lang.RestFn.applyTo(RestFn.java:137)
 at clojure.core$apply.invoke(core.clj:602)
 at clojure.core$require.doInvoke(core.clj:5352)
 at clojure.lang.RestFn.invoke(RestFn.java:408)
 at
 funnyqt.declarative_test$eval148$loading__4505__auto149.invoke(declarative_test.clj:1)
 at funnyqt.declarative_test$eval148.invoke(declarative_test.clj:1)
 at clojure.lang.Compiler.eval(Compiler.java:6465)
 at clojure.lang.Compiler.eval(Compiler.java:6455)
 at clojure.lang.Compiler.load(Compiler.java:6902)
 at clojure.lang.RT.loadResourceScript(RT.java:357)
 at clojure.lang.RT.loadResourceScript(RT.java:348)
 at clojure.lang.RT.load(RT.java:427)
 at clojure.lang.RT.load(RT.java:398)
 at clojure.core$load$fn__4610.invoke(core.clj:5386)
 at clojure.core$load.doInvoke(core.clj:5385)
 at clojure.lang.RestFn.invoke(RestFn.java:408)
 at clojure.core$load_one.invoke(core.clj:5200)
 at clojure.core$load_lib.doInvoke(core.clj:5237)
 at clojure.lang.RestFn.applyTo(RestFn.java:142)
 at clojure.core$apply.invoke(core.clj:602)
 at clojure.core$load_libs.doInvoke(core.clj:5271)
 at clojure.lang.RestFn.applyTo(RestFn.java:137)
 at clojure.core$apply.invoke(core.clj:602)
 at clojure.core$require.doInvoke(core.clj:5352)
 at clojure.lang.RestFn.applyTo(RestFn.java:137)
 at clojure.core$apply.invoke(core.clj:602)
 at user$eval75.invoke(NO_SOURCE_FILE:1)
 at clojure.lang.Compiler.eval(Compiler.java:6465)
 at clojure.lang.Compiler.eval(Compiler.java:6455)
 at clojure.lang.Compiler.eval(Compiler.java:6431)
 at clojure.core$eval.invoke(core.clj:2795)
 at clojure.main$eval_opt.invoke(main.clj:296)
 at clojure.main$initialize.invoke(main.clj:315)
 at clojure.main$null_opt.invoke(main.clj:348)
 at clojure.main$main.doInvoke(main.clj:426)
 at clojure.lang.RestFn.invoke(RestFn.java:421)
 at 

Re: was there a time when clojure empty seqs were falsy?

2013-02-25 Thread David Powell
Some time before the release of Clojure 1.0, there didn't used to be any
such thing as an empty sequence.  You either had a (lazy) sequence, or nil.
 This made it easy to use sequences as emptiness tests, but had the cost
that a lazy sequence wasn't fully lazy because anything that returned one
had to attempt to evaluate the first item in order to determine whether
there was anything to return or not.

[ There are some obsolete notes describing the change here:
http://clojure.org/lazy  for the historically curious.  Or perhaps here:
http://clojure.org/lazier (And the 'streams' referred to in those docs
refer to this failed experiment: http://clojure.org/streams).  Basically
lazy-cons was replaced by lazy-seq. ]

-- 
Dave

-- 
-- 
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 be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: does lein2 use repositories defined in ~/.m2/settings.xml?

2013-02-21 Thread David Powell
  Just wondering; if you want to specify an internal nexus repo in one
 place,
  can you specify it in ~/.lein/profiles.clj ?

 It's possible, but highly discouraged. If your project requires certain
 repositories in order to operate, you should declare them in project.clj.

 Specifying authentication for private repos in the user profile, on the
 other hand, is highly recommended.

 -Phil


I can see it being an anti-pattern for open-source projects hosted on the
internet, but the scenario that I am experimenting with is a single nexus
server within an organisation, used to mirror clojars  central, as well as
act as a repository for internal closed-source components.

Putting repos in profiles.clj seems to have the advantage that I'll be able
to override all accesses to central / clojars / etc to go via the nexus
proxy; and I won't have to start hacking at published project.cljs if
infrastructure changes mean that the repo server moves or fragments or
whatever.

Does that sound reasonable?  (I'm a noob at maven infrastructure).

-- 
Dave

-- 
-- 
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 be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Module For COM Objects

2013-02-21 Thread David Powell
There is an example here of using JACOB:
http://en.wikibooks.org/wiki/Clojure_Programming/Examples/Talking_to_Excel

(I think this only works for IDispatch stuff?)


On Fri, Feb 22, 2013 at 1:02 AM, Kevin Downey redc...@gmail.com wrote:

 The are a few tools for doing interop with COM from the JVM. They all kind
 of suck. We use com4j at work with Clojure. Com4j generates JVM stubs for
 COM libraries.
 On Feb 21, 2013 3:53 PM, octopusgrabbus octopusgrab...@gmail.com
 wrote:

 Does Clojure have a module that allows initializing, passing data to, and
 finalizing COM objects? I am asking, because I need to write a Clojure
 program to communicate with a COM toolkit. Thanks.

 --
 --
 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 be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en
 ---
 You received this message because you are subscribed to the Google Groups
 Clojure group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.



  --
 --
 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 be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en
 ---
 You received this message because you are subscribed to the Google Groups
 Clojure group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
-- 
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 be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Why is this so difficult?

2013-02-15 Thread David Powell
Just for the record, I've had problems with lein trampoline on the past,
but the latest version of lein is fine.  I do all my clojure on Windows 7.

-- 
-- 
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 be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: leiningen dependencies plugin

2013-02-06 Thread David Powell
I wrote this recently to copy your dependencies to a specific directory in
your project:
https://github.com/djpowell/lein-libdir

Or you could just use lein-uberjar?

Or lein-tar to bundle everything up?

-- 
Dave



On Wed, Feb 6, 2013 at 11:41 AM, Maris maris.orbid...@gmail.com wrote:


 Is there dependencies plugin for leiningen ?

 I need to download all dependencies so I can copy my project to a server.
   ( I can't run leiningen on server ).

 mvn dependency:copy-dependencies

 --
 --
 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 be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en
 ---
 You received this message because you are subscribed to the Google Groups
 Clojure group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
-- 
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 be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: ANN: babbage 1.0.0, a library for easily gathering data and computing summary measures in a declarative way

2013-02-02 Thread David Powell
I'm sure these libraries do the job better, but just for interest, here is
a fun example of using finger-trees to maintain stats for a collection as
it gets updated:

https://gist.github.com/672592

-- 
Dave

-- 
-- 
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 be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Best practice - (:keyword map) versus (map :keyword)

2013-01-29 Thread David Powell
Generally, if the map is behaving like small struct, and you are accessing
fields of it, (:keyword map) is idiomatic, and mirrors (.fields object).
If the map is used like a data-structure, or a mapping function, then (map
:keyword) is more idiomatic.

Note that if you are using defrecords, (:keyword record) performs better,
because the clojure compiler generates some shim implementations that let
the underlying field get accessed directly.


On Tue, Jan 29, 2013 at 2:00 AM, Jonathon McKitrick jmckitr...@gmail.comwrote:

 Either one works, is there any kind of guideline on which to prefer, when?
  Or is it entirely personal preference?  It seems each way could be more
 readable in different circumstances

 --
 --
 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 be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en
 ---
 You received this message because you are subscribed to the Google Groups
 Clojure group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
-- 
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 be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Installing Clojure on Windows 7

2013-01-24 Thread David Powell
I don't think there should are any problems with Clojure on Windows 7.

lein trampoline cljsbuild repl-rhino didn't work for me on old versions
of leiningen, but on the release version of lein 2 it works perfectly.

I use a mix of IntelliJ+LaClojure  Emacs+clojure-mode and they also work
perfectly.

-- 
-- 
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 be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en




Re: Simple FIFO cache for memoize

2013-01-23 Thread David Powell
Specifically, core.memoize uses core.cache to provide more flexible
replacements for memoize:
https://github.com/clojure/core.memoize

-- 
Dave



On Wed, Jan 23, 2013 at 8:12 AM, Baishampayan Ghose b.gh...@gmail.comwrote:

 Take a look at core.cache - https://github.com/clojure/core.cache ~BG

 On Wed, Jan 23, 2013 at 1:11 PM, Omer Iqbal momeriqb...@gmail.com wrote:
  I've been reading a bit about the STM, and here's an implementation of a
  FIFO cache for producing a memoized version of a function. Is it correct
 to
  use the STM in this case, or are there any  drawbacks?
 
  (defn bounded-memoize
Return a bounded memoized version of fn 'f'
 that caches the last 'k' computed values
[f k]
(let [cache (ref {})
  values (ref clojure.lang.PersistentQueue/EMPTY)]
  (fn [ args]
(if-let [e (find @cache args)]
  (val e)
  (let [result (apply f args)]
(dosync
 (alter values conj args)
 (alter cache assoc args result)
 (if ( (count @values) k)
   (let [evict (peek @values)]
 (alter values pop)
 (alter cache dissoc evict))
   )
 result
 ))
 
  )
))
)
 
 
  --
  --
  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 be patient with
 your
  first post.
  To unsubscribe from this group, send email to
  clojure+unsubscr...@googlegroups.com
  For more options, visit this group at
  http://groups.google.com/group/clojure?hl=en
 
 



 --
 Baishampayan Ghose
 b.ghose at gmail.com

 --
 --
 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 be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en




-- 
-- 
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 be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en




Re: Loading a file from classpath

2013-01-20 Thread David Powell
If you want read a file from the classpath as a string, you can use
clojure.java.io/resource;

(require 'clojure.java.io)
(slurp (clojure.java.io/resource META-INF/MANIFEST.MF))


On Sun, Jan 20, 2013 at 11:34 PM, Josh Kamau joshnet2...@gmail.com wrote:

 Hi ;

 I figured it it out... (load /myfile);loads my file relative to
 classpath


 thanks
 Josh


 On Mon, Jan 21, 2013 at 2:14 AM, Josh Kamau joshnet2...@gmail.com wrote:

 Hi;

 I have a clojure lein project. I have a directory called resources which
 i believe is the classpath root directory..

 I just want to (slarp resources/myfile.txt) , This doesnt work. How do
 i specify the path properly such that i will always work even after i
 uberjar or uberwar ?

 thanks
 josh


  --
 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 be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en


-- 
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 be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: [ANN] Persistent disjoint-set forests for Clojure

2013-01-10 Thread David Powell
Cool - this looks great.  One of the first commercial problems I used
Clojure for required union-find, and I basically solved it using
one-huge-hashmap which I repeatedly assoc'd the equivalences into; I expect
that your library is a lot better.

-- 
Dave



On Wed, Jan 9, 2013 at 12:10 AM, Jordan Lewis jordanthele...@gmail.comwrote:

 Hi all,

 I couldn't find any implementations of union-find[1] for Clojure, so I
 wrote one. It's a persistent rendition of the disjoint-set forest
 implementation by Tarjan, including the union-by-rank and path compression
 optimizations. It acts like a native Clojure collection, as well as
 supporting the union and get-canonical operations given by the union-find
 algorithm.

 It's available with usage instructions on GitHub (
 https://github.com/jordanlewis/data.union-find) and Clojars (
 https://clojars.org/org.jordanlewis/data.union-find).

 Why is this useful? Briefly, union-find allows you to keep track of a
 universe of elements organized into a number of disjoint sets. It
 efficiently supports the operations of adding new elements as singleton
 sets to the universe, modifying the universe by unioning two sets
 together, and determining which set contains a particular element within
 the universe.

 Feedback is greatly appreciated!

 Cheers,
 Jordan Lewis

 [1]: http://en.wikipedia.org/wiki/Disjoint-set_data_structure

 --
 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 be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en

-- 
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 be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Google+ community

2013-01-05 Thread David Powell
They do look pretty good, but there seems to already be a community with
549 members at:

https://plus.google.com/communities/103410768849046117338
On 5 Jan 2013 20:15, dspiteself dspites...@gmail.com wrote:

 I started a google plus 
 communityhttps://plus.google.com/u/0/communities/102842407348588249223.

 I know most of the Clojure community is generally more into twitter, but I
 have been enjoying Google+ communities very much. It could be a great more
 externally visible venue for some of the conversation that happen on google
 groups.
 It also has the effect off make your search results of people and people
 in your circles and communities show up higher.

  --
 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 be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en

-- 
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 be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: EOF when executing lein trampoline cljsbuild repl-listen

2012-12-24 Thread David Powell
I can confirm the same problem


On Sun, Dec 23, 2012 at 11:30 PM, Mark markaddle...@gmail.com wrote:

 Hi,
 I'm trying to make my way through the modern-cljs tutorials and running
 into a blocker:  I'm on tutorial 2 (
 https://github.com/magomimmo/modern-cljs/blob/master/doc/tutorial-02.md?.mdown)
 and when I try lein trampoline cljsbuild repl-listen, I get

 Exception in thread main clojure.lang.LispReader$ReaderException:
 java.lang.RuntimeException: EOF while reading, starting at line 1
 at clojure.lang.LispReader.read(LispReader.java:215)
 at clojure.core$read.invoke(core.clj:3346)
 at clojure.core$read.invoke(core.clj:3344)
 at clojure.main$eval_opt.invoke(main.clj:295)
 at clojure.main$initialize.invoke(main.clj:316)
 at clojure.main$script_opt.invoke(main.clj:340)
 at clojure.main$main.doInvoke(main.clj:427)
 at clojure.lang.RestFn.invoke(RestFn.java:930)
 at clojure.lang.Var.invoke(Var.java:460)
 at clojure.lang.AFn.applyToHelper(AFn.java:235)
 at clojure.lang.Var.applyTo(Var.java:532)
 at clojure.main.main(main.java:37)
 Caused by: java.lang.RuntimeException: EOF while reading, starting at line
 1
 at clojure.lang.Util.runtimeException(Util.java:170)
 at clojure.lang.LispReader.readDelimitedList(LispReader.java:1117)
 at clojure.lang.LispReader$ListReader.invoke(LispReader.java:962)
 at clojure.lang.LispReader.read(LispReader.java:180)
 ... 11 more

 I figure the reader is trying to load the project.clj but I'm executing
 from the project's root directory.  I'm using lein 2.0 preview 10 on a
 Windows 7 machine if that matters.


  --
 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 be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en

-- 
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 be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: EOF when executing lein trampoline cljsbuild repl-listen

2012-12-24 Thread David Powell
Ah, cool.  I can confirm that this works for me in leiningen HEAD.


On Mon, Dec 24, 2012 at 6:08 AM, George Oliver georgeolive...@gmail.comwrote:



 On Sunday, December 23, 2012 3:30:53 PM UTC-8, Mark wrote:


 I figure the reader is trying to load the project.clj but I'm executing
 from the project's root directory.  I'm using lein 2.0 preview 10 on a
 Windows 7 machine if that matters.



 This might be a Windows + trampoline problem. See
 https://groups.google.com/d/msg/clojure/J0imbgVWh5I/lXL8DlvJxAoJ .



 --
 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 be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en


-- 
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 be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: EOF when executing lein trampoline cljsbuild repl-listen

2012-12-24 Thread David Powell
Ah, cool.  This is fixed in leiningen HEAD.
Though lein ring server doesn't work in HEAD.


On Mon, Dec 24, 2012 at 6:08 AM, George Oliver georgeolive...@gmail.comwrote:



 On Sunday, December 23, 2012 3:30:53 PM UTC-8, Mark wrote:


 I figure the reader is trying to load the project.clj but I'm executing
 from the project's root directory.  I'm using lein 2.0 preview 10 on a
 Windows 7 machine if that matters.



 This might be a Windows + trampoline problem. See
 https://groups.google.com/d/msg/clojure/J0imbgVWh5I/lXL8DlvJxAoJ .



 --
 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 be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en


-- 
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 be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: call superclass method in classes created by Clojure?

2012-11-29 Thread David Powell
reify can only implement interfaces and protocols, so there aren't any
superclass methods to call (except the ones in Object I guess).


On Thu, Nov 29, 2012 at 1:30 PM, Vladimir Tsichevski
tsichev...@gmail.comwrote:

 Thanks,

 is there something like that for reify?


 On Thursday, November 29, 2012 2:52:56 AM UTC+4, Meikel Brandmeyer
 (kotarak) wrote:

 Am 28.11.12 23:10, schrieb Vladimir Tsichevski:
  Is it possible?
 See exposes-methods in documentation for gen-class.

 http://clojure.github.com/**clojure/clojure.core-api.html#**
 clojure.core/gen-classhttp://clojure.github.com/clojure/clojure.core-api.html#clojure.core/gen-class

 Kind regards
 Meikel

  --
 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 be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en


-- 
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 be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: call superclass method in classes created by Clojure?

2012-11-29 Thread David Powell
proxy is basically a more interop-oriented version of reify though, and it
can extend classes, and you can use proxy-super to call superclass methods
from there.
On Nov 29, 2012 1:40 PM, Vladimir Tsichevski tsichev...@gmail.com wrote:

 Thanks

 On Thursday, November 29, 2012 5:33:20 PM UTC+4, David Powell wrote:


 reify can only implement interfaces and protocols, so there aren't any
 superclass methods to call (except the ones in Object I guess).


 On Thu, Nov 29, 2012 at 1:30 PM, Vladimir Tsichevski 
 tsich...@gmail.comwrote:

 Thanks,

 is there something like that for reify?


 On Thursday, November 29, 2012 2:52:56 AM UTC+4, Meikel Brandmeyer
 (kotarak) wrote:

 Am 28.11.12 23:10, schrieb Vladimir Tsichevski:
  Is it possible?
 See exposes-methods in documentation for gen-class.

 http://clojure.github.com/**cloj**ure/clojure.core-api.html#**cloj**
 ure.core/gen-classhttp://clojure.github.com/clojure/clojure.core-api.html#clojure.core/gen-class

 Kind regards
 Meikel

  --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clo...@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+u...@**googlegroups.com
 For more options, visit this group at
 http://groups.google.com/**group/clojure?hl=enhttp://groups.google.com/group/clojure?hl=en


  --
 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 be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en

-- 
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 be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: First foray into clojure - questions for new project

2012-11-13 Thread David Powell
cemerick made a screencast of how to get started with Clojure, which
takes you through getting started with the tools, and making a web
app.  It is probably a great place to start:

  http://cemerick.com/2012/05/02/starting-clojure/


For details on the Clojure web stack, I really like this guide:

  http://brehaut.net/blog/2011/ring_introduction


Note that on Clojure the web stack is made up of a bunch of small
libraries.  They are almost all based on ring.  The guide above
describes the common choices.

-- 
Dave

-- 
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 be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Correct usage of data-readers

2012-10-17 Thread David Powell
I had assumed that including data-readers.clj in a library was ok...  I
hadn't considered the issue of clashes with an application.

Maybe some tags are intended to be concrete, and some abstractions.  If you
are defining a concrete tag, then including data-readers is ok, and clients
just have to get used to only being able to redef them at runtime.

If your tag is designed for read-time redefinition in an application, then
perhaps you shouldn't include data-readers?

I agree that some guidance would be welcome.

-- 
Dave

-- 
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 be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Hiccup - HTML - PNG

2012-10-17 Thread David Powell
I'm using PhantomJS http://phantomjs.org/
It is a headless WebKit build that can render webpages as png or pdf,
amongst other stuff.  It isn't a java lib though - it is a command-line
executable.

Not HTML, but possibly useful, I also use Batik 
http://xmlgraphics.apache.org/batik/ to render svg generated in clojure to
png.

-- 
Dave

-- 
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 be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: edn

2012-09-07 Thread David Powell
In Clojure, all Clojure files are utf-8.  I assume that is also required in
edn?
(I think it should be)
On Sep 7, 2012 2:01 AM, Rich Hickey richhic...@gmail.com wrote:

 I've started to document a subset of Clojure's data format in an effort to
 get it more widely used as a data exchange format, e.g. as an alternative
 to JSON.

 Please have a look:

 https://github.com/richhickey/edn

 Rich

 --
 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 be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en


-- 
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 be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: What is the meaning of :while in a for ?

2012-08-21 Thread David Powell
 No, it's perfectly possible to have a comprehension with a :while that
 generates more elements after :while evaluated to false.  :while skips
 some bindings, but it doesn't need to skip all of them.  See my original
 reply to Nicolas.



Wow - I never knew that.  That isn't at all obvious from the sparse doc
string.

(Is that actually a bug, I wonder? - it seems like a pretty useless
behaviour?)

-- 
Dave

-- 
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 be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Countdown numbers game in clojure.core.logic

2012-08-18 Thread David Powell
I just had a go of solving the Numbers Game from the UK gameshow Countdown
[1] in clojure.core.logic.

https://gist.github.com/3374505

It works, but it is a bit slow.

Anybody got any ideas on better approaches?

[1] http://en.wikipedia.org/wiki/Countdown_(game_show)#Numbers_round

-- 
Dave

-- 
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 be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Error running clojure file.

2012-08-16 Thread David Powell
 After correcting it, I get a new curious error:
 Unknown constant tag 44 in class file user$eval1976
  [Thrown class java.lang.ClassFormatError]

There is a difference between using load (and related functions) to
parse data, and using read (and related functions).

If you use read to parse a file, it just parses the file and gives you
back data structures.

If you use load to parse a file, it reads the data as an expression,
it creates a class on the JVM containing a function, and then executes
that function, which does the work required to return your data
structures.

Normally the results are the same, but the latter is less efficient;
but for large amounts of data, the latter won't even work.

The problem is that there are certain hard-coded limits on the JVM as
to the size of a class file, the size of a function etc; so for
parsing large amounts of data, you shouldn't use load - else you'll
hit that limit and get a rather unfriendly error message when the JVM
tries to load the invalid class file that clojure just created.


So if you are wanting to read very large clojure datastructures, put
your data in a separate file to your code, and use read or read-string
to load it.

-- 
Dave

-- 
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 be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Central screwup

2012-08-16 Thread David Powell
On Thu, Aug 16, 2012 at 1:46 PM, Joseph Smith j...@uwcreations.com wrote:
 I'm surprised this still hasn't been fixed. I noticed it and raised the
 issue (well, told people about it on IRC) about 2 weeks ago. I've been
 pointed at an alternate repo as a workaround. :/

Hmm, it is fine here:
https://oss.sonatype.org/content/repositories/releases/org/clojure/clojure/

But wrong here:
https://oss.sonatype.org/content/repositories/central-sync/org/clojure/clojure/


I don't know what that means; if anything.

--
Dave

-- 
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 be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: drawing a chess-board with seesaw ...

2012-08-09 Thread David Powell
You can try using the multi-input version of map to knit your data
together with some other, potentially infinite, sequence:

  (map vector items (cycle [black white]))

It returns something like this:

  ([item1 black] [item2 white] [item3 black] [item4 white])

Then you can use doseq over that, using destructuring to pick apart
the items and colours and do something appropriate with each of them.

-- 
Dave


On Thu, Aug 9, 2012 at 11:53 AM, Jim - FooBar(); jimpil1...@gmail.com wrote:
 On 09/08/12 11:23, Jim - FooBar(); wrote:

 aaa ok sorry...you mean having it as doseq binding...that makes sense! I
 apologise for rushing...

 Jim



 No I can't put 'cycle' inside a doseq cos its trying to consume it!


 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 new members are moderated - please be patient with your
 first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en

-- 
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 be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Clojurians in the midlands (UK)

2012-07-23 Thread David Powell
On Tue, Jul 17, 2012 at 9:06 AM, Colin Yates colin.ya...@gmail.com wrote:

 I know there are a few in London, but are there any around the midlands in
 the UK (Coventry, Leicester, Birmingham, Derby etc.)?


I'm from Staffordshire.

-- 
Dave

-- 
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 be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Much longer build time for Clojure on HDD vs. SSD (4 min vs 30s)

2012-07-16 Thread David Powell
In my opinion, on-disk consistency isn't and wasn't a goal.  And the
spamming of calls to sync does nothing other than make compilation
ridiculously slow on  file systems that are slow at sync.

sync should not have any user visible effects.  It just seems to me to be a
bit of voodoo code that should be removed.  I always comment it out.

Is there any test case that fails without it?

-- 
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 be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Converting String to Hashmap

2012-06-19 Thread David Powell
On Mon, Jun 18, 2012 at 4:18 PM, Antix matthias.kal...@googlemail.comwrote:

 Hi Guys,
 I'm very new to clojure and searching for a way to convert a given
 String to a Hashmap as far as this is possible.
 I thought already about the use of a macro, but all the different
 quotes are a little bit confusing for me.

 Is it possible to create a Hashmap or some similar structure by using
 a given String.

 My Input-String is something like: :Name John, :age 20, :gender
 n
 Is it possible to convert this to a hashmap similar to this:
 (def hashm {:Name John, :age 20, :gender n  }) ?


Use the built in read-string function.:
(read-string (str { s })))

Don't use eval or load-string.  read-string is safer, faster, and won't hit
JVM size limits.

Also, if the input isn't trusted, you should bind *read-eval* to false, to
avoid being subject to running hostile user-supplied code:

(defn parse-map
  [s]
  (binding [*read-eval* false]
(read-string (str { s }

-- 
Dave

-- 
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 be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

  1   2   >