Re: (resolve (symbol f)) works at the REPL but not in an uberjar

2017-10-13 Thread lawrence . krubner
Is there a way I can avoid hard-coding " "denormalize.pull-from-mysql"" ? I guess it doesn't matter, but it does seem a little inelegant. On Thursday, October 12, 2017 at 9:54:36 PM UTC-4, Justin Smith wrote: > > you can use (symbol "denormalize.pull-from-mysql" "f") instead > > On Thu, Oct 12,

Re: possibly a Clojure question or possibly an AWS question: slow writes to durable-queue

2017-10-13 Thread Nathan Fisher
It sounds like you have a memory leak. I would look at addressing that before any performance tricks. On Fri, 13 Oct 2017 at 05:35, wrote: > Following Daniel Compton's suggestion, I turned on logging for GC. I don't > see it happening more often, but the slow down does seem related to the > momen

Re: (resolve (symbol f)) works at the REPL but not in an uberjar

2017-10-13 Thread Gary Verhaegen
>From the description of your problem, it's not really clear to me why you insist on using strings. Why not use the functions directly? Functions can serve as keys in maps. Granted, it's a bit ugly to print. You could also build a map of string to function yourself. Not sure what the performance of

Re: (resolve (symbol f)) works at the REPL but not in an uberjar

2017-10-13 Thread Isaac Tsang
That because you REPL had set `*ns*`, when Clojure bootstrap from clojure.main, the *ns* bound to clojure.core On Friday, October 13, 2017 at 9:27:06 AM UTC+8, lawrence...@gmail.com wrote: > > At the REPL, this works perfectly: > > > (defn get-users [] [:susan :kwan]) > > > > (defn what-is-t

hello world question !!!

2017-10-13 Thread Damien Mattei
hello, i'm new to clojure, just installed it on a CentOS box, and try to compile the code below from tutorial, but it does not work, i searched a lot before posting, no answer... i do not want to use leiningen at this stage,later perheaps... just want to compile and run user=> (ns clojure.exa

Re: hello world question !!!

2017-10-13 Thread James Reeves
Maybe this is a dumb question, but do you have a file "clojure/examples/hello.clj" on the classpath? Since that's what the exception is complaining about. On 13 October 2017 at 15:09, Damien Mattei wrote: > hello, > > i'm new to clojure, just installed it on a CentOS box, > > and try to compile

Re: hello world question !!!

2017-10-13 Thread Justin Smith
To pedantically specific, clojure compiles all of your coffee to be code in memory, but the 'compile' function expects to find a file on disk, and create a class file on disk. Using gen-class in the repl is a no-op. On Fri, Oct 13, 2017, 07:48 James Reeves wrote: > Maybe this is a dumb question,

Re: hello world question !!!

2017-10-13 Thread Justin Smith
Sorry for the auto correct fail, it compiles all of your code to byte-code On Fri, Oct 13, 2017, 08:29 Justin Smith wrote: > To pedantically specific, clojure compiles all of your coffee to be code > in memory, but the 'compile' function expects to find a file on disk, and > create a class file

[ANN] Automatically generate your specs and types

2017-10-13 Thread Ambrose Bonnaire-Sergeant
Hi, Happy to announce a new set of tools to *automatically* *generate* types and specs for your projects. *Dependency information:* 1. core.typed [org.clojure/core.typed "0.4.2"] 2. lein-typed [lein-typed

Re: hello world question !!!

2017-10-13 Thread Damien Mattei
i did not have , i just follow the tutorial: https://clojure.org/reference/compilation i made the file but still the same problem: [mattei@moita ~]$ export CLASSPATH=.:./clojure/examples [mattei@moita ~]$ clojure Clojure 1.5.1 user=> (compile 'clojure.examples.hello) FileNotFoundException Could no

Re: hello world question !!!

2017-10-13 Thread Justin Smith
paths have to reflect the package and be relative to the class path, so if "clojure/examples" is on the classpath, and the namespace is clojure.examples.hello, the file needs to be in "clojure/examples/clojure/examples/hello.clj" On Fri, Oct 13, 2017 at 10:13 AM Damien Mattei wrote: > i did not

Re: hello world question !!!

2017-10-13 Thread Justin Smith
also you don't need to do any of this for a basic example, you can just type code into the repl and run it, or create a proper project with a dependency manager when you want something more organized On Fri, Oct 13, 2017 at 10:22 AM Justin Smith wrote: > paths have to reflect the package and be

Re: hello world question !!!

2017-10-13 Thread Andy Fingerhut
Just a note that at the top of the documentation page you mention, it says: "Clojure compiles all code you load on-the-fly into JVM bytecode, but sometimes it is advantageous to compile ahead-of-time (AOT)." I would venture an estimate that most people who use Clojure do so without using AOT compi

Re: hello world question !!!

2017-10-13 Thread Damien Mattei
yes i had tested . (point) in classpath and later added clojure/example which is not a good idea as the namespace is already clojure.examples.hello, already clojure.examples will be converted in clojure/examples but what must i do then? where must i put this hello.clj: (ns clojure.examples.hell

Re: hello world question !!!

2017-10-13 Thread Damien Mattei
but i am in this situation, i wrote application in Scheme (Kawa,Bigloo) ,LisP that ran on an apache tomcat server, the application is deplyed in war files , they are precompiled ,with Kawa or Bigloo Scheme, and also use regular Java class compiled with Java8. They never ran in REPL ,all the test

Re: ANN: ClojureScript 1.9.542, spec changes & REPL enhancement

2017-10-13 Thread David Nolen
Will need something more minimal. Thanks. David On Fri, Oct 13, 2017 at 2:08 PM, Rangel Spasov wrote: > I'm getting this (I'm guessing related to the changes around CLJS-485 > RegExp flags): > > (iOS simulator screenshot attached). > > > As you can see, the RN/JS stack traces are not very usefu

form comment and meta data?

2017-10-13 Thread Rob Nikander
Hi, Why doesn't this compile? I tried to comment out the "private" metadata. (def #_^:private foo 1) CompilerException java.lang.RuntimeException: First argument to def must be a Symbol, compiling:(null:1:1) Rob -- You received this message because you are subscribed to the Google Grou

Re: form comment and meta data?

2017-10-13 Thread Justin Smith
what happens is that the metadata reader macro is applied before the comment reader macro, so you comment out the name of the def (which also had the metadata attached) user=> '(def #_ ^:private foo 1) (def 1) On Fri, Oct 13, 2017 at 11:48 AM Rob Nikander wrote: > Hi, > > Why doesn't this compi

Re: form comment and meta data?

2017-10-13 Thread Rob Nikander
On Friday, October 13, 2017 at 2:55:51 PM UTC-4, Justin Smith wrote: > > what happens is that the metadata reader macro is applied before the > comment reader macro, so you comment out the name of the def (which also > had the metadata attached) > > user=> '(def #_ ^:private foo 1) > (def 1) >

Re: hello world question !!!

2017-10-13 Thread James Reeves
The docstring for compile says that "The source for the lib must be in a proper classpath-relative directory", so unfortunately you can't just create the namespace in the REPL and compile it from there. The tutorial on t

Re: [ANN] Automatically generate your specs and types

2017-10-13 Thread Colin Fleming
This looks great! Can this be used to infer macro specs based on examples of usage? On 14 October 2017 at 04:30, Ambrose Bonnaire-Sergeant < abonnaireserge...@gmail.com> wrote: > Hi, > > Happy to announce a new set of tools to *automatically* > *generate* types and specs for your projects. > > *D

Re: hello world question !!!

2017-10-13 Thread Andy Fingerhut
I haven't deployed an application written in Clojure to a server as a WAR file before, so can't speak from experience, but I am sure others here probably can. Hey, others, have you deployed a Clojure application via a WAR file without using AOT compilation, with only Clojure source code packaged i

Re: hello world question !!!

2017-10-13 Thread Damien Mattei
@james i also try to set the CLASSPATH at src but it does noot work, i will try Leiningen monday Regards, Damien On Friday, October 13, 2017 at 9:12:55 PM UTC+2, James Reeves wrote: > > The docstring for compile > >

Re: hello world question !!!

2017-10-13 Thread Damien Mattei
@andy to deploy the WAR file , i also use Netbeans to create it with java files, the .scm scheme, files are .class files ( https://github.com/damien-mattei/Jkawa/tree/master/eu/oca/kawafunct )precompiled with Kawa scheme ( https://github.com/damien-mattei/Jkawa )and ,Bigloo scheme ( https://git

Re: ANN: ClojureScript 1.9.542, spec changes & REPL enhancement

2017-10-13 Thread Rangel Spasov
Sorry, that was false alarm. Ok, that's kinda funny: Without paying attention I saw this on the top of the mailing list in google groups and just copy/pasted the version number and tried to build, only to just realize that I DOWNGRADED to a ClojureScript release from May 12th LOL. My bad. Some

Re: [ANN] Automatically generate your specs and types

2017-10-13 Thread Ambrose Bonnaire-Sergeant
Potentially. Actually, it currently instruments and gathers data about macros, but doesn't output them

Re: [ANN] Automatically generate your specs and types

2017-10-13 Thread Ambrose Bonnaire-Sergeant
This is pretty much the extent of my macro heuristics: binding forms are often the first argument, and it's usually a vector. Also,

Re: [ANN] Automatically generate your specs and types

2017-10-13 Thread Ambrose Bonnaire-Sergeant
I enabled opt-in macro spec inference in core.typed 0.4.3, via a :spec-macros option. Here's an example with slingshot: Setup Inferred Macro specs

Re: [ANN] Automatically generate your specs and types

2017-10-13 Thread Rostislav Svoboda
A hint to a casual reader just trying stuff out: $ lein new hello $ cd hello # added {:user {:plugins [[lein-typed "0.4.2"]]}} to ~/.lein/profiles.clj # added [org.clojure/core.typed "0.4.2"] to project.clj $ lein typed infer-type hello.core CompilerException java.lang.RuntimeException: No such na

Re: hello world question !!!

2017-10-13 Thread John M. Switlik
Damien, This is just an aside. Thanks for the question. I have not even tried Clojure, yet. So, this is good for me to follow. BTW, I have done Java (since the '90s) and so know of the 'coffee' stains everywhere. Yet, given the Lisp basis, I want to see how to make Clojure easier for the cau

Re: possibly a Clojure question or possibly an AWS question: slow writes to durable-queue

2017-10-13 Thread Ravindra Jaju
I've faced this issue before, and I'd hazard a guess that like me, it could be related to the IOPS settings. AWS' IO performance is highly variable, and you get good performance in bursts, in very low volumes, and generally only initially for long runs. Which kind of makes sense, unless you reserv

Re: [ANN] Automatically generate your specs and types

2017-10-13 Thread Ambrose Bonnaire-Sergeant
Thanks Bost. To workaround the need to delete annotations, manually add these requires to your ns form. You can choose whatever alias name you want. (:require [clojure.core.typed :as t] [clojure.spec.alpha :as s]) Thanks, Ambrose On Friday, October 13, 2017 at 6:56:34 PM UTC-4, Bost

Re: hello world question !!!

2017-10-13 Thread James Gatannah
This is really "just" a +1 for using Leiningen. TL;DR: Just start with `lein new app hello-world` and get an editor integrated with your REPL quickly. Come back to these sorts of things later, if/when you still think they're worthwhile. I came to clojure from the python/c++ world, with just eno

Re: hello world question !!!

2017-10-13 Thread James Gatannah
It's been a couple of years, but (from what I remember) it works great. Immutant (or maybe it's wildfly?) has an option to deploy "exploded .WAR files." I'm very fuzzy on the details, but it seems like the basic choices were either: 1) deploy an uberwar with AOT (advantage: faster startup time

Re: hello world question !!!

2017-10-13 Thread Alan Moore
Lolz, I actually liked the coffee to code autocorrect... the autocorrect machine learning algorithm was probably trained on the old joke about that very thing. Thanks for the laugh after the week I’ve endured... Alan -- You received this message because you are subscribed to the Google Groups