Re: [ANN] Envvar 1.1.0 — a library for handling environment variables

2014-08-14 Thread Constantine Vetoshev
On Thursday, August 14, 2014 2:53:30 AM UTC-7, Tony Tam wrote: > > It wasn't really clear to me from the README why use this instead of > environ. Care to explain a little more in detail? I.e. give a concrete use > case. > Any particular reason for not supporting .lein-env files? > Also, if a .en

Re: [ANN] Envvar 1.1.0 — a library for handling environment variables

2014-08-14 Thread Constantine Vetoshev
On Thursday, August 14, 2014 6:46:56 AM UTC-7, James Reeves wrote: > > You can do this with Environ. Leiningen checks for a profiles.clj in your > project directory, as well as then one in $HOME/.lein. If you add > profiles.clj to your .gitignore file, you can use it for local overrides > during

[ANN] Envvar 1.1.0 — a library for handling environment variables

2014-08-13 Thread Constantine Vetoshev
The JVM does not make using environment variables easy or convenient. The environ library took a step in the right direction by abstracting away the distinction between environment variables and Java properties into a Clojure map data structure. However,

[ANN] appengine-magic 0.4.6 released

2011-11-07 Thread Constantine Vetoshev
n update. Best, Constantine Vetoshev -- 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 unsubscr

Re: Exception handling changes in Clojure 1.3.0

2011-10-08 Thread Constantine Vetoshev
I finally came up with a simple example which shows the broken exception handling behavior I described in my earlier post on this thread. (defn broken-catch [filename] (try (java.io.FileReader. filename) (catch java.io.FileNotFoundException fnfe "FileNotFoundException caught")

Re: Exception handling changes in Clojure 1.3.0

2011-10-03 Thread Constantine Vetoshev
On Oct 3, 12:27 pm, Stuart Halloway wrote: > Catching checked exceptions seems to work fine. Try e.g. > > (try (throw (java.io.IOException.)) (catch java.io.IOException _ "caught!")) > > I suspect something else is going wrong in the GAE example. Can you > narrow the code down to a block you can q

Exception handling changes in Clojure 1.3.0

2011-10-03 Thread Constantine Vetoshev
I ran into an interesting problem while porting appengine-magic to Clojure 1.3.0. The Google App Engine SDK uses checked exceptions on many of its API methods. In many cases, I want to catch these exceptions and do something Clojure-friendly with them. With Clojure 1.2.x, I had no trouble catching

[ANN] appengine-magic 0.4.0: Clojure on Google App Engine

2011-03-27 Thread Constantine Vetoshev
/appengine-magic The library is available in Clojars. The README file fully documents the available API. Please note that this release includes several minor breaking changes; they are detailed in the HISTORY file. Comments, bug reports, questions, and patches welcome. Thanks, Constantine Vetoshev

Re: lein appengine-prepare

2011-03-21 Thread Constantine Vetoshev
On Mar 21, 7:05 am, Thorsten Wilms wrote: > nevermind, in the hours it's been since I send this mail, I fixed that > issue (a stray :main in my project file and the need to run "lein clean". > > On 03/21/2011 10:26 AM, Thorsten Wilms wrote: > > > > After working with appengine-magic a bit, I wante

Re: Help - .class files and GAE's "too many files" problem

2011-02-13 Thread Constantine Vetoshev
On Feb 10, 7:47 pm, Edgar Gonçalves wrote: > So for future reference, if you come up with the same issue, the solution is > to compile your gen'ed-classes and delete all the others from the > war/WEB-INF directory, making sure you have a standalone jar along the > remaining used jars (a uberjar ma

Re: Library and development process for GAE

2011-01-09 Thread Constantine Vetoshev
On Jan 9, 10:54 am, Stefan Kamphausen wrote: > Given that decision I'd like to understand the general development process.   > Does one always compile to a class (ns ...gen-class ..extends ..Servlet) and > will the appengine development server pick up the changes, or will I just > recompile a func

Re: Automatically unmapping unit tests from namespaces

2010-12-22 Thread Constantine Vetoshev
On Dec 21, 7:16 pm, Phil Hagelberg wrote: > If you're already using swank then you can try clojure-test-mode; it > clears out all deftests in between test runs. > > https://github.com/technomancy/clojure-mode/blob/master/clojure-test-... > > It also highlights failures in the test buffer for bette

Re: Free Compojure Hosting? (or mostly free)

2010-12-19 Thread Constantine Vetoshev
On Dec 18, 8:51 pm, javajosh wrote: > A little googling revealed that Google App Engine will work: App Engine very much works. Please use https://github.com/gcv/appengine-magic (and help me test the v0.4.0 branch, which adds support for the latest App Engine SDK). It's unfortunate that search res

Re: ANN: Dr. Evil - the evil web debugger

2010-11-30 Thread Constantine Vetoshev
On Nov 29, 2:25 pm, Miki wrote: > Yeah, it uses "load-string" which IMO default to clojure.core > namespace. > I've tried some namespace hacking to allow the user to define the > namespace, but couldn't make it work > (there's a FIXME in the code about that). > > Currently I using names with names

Re: ANN: Dr. Evil - the evil web debugger

2010-11-29 Thread Constantine Vetoshev
On Nov 22, 6:43 pm, Miki wrote: > >Dr.Evilis a simple web debugger that provides a REPL to your web > > application in a "hidden" location. This is pretty useful, thanks! I tried adding Dr. Evil into a test app, but I'm having trouble switching namespaces in the REPL: => *ns* # => (in-ns 'cv-te

Re: appengine-magic 0.3.0: Clojure on Google App Engine

2010-11-24 Thread Constantine Vetoshev
On Nov 24, 6:41 am, Vesa Marttila wrote: > I have a question about this release: I understood from this release > announcement that entities can be saved from the REPL, but I was not > able to do so and the official documentation still states that it > can't be > done, which is the case? You can'

[ANN] appengine-magic 0.3.0: Clojure on Google App Engine

2010-11-23 Thread Constantine Vetoshev
Clojars. The README file fully documents the available API. Comments, bug reports, questions, and patches welcome. Thanks, Constantine Vetoshev -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email

Re: appengine-magic: using Clojure with Google App Engine

2010-10-06 Thread Constantine Vetoshev
On Oct 4, 10:52 pm, Glen Stampoultzis wrote: > On 21 September 2010 07:15, Constantine Vetoshev wrote: > > I'd like to announce the release of a working version of appengine- > > magic, a library designed to make it easier to get started with Google > > App Engine

VerifyError with symbol metadata, macros, and defrecord

2010-09-26 Thread Constantine Vetoshev
In Clojure 1.2, compiling the code below blows up with: error: java.lang.VerifyError: (class: t1/core/One, method: signature: ()V) Incompatible argument to function (core.clj:11) Something about this problem causes damage to the running Clojure process. Once the exception happens, changing the m

[ANN] appengine-magic: using Clojure with Google App Engine

2010-09-20 Thread Constantine Vetoshev
e, as always. Constantine Vetoshev -- 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 u

Re: Making Clojure really work with Google App Engine

2010-09-20 Thread Constantine Vetoshev
On Sep 20, 9:17 am, Stefan Kamphausen wrote: > So it might be a good idea to avoid creating threads automatically or > importing file/socket packages. I think you're right. Dependencies are always a double-edged sword, and in the case of App Engine, they are more toxic than usual. Anyway, I elimi

Making Clojure really work with Google App Engine

2010-09-19 Thread Constantine Vetoshev
I recently spent some time trying to abstract away some of the incidental complexity of using Google App Engine with Clojure. Right now, setting up interactive development and understanding what to do requires reading several blog posts, and pasting in a lot of boilerplate code. I ended up making a

Re: Extending Clojure's STM with external transactions

2010-09-07 Thread Constantine Vetoshev
On Sep 5, 8:56 pm, Alyssa Kwan wrote: > Any thoughts on how to marshal functions? What about vars and dynamic > binding? I don't think marshaling closures will ever happen without changes to Clojure itself. I haven't looked into how much work it would require, or how much it would impact Clojure'

Re: Extending Clojure's STM with external transactions

2010-09-05 Thread Constantine Vetoshev
On Aug 30, 5:02 pm, nchubrich wrote: > Persistence libraries always end up warping the entire codebase; I've > never succeeded in keeping them at bay.  Using data with Incanter is > different from ClojureQL, which is different from just using > contrib.sql, and all of it is different from dealing

Re: My non-ELPA Emacs swank-clojure setup

2010-04-11 Thread Constantine Vetoshev
This thread encouraged me to post what I did to make swank-clojure 1.1.0 work with the the latest SLIME. It does not use any of swank- clojure's automatic .jar downloading features (as of version 1.1.0). These instructions won't work on Windows, but may work if you have Cygwin. Note that this sets

Re: My non-ELPA Emacs swank-clojure setup

2010-04-11 Thread Constantine Vetoshev
On Apr 8, 12:45 pm, Ævar Arnfjörð Bjarmason wrote: > If I have 10 Clojure projects I'm going to have 10 src/clojure.jar > files. Do they really need to be there or could I just use the clojure > that comes with my operating system (Debian)? > > When I hack Common Lisp I don't copy sbcl into all my

Re: Clojure for financial applications

2010-03-09 Thread Constantine Vetoshev
On Mar 8, 11:50 am, Jonathan Shore wrote: > How would I encapsulate this into a data structure to be passed into > functions efficiently?    I could use a map of symbols to various structures, > but that would be inefficient in access and memory.   I could bind into a > closure but then how do

Re: Prepping clojure for packaging (was: Re: Clojure for system administration)

2010-02-06 Thread Constantine Vetoshev
On Feb 6, 1:06 pm, Peter Schuller wrote: > But the practical issue > remains that if I want to write some software that I want sysadmins in > various situations to want to use effortlessly (in my case, a backup > tool), problems like these do get in the way of choosing Clojure. > > Maybe uberjars

Re: ANN: dgraph 1.0, a dependency graph library for Clojure

2010-01-19 Thread Constantine Vetoshev
On Jan 18, 2:14 am, mac wrote: > Updating stuff in the map became a little bit of a hassle so I made > versions of assoc-in and update-in that work on dgraphs. Here they are > in case anyone else is interested: > > (defn assoc-node >   [dgraph m ks v] >   (dgraph m (assoc-in (dgraph m) ks v))) > >

Re: ANN: dgraph 1.0, a dependency graph library for Clojure

2010-01-17 Thread Constantine Vetoshev
On Jan 17, 4:05 am, Albert Cardona wrote: > The link gives a "not found"--did you push? I did, but then I moved the examples directory around to make everything more Leiningen-layout-friendly. Here is the updated link: http://github.com/gcv/dgraph/blob/master/examples/examples/dgraph/swing.clj P

Re: ANN: dgraph 1.0, a dependency graph library for Clojure

2010-01-16 Thread Constantine Vetoshev
On Jan 16, 4:01 am, mac wrote: > I am just now in a situation where I have to do some swing programming > and this seems like it has great potential! > Since it's already version 1.0 you should put it on Clojars so that it > is easier to use from leiningen or maven etc. Good call. I just put it u

Re: ANN: dgraph 1.0, a dependency graph library for Clojure

2010-01-15 Thread Constantine Vetoshev
On Jan 15, 5:59 am, Laurent PETIT wrote: > I would like to know, is there an essential reason for not having > stored the dependency graph as a hidden property of the graph ? I'm not sure I understand your question. You can see the stored graph if you take the function returned by dg/make-dgraph

Re: ANN: dgraph 1.0, a dependency graph library for Clojure

2010-01-15 Thread Constantine Vetoshev
On Jan 14, 7:29 pm, Timothy Pratley wrote: > To give me a > head-start, are there key differences with clojure.contrib.dataflow so > I can better understand? Thank you for your interest. I have not extensively used c.c.dataflow, so I apologize if I misrepresent it, but here are some key differenc

ANN: dgraph 1.0, a dependency graph library for Clojure

2010-01-14 Thread Constantine Vetoshev
ing, and it has helped reduce the pain significantly. The README file in the GitHub repository has some usage examples and ideas. Comments and bug reports welcome. Thanks, Constantine Vetoshev -- You received this message because you are subscribed to the Google Groups "Clojure" group. To

Re: Clojure + Redis

2009-12-31 Thread Constantine Vetoshev
On Dec 30, 10:40 am, Robert Campbell wrote: > I think anything which lowers the impedance mismatch between Clojure > data structures and a persistent store is worth investigating. I'd > love to find an ACID, transactional store which accepts native > structures. Have you looked at Cupboard (http:

Re: Clojure as a first programming language?

2009-12-01 Thread Constantine Vetoshev
On Dec 1, 12:38 am, Towle wrote: > So after shopping around > thoroughly and picking up bits about on theoretical computer science > and the history of programming languages, I decided to pick up a Lisp; > I'm intrigued by the greater concept/idea behind the Lisp family of > languages. In your re

Re: A macro for flexible keyword argument handling

2009-11-20 Thread Constantine Vetoshev
On Nov 20, 8:33 am, nchubrich wrote: > I guess this is getting to be a pretty epic macro!  I figured it was > worth inviting boos and/or cheers and suggestions before setting out... Far be it from me to discourage making function invocation semantics more flexible! Just one thing: you've been cal

Re: A macro for flexible keyword argument handling

2009-11-18 Thread Constantine Vetoshev
On Nov 17, 11:33 pm, nchubrich wrote: > can it be any more > general or minimal than this? Seems to me that your suggestion effectively makes every positional argument optional. You did note that the scheme calls for supplied- predicates, but this pushes responsibility for checking required argum

Re: SLIME REPL broken

2009-11-17 Thread Constantine Vetoshev
On Nov 17, 2:52 pm, David Nolen wrote: > Thanks for pursuing this so adamantly :) For a long time (more than a year) > it was possible to use SLIME tip. It would be great for that to continue. You can still use SLIME; just avoid the slime-autodoc contrib. Use (slime-setup '(slime-repl)) to init

Re: A macro for flexible keyword argument handling

2009-11-17 Thread Constantine Vetoshev
On Nov 16, 4:28 pm, Chouser wrote: > 'let' is also careful to always have the user provide the symbol > being bound as a symbol.  That is you say {:keys [a b c]} not > {:keys [:a :b :c]}.  What do you think of having let-kw take > symbols instead of keywords for the names being bound? I think tha

Re: A macro for flexible keyword argument handling

2009-11-16 Thread Constantine Vetoshev
1. Looks like everyone prefers the let-kw name. Sounds good to me. 2. I tried it with the more let-like form, but I don't like the number of opening braces required. For a full kw-spec, the form would end up (let-kw [[[:kw default supplied?]] kw-args] ...). Clojure tends to err on the side of fewe

Re: A macro for flexible keyword argument handling

2009-11-15 Thread Constantine Vetoshev
Looks like Google Groups posting software forced line wraps at less than 80 columns, breaking the code. Lovely. Here's the fn-keywords macro reformatted for 72 column wrapping. (defmacro fn-keywords "Adds flexible keyword handling to any form which has a parameter list: fn, defn, defmethod, l

A macro for flexible keyword argument handling

2009-11-15 Thread Constantine Vetoshev
rds [:kw1 :kw2] kw-args {:req1 req1 :kw1 kw1 :kw2 kw2})) ([req1 req2 kw-args] (fn-keywords [:kw1 :kw2] kw-args {:req1 req1 :req2 req2 :kw1 kw1 :kw2 kw2}))) (defn test4 [] (letfn [(inner [& kw-args] (fn-keywords [:kw1 :kw2] kw-args {:kw1 kw1 :kw2

Re: Datatypes and Protocols - early experience program

2009-11-13 Thread Constantine Vetoshev
PersistentMap, but I'm curious about the reasoning for not making maps part of the default nature of deftype. Making IPersistentMap the default could also make deftype a nearly drop-in replacement for defstruct. Thanks, Constantine Vetoshev -- You received this message because you are subscrib

ANN: Cupboard, an embedded database library for Clojure

2009-10-15 Thread Constantine Vetoshev
familiarity with Berkeley DB will help, but is not required. All comments and bug reports welcome. Thanks, Constantine Vetoshev --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this g

Re: Macros, namespaces, and lexical scope

2009-09-26 Thread Constantine Vetoshev
On Sep 26, 7:35 am, Meikel Brandmeyer wrote: > The problem is, that you quote the symbol you inject into the inner > defmacro. Hence it does not get resolved. The solution in this case > seems to be to syntax-quote the symbol correctly before injection. > Replace the two ~'~ with ~~ and call the

Re: Macros, namespaces, and lexical scope

2009-09-25 Thread Constantine Vetoshev
On Sep 25, 6:02 pm, John Harrop wrote: > I don't think you can use things like defmacro in a let. This works: (let [y 10] (defmacro m1 [] `(list ~y))) (m1) => (10) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Gr

Macros, namespaces, and lexical scope

2009-09-25 Thread Constantine Vetoshev
(I asked these questions on #clojure, and the friendly locals suggested I open the question up for a wider audience.) I'm trying to write a macro-writing-macro. My code has a bunch of resources which have -open and -close type of calls, and they could all benefit from with- wrappers. The with- wr

Re: "Schema" for data structures

2009-09-24 Thread Constantine Vetoshev
On Sep 24, 10:59 am, Miron Brezuleanu wrote: > Well, I only want to enforce duck-typing :-) - for instance, make sure > via unit tests that a function that should return a data structure > with certain properties always returns such a data structure. Not exactly what you asked for, but I added a

Re: Redefining Special Forms

2009-09-18 Thread Constantine Vetoshev
On Sep 17, 2:55 pm, Chouser wrote: > In a new thread, vars always start with their root binding. > > There's an ongoing discussion about the best way to provide > other options when this is not the desired behavior: > > http://www.assembla.com/spaces/clojure/tickets/170-bound-fn-macro That discu

Re: Correct idiom for looping inside a catch or finally form?

2009-09-13 Thread Constantine Vetoshev
On Sep 13, 11:18 pm, Richard Newman wrote: > I think the OP's issue was that he has a sequence of things to close,   > determined at runtime. with-open itself is no use there, because the   > things to close must be known at compile-time. Exactly. > He is correct that finally and catch do not p

Re: Correct idiom for looping inside a catch or finally form?

2009-09-13 Thread Constantine Vetoshev
an atom as a temporary variable. please don't do that. > > (doseq [f files] >   (with-open [of (open-file f)] >     (do-dangerous-io of))) > > On Sun, Sep 13, 2009 at 1:05 PM, Constantine Vetoshev > > > > wrote: > > > I have some code which opens a bu

Correct idiom for looping inside a catch or finally form?

2009-09-13 Thread Constantine Vetoshev
I have some code which opens a bunch of resources (say, files), and needs to make sure they all get closed. Something like this: (let [files (atom [])] (try (open-my-many-files files) ;; the files atom now refers to a vector of open file handles (do-dangerous-io @files) (finally

Inheriting Clojure special variables in child threads

2009-08-18 Thread Constantine Vetoshev
currency situation, where any thread can alter a def'ed global variable for any other thread. If the thread starts in a binding*, it would, at worst, affect itself and its children. Seems useful. Any comments? Is this possible? How difficult would this be to implement? Best