Re: Ratio implementation questions

2015-08-27 Thread waffletower
A workaround for integer types is totally trivial: (defn my-numerator [x] (if (ratio? x) (numerator x) x) ) (defn my-denominator [x] (if (ratio? x) (denominator x) 1) ) -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post

Re: Deploying Lein Template to Clojars

2015-08-27 Thread Matthew Molloy
Great, I was just typing the wrong password! On Friday, August 28, 2015 at 3:51:26 AM UTC+8, James Reeves wrote: > > The "org.clojars.username/project" naming scheme is generally for your own > projects, or your own forks, that you're not publicising for general use. > For instance, perhaps you

Re: Manifold questions: Creating sinks/sources

2015-08-27 Thread Atamert Ölçgen
On Thu, Aug 27, 2015 at 10:51 PM, Zach Tellman wrote: > Hi Atamert, > > Hi Zach, > For future reference, posting these questions to > https://groups.google.com/forum/#!forum/aleph-lib will ensure I'll see > them sooner. > I've subscribed. Thanks. > > The `source-only` method is just a way t

Re: Deploying Lein Template to Clojars

2015-08-27 Thread James Reeves
The "org.clojars.username/project" naming scheme is generally for your own projects, or your own forks, that you're not publicising for general use. For instance, perhaps you have a fork of Compojure, and decide to name it "org.clojars.whamlet/compojure". For Leiningen templates you should use the

Re: Manifold questions: Creating sinks/sources

2015-08-27 Thread Zach Tellman
Hi Atamert, For future reference, posting these questions to https://groups.google.com/forum/#!forum/aleph-lib will ensure I'll see them sooner. The `source-only` method is just a way to make sure that the chance for confusion is minimized, it doesn't prevent the underlying object from being

Re: [ANN] io.aviso/rook 0.1.36

2015-08-27 Thread Howard Lewis Ship
(defn ^:foo bar []) is equivalent to (defn ^{:foo true} bar []) is equvalent to (defn bar {:foo true} []) In the first two cases, the metadata is actually applied to the bar symbol (by the Clojure reader) and then copied over to the #'bar Var. In the latter case, the #'bar Var gets the metadata d

[ANN] io.aviso/pretty 0.1.19

2015-08-27 Thread Howard Lewis Ship
Pretty is a library for (among other things) printing Clojure stack traces, prettily. Changes in 0.1.19: Print a blank line before the exception output, when reporting a clojure.test exception. Previously, the first line was was on the same line as the "actual:" label, which interfered with colum

Re: [ANN] io.aviso/rook 0.1.36

2015-08-27 Thread Atamert Ölçgen
Got it, thanks. I think you still need to prepend ^'s to the metadata. On Thu, Aug 27, 2015 at 8:40 PM, Howard Lewis Ship wrote: > That's misleading. In the case of convention function names, (index, > show, create), there's default :route metadata that is used automatically > ... the docstrin

Re: [ANN] io.aviso/rook 0.1.36

2015-08-27 Thread Howard Lewis Ship
That's misleading. In the case of convention function names, (index, show, create), there's default :route metadata that is used automatically ... the docstrings are merely supplying a reminder. This is described in the "Getting Started" page: https://portal.aviso.io/#/document/open-source/rook/C

Re: [ANN] io.aviso/rook 0.1.36

2015-08-27 Thread Howard Lewis Ship
Rook is considerably more opinionated than Liberator and is based on extending the Ring metaphor: building up the functionality of the web application by introducing layers of middleware. The explicit goal is a mapping of URIs to endpoint functions within a namespace, and the introduction of custo

Re: My Zipper isn't deleting what I thought is going to delete

2015-08-27 Thread Moe Aboulkheir
Hussein, The previous example (from your other thread) worked, as it happened to involve removing the parents of nodes which match the predicate - the make-node function I'd given you worked more or less by accident in that one specific case, but not here. Apologies if you lost time due to my mis

Deploying Lein Template to Clojars

2015-08-27 Thread Matthew Molloy
According to the current documentation I create a leiningen plugin using the pattern (defproject your-template-name/lein-template "0.1.0-SNAPSHOT" however the clojars tutorial indicates that projects should be named as (defproject org.clojars.whamtet/too-hot "1.0.0" where whamtet is m

Re: Homoiconicity in Clojure - the broken promise

2015-08-27 Thread Olek
For the sake of simplicity. I've just define functions or macros which can appear in the data structure and simply call eval on that structure. The defined functions and macros has side effect which is println to the binded output stream. The example structure looks like this: (Stm

Re: Homoiconicity in Clojure - the broken promise

2015-08-27 Thread James Reeves
On 27 August 2015 at 10:31, Olek wrote: > > Today I fall into: > > java.lang.RuntimeException: java.lang.ClassFormatError: Invalid method > Code length 88118 in class file xxx$eval304 (xxx.clj:274) (xxx.clj:3) > > problem. > > The reason is that I tried to use data as code and just execute the >

Re: Homoiconicity in Clojure - the broken promise

2015-08-27 Thread Phillip Lord
Don't compile it, use the EDN reader instead. You can't do functions and that sort of thing, but the data structures will work. Phil Olek writes: > Hi! > > Today I fall into: > > java.lang.RuntimeException: java.lang.ClassFormatError: Invalid method > Code length 88118 in class file xxx$eva

Re: My Zipper isn't deleting what I thought is going to delete

2015-08-27 Thread Hussein B.
Thanks a lot Moe for your help. I always appreciate your patience and skills. Would you explain why your zipper works in this case? Thanks again. On Thursday, August 27, 2015 at 12:11:14 PM UTC+2, Moe Aboulkheir wrote: > > Hussein, > > Making this change to the zipper definition: > > (z/zippe

Manifold questions: Creating sinks/sources

2015-08-27 Thread Atamert Ölçgen
Hi, AFAIK the only way to create (just) a source (or sink) is: (def my-source (s/source-only (s/stream ...))) This results in creating a stream and then wrapping it with a SourceProxy. We don't keep a reference to the stream and the SourceProxy doesn't allow taking. But if I'm not missing somet

Re: My Zipper isn't deleting what I thought is going to delete

2015-08-27 Thread Moe Aboulkheir
Hussein, Making this change to the zipper definition: (z/zipper #(get % "children") #(get % "children") (fn [p c] (assoc p "children" c)) {"children" z}) looks like it'll do the right thing here. Take care, Moe On Thu, Aug 27, 2015 at 11:03 AM, Hussein B. wrote: > The modify function > > (def

Re: My Zipper isn't deleting what I thought is going to delete

2015-08-27 Thread Hussein B.
The modify function (defn modify [loc] (-> loc z/remove)) On Thursday, August 27, 2015 at 11:58:31 AM UTC+2, Hussein B. wrote: > > Hi, > > I'm trying to remove an element from nested data structure (nesting in > unknown, so I'm trying to come up with a generic solution: > > (def z [ >

My Zipper isn't deleting what I thought is going to delete

2015-08-27 Thread Hussein B.
Hi, I'm trying to remove an element from nested data structure (nesting in unknown, so I'm trying to come up with a generic solution: (def z [ {"a" {"b" 1 "c" 2} "children" [{"a" {"b" 3 "c" 4} "children" []}]} {"a" {"b" 5 "c" 6}

Homoiconicity in Clojure - the broken promise

2015-08-27 Thread Olek
Hi! Today I fall into: java.lang.RuntimeException: java.lang.ClassFormatError: Invalid method Code length 88118 in class file xxx$eval304 (xxx.clj:274) (xxx.clj:3) problem. The reason is that I tried to use data as code and just execute the slurped AST in order to produce another form of cod

Re: top-level lets or private globals

2015-08-27 Thread pmf
On Thursday, August 27, 2015 at 1:15:14 AM UTC+2, red...@gmail.com wrote: > > I have found the access control stuff in Java to be an incredible pain. > When attempting to compose a larger system from the parts. Generally > everything is compulsively private, so if an api doesn't exactly expose >

Re: [ANN] Grenada 1.0.0-rc.2

2015-08-27 Thread Chris Zheng
Hey Francesco, crossclj is a great project. I use it a lot and it’s actually the one tool that keeps references up to date. However, it’d be great if the source code is open sourced. Chris. > On 26 Aug 2015, at 12:43 pm, Francesco Bellomi > wrote: > > Hi Chris, > > CrossClj is similar in s

Re: Reviewers needed for new Clojure book!

2015-08-27 Thread Akhil Wali
Yes, "second Clojure book" is exactly what this book aims to be. Thanks for the overwhelming response, guys! On Thursday, August 27, 2015 at 12:27:56 PM UTC+5:30, Nathan Smutz wrote: > > It sounds like you're aiming for a good "second Clojure book." -- You received this message because you are