Re: Om design query

2015-03-05 Thread Dave Della Costa
(cc'ing clojurescr...@googlegroups.com)

Hi James,

Let me make sure I understand what you're asking: you have a parent
enclosing component that has to do calculations to position a set of
child component element, but you can only properly calculate positioning
for those child elements (in the parent?) after you get offset position
information for each one, once they have mounted?

DD


On 2015/03/06 13:40, James Reeves wrote:
> I've been writing an application using Om, and I've come across a
> problem I haven't been able to find a good solution for. I'd be grateful
> for any ideas people might have on how to proceed.
> 
> In a nutshell, I have a bunch of elements that need to be arranged
> according to a specific algorithm. They cannot overlap, so I need to
> know the sizes of all the elements in order to arrange them.
> 
> Om has an IDidMount protocol which is called after the component has
> been mounted into the DOM. I can use this to find out the size of the
> element:
> 
> (let [node (get-node owner)]
>   [(.-offsetWidth node) (.-offsetHeight node)])
> 
> Elements can be hidden with "visibility: hidden" until their sizes are
> known.
> 
> The problem that's stumping me is how to deliver the sizes back to the
> containing component so that all the elements can be arranged correctly.
> 
> The most obvious way is via the cursor, but I don't like the idea of
> mixing application state with local display information. Can anyone
> think of a better way?
> 
> - James
> 
> -- 
> 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] Understanding the Persistent Vector

2015-03-02 Thread Dave Della Costa
This is wonderful, I can't wait to dig in!

On 2015/03/01 1:14, Jean Niklas L'orange wrote:
> Hello fellow Clojurians,
> 
> I am happy to announce that I have finished my blogpost series on the
> persistent
> vector. It consists of five parts:
> 
>  1. The basic algorithms
> 
>  2. Indexing
> 
>  3. The tail optimisation
> 
>  4. Transients
> 
>  5. Performance
> 
> (which is a summary of this detailed blogpost
> )
> 
> I hope this will help you to get a good understanding of how the
> algorithms on
> the data structure work, how the optimisations work, and how efficient
> it is on
> the JVM.
> 
> Constructive criticism, both positive and negative, is appreciated.
> 
> Enjoy!
> 
> (NB: I haven't gotten around to fix the illustrations in part 3, so
> unfortunately it will be a bit hard to read if you print it out in
> grayscale.
> It's on my todo-list.)
> 
> -- Jean Niklas L'orange
> 
> -- 
> 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: TDD and lein

2015-01-08 Thread Dave Della Costa
One more suggestion as you mentioned wanting to see more output,
although this may be different from what you were asking--but still
worth knowing about:

https://github.com/pjstadig/humane-test-output

Cheers,

DD

On 2015/01/08 20:30, andrea crotti wrote:
> Hi guys,
> 
> I'm starting to use Clojure a bit more seriously, I knew already Lisp a
> bit and Haskell, in plus I've been using Emacs for a long time so
> luckily it's not as hard, and it's a lot of fun.
> 
> I'm using Emacs + Cider for development and it works wonderfully,
> however I have a few problems/questions trying to do TDD.
> 
> 1. Isn't it possible to make Lein more verbose?
> 
>It's often quite slow and it would be nice to know what is going
>on, I can stand the slowness but at least tell me something :D
> 
> 2. When is exactly that I need to run again "lein test" (which is
>painfully slow) and when just rerunning the tests from the same REPL
>suffice?
> 
>I thought only when changing dependencies, but I had different
>experiences so I'm not too sure about the rule.
> 
>And what command exactly is Cider triggering when I run the tests?
>It would be nice to be able to see somewhere more information like:
>- compiling file x
>- running tests for y with command z
> 
>  3. Does incremental compilation work well/make sense for Clojure?
> I found something but the fact that it's not done straight away in
> Leiningen makes me think it's maybe not much used?
> 
> Thanks a lot, and congratulations to all the developers for the great 
> language!
> 

-- 
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: Implementing a Oauth2 provider with clauth and friend

2014-12-15 Thread Dave Della Costa
I'm a bit confused--if you are building your own oauth2 server (correct
me if I misunderstood--you want users to use oauth2 to authenticate
against your own service?), what purpose does a Friend workflow have in
this context?  Seems like you could skip Friend altogether.

DD

(2014/12/15 17:40), Sebastian Bensusan wrote:
> Hi Dave, 
> 
> I am planning to use friend-oauth2 to handle "third party workflows". It
> is exactly what I need to consume third party oauth services, but from
> what I understood from the source code, it doesn't help me offer my own
> oauth service. I'm struggling with the design for an oauth service that
> integrates directly with friend.
> 
> Thanks for your answer!
> 
> Sebastian
> 
> On Monday, December 15, 2014 6:58:55 AM UTC+1, David Della Costa wrote:
> 
> You could also take a look at friend-oauth2 if you are using it in the
> context of Friend--if it doesn't work for you for some reason I'd like
> to know why, as I'd like it to be able to handle this use-case.
> 
> https://github.com/ddellacosta/friend-oauth2
> 
> 
> Thanks!
> 
> DD
> 
> (2014/12/15 3:08), Sebastian Bensusan wrote:
> > Hi,
> >
> > I am writing a Single Page Application using Om that communicates via
> > XHR with a REST API using compojure + liberator. I should be able to
> > authenticate users by using email & password credentials or third
> party
> > Oauth2 like Linkedin's. I
> >
> > My plan is: use clauth [1] to roll my own oauth2, package it as a
> friend
> > credential-fn/workflow, and then wrap the liberator api with
> > friend [2]  and the third parties workflows.
> >
> > Anybody has any pointers on how to do this? It is a complex
> solution but
> > I have no ideas on how to simplify it.
> >
> > Thanks for your time!
> >
> > Sebastian
> >
> > [1] https://github.com/pelle/clauth 
> > [2]
> 
> http://sritchie.github.io/2014/01/17/api-authentication-with-liberator-and-friend/
> 
> 
> 
> >
> > --
> > 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=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/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: Implementing a Oauth2 provider with clauth and friend

2014-12-14 Thread Dave Della Costa
You could also take a look at friend-oauth2 if you are using it in the
context of Friend--if it doesn't work for you for some reason I'd like
to know why, as I'd like it to be able to handle this use-case.

https://github.com/ddellacosta/friend-oauth2

Thanks!

DD

(2014/12/15 3:08), Sebastian Bensusan wrote:
> Hi,
> 
> I am writing a Single Page Application using Om that communicates via
> XHR with a REST API using compojure + liberator. I should be able to
> authenticate users by using email & password credentials or third party
> Oauth2 like Linkedin's. I
> 
> My plan is: use clauth [1] to roll my own oauth2, package it as a friend
> credential-fn/workflow, and then wrap the liberator api with
> friend [2]  and the third parties workflows.
> 
> Anybody has any pointers on how to do this? It is a complex solution but
> I have no ideas on how to simplify it. 
> 
> Thanks for your time!
> 
> Sebastian
> 
> [1] https://github.com/pelle/clauth
> [2] 
> http://sritchie.github.io/2014/01/17/api-authentication-with-liberator-and-friend/
> 
> -- 
> 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: what do you think about this code?

2014-12-09 Thread Dave Della Costa
Hi Philip,

I think Colin gave a good response further down the thread, in
particular I think his statement "I at least have found Clojure has a
much higher signal to noise ratio..and can provide a
significant reduction in incidental complexity, thus reducing the
problem that some of these approaches are solving" is pertinent here.

I'll expand on my interpretation of that a bit.  But first let me say
that I'm pretty familiar with Uncle Bob, extreme programming and Agile
development and the set of practices associated with those labels.  I
have been, in fact, a passionate advocate of extreme programming
practices at times in the past.  I do think there is a lot of value
there, and I think every professional developer who has to work on teams
and maintain code should seriously engage with that set of practices to
try to understand the value.

That said, there is also a lot of dogma and unquestioned convention in
that community.  I find Uncle Bob in particular to be frustrating in his
rigidity, even when I agree with many specific points he makes.  More
relevant to the discussion at hand, since I've been using functional
programming approaches, I've developed a more flexible attitude to what
it means to "do development The Right Way."

So first off, I would like to point out that I had no comments in my
code--but I did document my functions with doc strings.  I suppose the
point about fragility stands, but on the other hand I am consistently
frustrated when developers fail to document their public-facing
libraries, and I think good documentation is a hallmark of high-quality
software.  So I guess what I'm saying is that I've accepted there is
value in writing about your code vs. (or in addition to) simply letting
your code speak for itself, despite its cost; the value outweighs this
cost.  The analogy image of the mislabeled container you attached, while
clever, breaks down for me here: someone hasn't met all of their
responsibilities.

At the same time I do not disagree with the essence of what Uncle Bob
says regarding comments: code that isn't clear and needs heavy
commenting is *probably* problematic.  However, I think the solution in
functional languages is to lean heavily on the core persistent data
structures and associated functions, use pure functions as much as
possible and make it clear when you are not, specify types (in Clojure
we can use schema or core.typed for this), and finally let the data do
the talking.

Regarding TDD: as I said I do use TDD in a professional setting, but not
consistently: I don't think it is consistently necessary, and more than
anything, the central argument of a lot of TDD apologists--that it helps
guide design--seems much less compelling when using a functional
approach.  I haven't gotten enough clarity in my own mind as to why
exactly this is yet, so I'll leave it at that--but let it suffice to say
that I think TDD's biggest value in my day-to-day work in Clojure is in
"automatically" providing a suite of regression tests, not providing
design guidance.

Finally, I would add that I agree with Kent Beck's points you listed at
the end--I would simply argue that it's not necessarily the case that
following Uncle Bob's stringent guidelines (for example) are the way to
achieve those goals when using Clojure or doing functional programming
in general.

Thanks for making me think hard about this--I haven't tried to
crystallize what I've learned since starting down this path a few years
ago, and it's really valuable to think hard on it!  Making high quality,
maintainable software is challenging and deserves careful thought.

Best,
Dave

(2014/12/09 9:24), Philip Schwarz wrote:
> Hello David,
> 
> I had set myself the constraint that I wanted the solution to exploit
> two symmetries: 
> (1) The top left and top right of the diamond are mirror images
> (2) The top half and bottom half of the diamond are also mirror images
> 
>>I'm assuming you used a TDD process to write this (correct me if
> wrong--basing that on the articles you linked to)
> I was on a train commuting back home, and what I did was sit in a loop
> where I wrote some code and then tweaked it until executing it in the
> REPL gave me the part of the diamond that I wanted, by eyeballing the
> console output. What a coincidence that in your gist you linked
> to http://blog.jayfields.com/2014/01/repl-driven-development.html . I
> was looking at exactly that blog post on Sunday to determine if what I
> had been doing could be classified as REPL-based? Still not sure. Thoughts?
> 
> My first version of the code was this
> : 
> 
> (defn print-diamond [letter]
> (let [alphabet "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
> position-of (fn [letter] (inc (- (int letter) (int \A
> number-of-letters (position-of letter)
> dashes (fn [n] (repeat n \-))
> fixed-text-for (fn [letter] (concat (dashes (dec (position-of letter)))
> (list letter)))
> template (map fixed-text-for 

Re: snubbed on clojurescript one

2014-11-17 Thread Dave Della Costa
Hi Kevin, my understanding is that ClojureScript One is not actively
maintained and pretty out of date at this point.  You're probably better
suited to starting from a different place in the eco-system.

What are your goals in using ClojureScript?  If you want to describe a
bit what you're after (i.e. just getting up and running with
ClojureScript, building web clients, etc.), then I think folks on the
list can give you a lot of suggestions.

/cc clojurescr...@googlegroups.com

DD

(2014/11/18 15:39), Kevin Banjo wrote:
> Really excited to use clojurescript one but got shot down right out of
> the gate.
> 
> Anyone here have the answer?
> 
> https://github.com/brentonashworth/one/issues/145
> 
> 
> -- 
> 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: [JOB] Clojure DevOps Engineer

2014-10-30 Thread Dave Della Costa
FYI folks, Alex (akhudek) and I (ddellacosta) hang out on IRC often so
feel free to ping us w/questions there.

Thanks!

DD

(2014/10/31 12:28), Alexander Hudek wrote:
> Note that this position is 50% Clojure development and 50% DevOps/Sysadmin.
> 
> 
> Best,
> 
> Alex
> 
> 
> --
> 
> 
> CLOJURE DEVOPS
> 
> 
> DiligenceEngine Inc. is a Toronto-based startup using machine learning
> to automate legal work. We’re looking for a DevOps engineer to help us
> manage and automate our technology stack. Our team is small, pragmatic,
> and inquisitive; we love learning new technologies and balance adoption
> with good analysis. We prefer to hire in the Toronto area, but also
> welcome remote work in a time zone within North America.
> 
> 
> Primary skills we are looking for:
> 
>   *
> 
> proficiency with scripting for automating tasks (we use Python and a
> bit of Bash)
> 
>   *
> 
> proficiency in Linux systems administration
> 
>   *
> 
> knowledge of system security
> 
>   *
> 
> proficiency with PostgreSQL administration
> 
>   *
> 
> knowledge of managing clusters and highly available systems,
> especially PostgreSQL
> 
> 
> Skills that are nice to have:
> 
>   *
> 
> some Clojure experience
> 
>   *
> 
> familiarity with Docker
> 
>   *
> 
> building distributable virtual machines
> 
> 
> Responsibilities:
> 
>   *
> 
> approximately 50% systems administration and 50% development
> 
>   *
> 
> required to be on-call at sometimes
> 
>   *
> 
> maintaining and extending cluster manager software
> 
>   *
> 
> automating build and deployment processes
> 
>   *
> 
> automating testing processes
> 
> 
> Don’t worry if you are only experimenting with Clojure or other nice to
> have skills, we’re happy to help you learn. Development tasks vary
> depending on your strengths and interests. Everything from working with
> our clustering software to the web service is an option.  We are really
> interested in someone who sees an opportunity to automate something,
> helps us work out the kinks, and takes the initiative and does it.
> 
> 
> This position starts as soon as possible.
> 
> 
> To apply, send an email to j...@diligenceengine.com with your resume and
> links to previous 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.

-- 
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: CCW bug [SEVERE]

2014-10-25 Thread Dave Della Costa
Here's the counterclockwise project home page, as far as I can tell:

https://code.google.com/p/counterclockwise/

Issue tracker:

https://code.google.com/p/counterclockwise/issues/list

Users google group:

https://groups.google.com/forum/#!forum/clojuredev-users

I think you'd get a lot more mileage by posting something there, and I
think you'd also get a better response if you could express the problem
you're having calmly (i.e., leave off the all caps and "goddamn save"
language).  I also suspect the developers of CCW would be equally
horrified at your experience, and would probably love to have your help
in debugging it and fixing it, if you're willing.

Good luck resolving the issue--

DD

(2014/10/26 14:45), Fluid Dynamics wrote:
> On Sunday, October 26, 2014 1:04:49 AM UTC-4, danneu wrote:
> 
> Fluid Dynamics wrote:
> 
> I do not ever want to see anything purportedly "STABLE" do
> something like that ever again 
> 
> 
> There are a lot of things I do not ever want to see.
> 
> I don't want to see debt collectors or clojure stacktraces or my
> uncle Frank.
> 
> Unfortunately, demanding that I don't see them is not what moves the
> needle
> towards eliminating them from my life.
> 
> 
> Unfortunately, since I am not the CCW developer nor do I have the time
> or inclination to spend 3 months poring over and learning its code base
> to get up to sufficient speed to fix bugs in it myself, demanding that
> it not crash is all I can do to eliminate CCW crashes from my life.
> 
> -- 
> 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 equivalent of 3-level enumeration in Ruby?

2014-06-20 Thread Dave Della Costa
Sorry, the first example fn is confusing--I'd probably use assoc rather
than update-in:

>   (reduce #(assoc %1 %2 (do-aspected-stuff ...)) {} personals))


(2014/06/20 22:28), Dave Della Costa wrote:
> Rather than start with the code you are trying to duplicate, consider
> the data structure(s) that you have as input and the data structure you
> want to end up with.
> 
> It's certainly possible to emulate the kind of nested loop structure you
> are asking about in Clojure, but most likely it's not how you'd
> structure the solution in the first place.  For one, the Ruby example
> heavily depends on mutability, which is not as common in Clojure-land.
> 
> But here's one "rough sketch," just as a simple example:
> 
> I might make personals and aspected vectors of keywords, and I'd end up
> doing something more like
> 
> (def find-aspects
>   [astro-data]
>   (reduce #(update-in %1 [%2] (do-aspected-stuff ...)) {} personals))
> 
> With do-aspected-stuff being something like:
> 
> (defn do-aspected-stuff
>   [personal-key astro-data]
>   (reduce #(if (= personal-key %2) %1 (calc-angles astro-data %1 %2)) {}
> aspected))
> 
> and so on and so forth with calc-angles doing its own looping thing with
> all the calculations you have to do (glossing over the rest as hopefully
> you get the picture at this point), and everything gets deposited in the
> hash-map at the very top of the chain at the end.
> 
> Hope this helps.
> 
> DD
> 
> (2014/06/20 22:11), gvim wrote:
>> On 20/06/2014 13:38, Timothy Baldridge wrote:
>>> Care to explain? How does it get much simpler than:
>>>
>>> (for [x some-collection
>>> y x
>>>z y]
>>>z)
>>>
>>
>> Because it's 3 levels deep and requires substituting the vars back into
>> maps to then create a returned map. Your for example doesn't emulate
>> Ruby's each_with_index, as in the example, as far as I'm aware. I'm
>> fairly new to Clojure so the obvious may not be so obvious to me yet :)
>>
>> gvim
>>

-- 
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 equivalent of 3-level enumeration in Ruby?

2014-06-20 Thread Dave Della Costa
Rather than start with the code you are trying to duplicate, consider
the data structure(s) that you have as input and the data structure you
want to end up with.

It's certainly possible to emulate the kind of nested loop structure you
are asking about in Clojure, but most likely it's not how you'd
structure the solution in the first place.  For one, the Ruby example
heavily depends on mutability, which is not as common in Clojure-land.

But here's one "rough sketch," just as a simple example:

I might make personals and aspected vectors of keywords, and I'd end up
doing something more like

(def find-aspects
  [astro-data]
  (reduce #(update-in %1 [%2] (do-aspected-stuff ...)) {} personals))

With do-aspected-stuff being something like:

(defn do-aspected-stuff
  [personal-key astro-data]
  (reduce #(if (= personal-key %2) %1 (calc-angles astro-data %1 %2)) {}
aspected))

and so on and so forth with calc-angles doing its own looping thing with
all the calculations you have to do (glossing over the rest as hopefully
you get the picture at this point), and everything gets deposited in the
hash-map at the very top of the chain at the end.

Hope this helps.

DD

(2014/06/20 22:11), gvim wrote:
> On 20/06/2014 13:38, Timothy Baldridge wrote:
>> Care to explain? How does it get much simpler than:
>>
>> (for [x some-collection
>> y x
>>z y]
>>z)
>>
> 
> Because it's 3 levels deep and requires substituting the vars back into
> maps to then create a returned map. Your for example doesn't emulate
> Ruby's each_with_index, as in the example, as far as I'm aware. I'm
> fairly new to Clojure so the obvious may not be so obvious to me yet :)
> 
> gvim
> 

-- 
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:Lisp :: LSD:Meditation

2014-06-13 Thread Dave Della Costa
You raise a good point, which is that I don't know what the group policy
is or where it's posted.  I just see this in the header on the google
groups page:

"Welcome to the Clojure mailing list. Please note that posts by new
members are moderated to prevent spam."

Anyone know better than this?

(2014/06/13 18:50), Josh Kamau wrote:
> If i were to be asked, i would restrict the group to: 
> 1. Any type of question that is related to clojure 
> 2. Any type of announcement on clojure core library
> 3. Any new library/version 
> 4. Any link to a narration on real life usages (e.g how we did xyz with
> clojure) or benchmarks  (generally hard facts )
> 5. Any link to new book, tutorial, training materials. 
> 
> This is just my opinion, I dont know the group policy and may be its all
> up to me to choose what i want to read and what i dont want to and
> probably keep my feelings to myself ;) 
> 
> Josh
> 
> 
> On Fri, Jun 13, 2014 at 12:34 PM, Dave Della Costa
> mailto:ddellaco...@gmail.com>> wrote:
> 
> I'm not sure what the problem is here.  I've posted personal blog links
> before that were Clojure related; I sincerely thought that it was
> potentially useful to the group, and I more or less got responses that
> supported that.
> 
> That being the case, I'm having a hard time understanding what is so
> different about my blog post and Divyansh's; as far as I can tell, this
> post is relevant to Clojure, even if it's a bit more...exploratory.  It
> has Clojure code examples, it talks about Common Lisp and Python and
> metaprogramming.  It's clearly not random spam.
> 
> So it seems to me that some folks simply don't like the content; that's
> fine, but I think it's a stretch to say that it's not appropriate for
> this list.  Or if it is not appropriate, then even relevant blog posts
> should never be appropriate, and arguably stuff like, say, epic
> ruminations on the nature of literate programming would arguably be even
> less appropriate for the list.
> 
> DD
> 
> (2014/06/13 11:25), Gary Trakhman wrote:
> > To be fair, I actually read the thing, but I hoped to see more
> > interesting information on LSD, meditation and Clojure than the
> headline
> > would suggest :-).
> >
> >
> > On Thu, Jun 12, 2014 at 10:01 PM, Atamert Ölçgen  <mailto:mu...@muhuk.com>
> > <mailto:mu...@muhuk.com <mailto:mu...@muhuk.com>>> wrote:
> >
> > There's also Planet Clojure <http://clojure.in/>.
> >
> > @Divyansh
> >
> > Josh, Hussein and Gary are not the only ones who think this
> sort of
> > traffic building is uncool. By traffic building I mean; sending a
> > message with a link that has no valuable information for the group
> > members. They are probably just nodding their head and
> thinking that
> > sending another response is not necessary. At least that's what I
> > did before I saw your response.
> >
> > 90% of the messages in this group doesn't interest me. That's
> fine.
> > Valuable information for someone else. But I certainly
> wouldn't want
> > everybody to post their blogs here regularly. Because each message
> > is a tiny little distraction. I'm willing to pay the price because
> > when a really cool library is announced for example, I get a big
> > reward. Let's keep the benefit/cost ratio, time-wise &
> > attention-wise, high.
> >
> >
> >
> >
> > On Thu, Jun 12, 2014 at 10:05 PM, Gary Trakhman
> > mailto:gary.trakh...@gmail.com>
> <mailto:gary.trakh...@gmail.com <mailto:gary.trakh...@gmail.com>>>
> wrote:
> >
> > Twitter's a more organic way to do this.  Your followers can
> > read it, decide to retweet or not.
> >
> >
> > On Thu, Jun 12, 2014 at 5:37 PM, Divyansh Prakash
> >  <mailto:divyanshprakas...@gmail.com>
> > <mailto:divyanshprakas...@gmail.com
> <mailto:divyanshprakas...@gmail.com>>> wrote:
> >
> > Sorry if you feel that way. Thought i could share my
> > thoughts and start an interesting discussion.
> > That is what the group is for.
> > You are obviously free to skip anything t

Re: Clojure:Lisp :: LSD:Meditation

2014-06-13 Thread Dave Della Costa
> Divyansh has posted 3 links in the last 3 months.

So?

> It's not because we don't like the content. I didn't even read the
> content.

> I have seen another post by Gijs. He links to his blog. But he's also
> announcing an open source project. I see no problems with that. I even
> posted it to hacker news.

So, *is* it about the content or not?  I'm still not understanding what
line Divyansh's post is crossing.


(2014/06/13 18:51), Atamert Ölçgen wrote:
> 
> On Fri, Jun 13, 2014 at 9:34 AM, Dave Della Costa  <mailto:ddellaco...@gmail.com>> wrote:
> 
> So it seems to me that some folks simply don't like the content; 
> 
> 
> It's not because we don't like the content. I didn't even read the content.
> 
> You haven't made a post and linked to your blog since February, right?
> (I just searched my local archives)
> 
> Divyansh has posted 3 links in the last 3 months.
> 
> I have seen another post by Gijs. He links to his blog. But he's also
> announcing an open source project. I see no problems with that. I even
> posted it to hacker news.
> 
> I'm not a moderator or anything, just simply explaining my point of view
> - as a member of the group.
> 
> -- 
> 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 from it, send
> an email to clojure+unsubscr...@googlegroups.com
> <mailto: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:Lisp :: LSD:Meditation

2014-06-13 Thread Dave Della Costa
I'm not sure what the problem is here.  I've posted personal blog links
before that were Clojure related; I sincerely thought that it was
potentially useful to the group, and I more or less got responses that
supported that.

That being the case, I'm having a hard time understanding what is so
different about my blog post and Divyansh's; as far as I can tell, this
post is relevant to Clojure, even if it's a bit more...exploratory.  It
has Clojure code examples, it talks about Common Lisp and Python and
metaprogramming.  It's clearly not random spam.

So it seems to me that some folks simply don't like the content; that's
fine, but I think it's a stretch to say that it's not appropriate for
this list.  Or if it is not appropriate, then even relevant blog posts
should never be appropriate, and arguably stuff like, say, epic
ruminations on the nature of literate programming would arguably be even
less appropriate for the list.

DD

(2014/06/13 11:25), Gary Trakhman wrote:
> To be fair, I actually read the thing, but I hoped to see more
> interesting information on LSD, meditation and Clojure than the headline
> would suggest :-).
> 
> 
> On Thu, Jun 12, 2014 at 10:01 PM, Atamert Ölçgen  > wrote:
> 
> There's also Planet Clojure .
> 
> @Divyansh
> 
> Josh, Hussein and Gary are not the only ones who think this sort of
> traffic building is uncool. By traffic building I mean; sending a
> message with a link that has no valuable information for the group
> members. They are probably just nodding their head and thinking that
> sending another response is not necessary. At least that's what I
> did before I saw your response.
> 
> 90% of the messages in this group doesn't interest me. That's fine.
> Valuable information for someone else. But I certainly wouldn't want
> everybody to post their blogs here regularly. Because each message
> is a tiny little distraction. I'm willing to pay the price because
> when a really cool library is announced for example, I get a big
> reward. Let's keep the benefit/cost ratio, time-wise &
> attention-wise, high.
> 
> 
> 
> 
> On Thu, Jun 12, 2014 at 10:05 PM, Gary Trakhman
> mailto:gary.trakh...@gmail.com>> wrote:
> 
> Twitter's a more organic way to do this.  Your followers can
> read it, decide to retweet or not.
> 
> 
> On Thu, Jun 12, 2014 at 5:37 PM, Divyansh Prakash
>  > wrote:
> 
> Sorry if you feel that way. Thought i could share my
> thoughts and start an interesting discussion.
> That is what the group is for.
> You are obviously free to skip anything that doesn't
> interest you. That was the prime reason for the concise title.
> I have no intentions of misleading anyone.
> 
> --
> 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,

Re: [ANN] monarch 0.2.0 - Simple database migrations for Clojure.

2014-05-27 Thread Dave Della Costa
Just to add to the chorus--environ
(https://github.com/weavejester/environ) is a good, basic option which
we've had lots of success using.

(2014/05/27 18:08), Andrey Antukh wrote:
> Nomad is an other tool like
> confijulate: https://github.com/james-henderson/nomad
> 
> I use it in some projects and seems better documented that confijulate
> and uses edn as file format.
> 
> Andrey
> 
> 
> 2014-05-27 10:43 GMT+02:00 Ray Miller  >:
> 
> On 27 May 2014 09:35, Manuel Paccagnella
> mailto:manuel.paccagne...@gmail.com>>
> wrote:
> >
> >> I've found confijulate, here. It might be useful.
> >
> >
> > Well, ok. Another configuration library that I wasn't aware of
> when I wrote
> > confunion. Another one that I found after writing mine is carica,
> which
> > seems quite good. There are a bunch of them out there, you can
> look into
> > Clojure Toolbox, probably there is already one that satisfies your use
> > cases.
> 
> Thank you for drawing all these configuration libraries to my
> attention, this is something I've done in an ad hoc way for the
> different applications I've written. I'll take a look at these before
> rolling my own next time.
> 
> Ray.
> 
> --
> 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.
> 
> 
> 
> 
> -- 
> Andrey Antukh - Андрей Антух -  > / mailto:n...@niwi.be>>
> http://www.niwi.be 
> https://github.com/niwibe
> 
> -- 
> 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 set count returning erroneous values.

2014-05-20 Thread Dave Della Costa
Hi Austin, I'm not sure that this is related but I've had an issue with
Dates in sets and saw somewhat similar behavior to what you're
describing. Context:

https://github.com/ddellacosta/date-hash-bug

DD

(2014/05/21 10:56), Austin Haas wrote:
> Unfortunately, no, but not from lack of trying.
> 
> The best lead I've got thus far is that there is a disj call that
> returns a defective set, which returns a positive value for count, but
> does not seem to contain any elements.
> 
> I've tried to capture the offending values, but I can't reproduce the
> bug with them. I can't arrange the elements of the set to be in the same
> order, and I can't get the same hash values for the maps (which contain
> js objects).
> 
> I suspect the issue may have something to do with hash collisions. The
> app state is being shuffled with some randomness, and the problem arises
> consistently after a minute or two of churn. If I add an extra
> "artificial" hash field to each element stored in the set, then the
> problem disappears (or perhaps it is postponed). I noticed that the
> defective sets always contain many elements with the same hash. (I know
> very little about how sets and hashing are implemented.)
> 
> I'll keep debugging.
> 
> - austin
> 
> On Tuesday, May 20, 2014 8:36:37 AM UTC-7, David Nolen wrote:
> 
> Can you demonstrate a complete minimal example?
> 
> Thanks,
> David
> 
> 
> On Tue, May 20, 2014 at 4:06 AM, Austin Haas  > wrote:
> 
> I'm having trouble isolating a small test case. I call the
> following code in an update tick:
> 
> (let [prev'  @prev
>   state' @state]
>   (let [rems (clojure.set/difference prev' state')
> adds (clojure.set/difference state' prev')]
> (reset! prev state')
> (assert (= (count rems) (count (set rems))
> 
> (prev and state hold sets of maps.)
> 
> After running for a few minutes, the assert will fail. The
> 'rems' and 'adds' will report that their count is > 1, but when
> I try to access the elements there are either none or only one.
> 
> What would cause a set to return an incorrect value for count?
> 
> FWIW, the elements of the sets are maps, and one of the fields
> holds a mutable javascript array. That was my first suspicion,
> but the array isn't mutated in my code, and I use a memoized
> function to generate it (to preserve identity).
> 
> I'm using [org.clojure/clojurescript "0.0-2202"].
> 
> -- 
> 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=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/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: Error using core.async version of into

2014-05-20 Thread Dave Della Costa
The question is why that is happening when you load up the repl--are you
using 'use' or 'require' with :refer all on core.async in your p1.core
namespace?  If so you should probably switch that reference to something
like

(:require [cljs.core.async :as async])

If this is not what's going on I'm confused as to why these would be
getting replaced on loading your repl like that.

(2014/05/20 19:01), Craig wrote:
> 
> Juan, I saw your reply and then noticed the clear warning ("...being
> replaced by: #'clojure.core.async/into") as well. Many thanks for the
> quick response.
> 
> -- 
> 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: using atoms as logs for channels in core.async

2014-05-12 Thread Dave Della Costa
Sorry, I just realized that you were referring to the exact same
examples Jay Fields uses...so you must already know about that article! ;-)

(2014/05/12 23:07), Dave Della Costa wrote:
>> The x is referring to the map that is to be
>> added in as a parameter, right?
> 
> So, taking one example from James's code:
> 
> (defn transparent-put [{:keys [channel buffer]} x]
>   (go
> (>! channel x)
> (swap! buffer conj x)))
> 
> The x is the second argument to the function--it's the message you put
> into the channel, in this case.
> 
> The contrast with the let form you used as an example is that the let
> form is assigning the right value to the left destructuring form.  But
> in the case of a function, the value that is passed in is what is
> getting destructured.  Contrast this:
> 
> (let [{:keys [a b]} {:a 1 :b 2}]
>   (println "a: " a ", b: " b))
> 
> with this:
> 
> (defn destruct
>   [{:keys [a b]}]
>   (println "a: " a ", b: " b))
> 
> (destruct {:a 1 :b 2})
> 
> Does that help?
> 
> If you haven't read this great article about destructuring by Jay Fields
> yet, I highly recommend you do:
> 
> http://blog.jayfields.com/2010/07/clojure-destructuring.html
> 
>> Like you said, I also feel like I'm *starting* to get it and it is
>> really exciting :) Thanks for your advice.
> 
> Great! You're very welcome--good luck.
> 
> DD
> 
> (2014/05/12 21:43), gamma235 wrote:
>> Your description of what is going on with my macro was really helpful.
>> In my head I was imagining recursive evals running over the code, saying
>> first, then, etc. I didn't really think about  compile time vs. run-time. 
>>
>> I am impressed with James' code as well, but I am having trouble fully
>> understanding it and getting it to run. From the transparent put
>> definition, it doesn't seem like it is possible to pass a channel value
>> as a parameter in the call. The x is referring to the map that is to be
>> added in as a parameter, right? at least that is why I learned, when I
>> studied destructuring: 
>>
>> (def point {:x 5 :y 7})
>>
>>  
>>
>> (let [{:keys [x y]} point]
>>   (println "x:" x "y:" y))
>>
>>  
>>
>> => :x 5 :y 7
>>
>>
>> Does it work different different for defining function parameters? I
>> posted more under his comment above, please have a look. 
>>
>> Like you said, I also feel like I'm *starting* to get it and it is
>> really exciting :) Thanks for your advice. 
>>
>> Jesse
>>
>> On Monday, May 12, 2014 7:46:34 PM UTC+9, David Della Costa wrote:
>>
>> > to reason about and can be dangerous. I would suggest putting
>> > dynamically created channels in a collection inside an atom if you
>> > need to create them like this.
>>
>> P.S. I just read James's response and I see he said something similar
>> regarding this--it's better to structure this as a hash-map or other
>> data structure, and use an atom if it needs to be updated dynamically.
>> Notice that his code is far simpler and easier to reason about, and
>> avoids the use of macros.
>>
>> DD
>>
>> (2014/05/12 19:40), Dave Della Costa wrote:
>> >> I think I am confused about how to distinguish between a symbol
>> and a
>> >> variable, as I thought that the symbol being derefed pointed to the
>> >> atom that it was made to define when transparent-chan was called.
>> >
>> > I think it's not so much that, as being mistaken about what is
>> going at
>> > compile-time vs. run-time in your macros.  Going back to your
>> original
>> > code, your log-name function is just fine:
>> >
>> > (defn log-name [ch] (symbol (str ch '-log)))
>> >
>> > It returns a symbol, which is what you want for the second arg to
>> def.
>> >
>> > However, keep in mind that this is going to return a list which will
>> > then get evaluated, but it will only be the last value returned
>> from 'do':
>> >
>> > (defmacro transparent-chan [ch]
>> >   (do
>> > `(def ~ch (chan))
>> > `(def (log-name ~ch) (atom []))
>> > `(println "new transparent channel created!")))
>> >
>> > that is, a list like this:
>>   

Re: using atoms as logs for channels in core.async

2014-05-12 Thread Dave Della Costa
> The x is referring to the map that is to be
> added in as a parameter, right?

So, taking one example from James's code:

(defn transparent-put [{:keys [channel buffer]} x]
  (go
(>! channel x)
(swap! buffer conj x)))

The x is the second argument to the function--it's the message you put
into the channel, in this case.

The contrast with the let form you used as an example is that the let
form is assigning the right value to the left destructuring form.  But
in the case of a function, the value that is passed in is what is
getting destructured.  Contrast this:

(let [{:keys [a b]} {:a 1 :b 2}]
  (println "a: " a ", b: " b))

with this:

(defn destruct
  [{:keys [a b]}]
  (println "a: " a ", b: " b))

(destruct {:a 1 :b 2})

Does that help?

If you haven't read this great article about destructuring by Jay Fields
yet, I highly recommend you do:

http://blog.jayfields.com/2010/07/clojure-destructuring.html

> Like you said, I also feel like I'm *starting* to get it and it is
> really exciting :) Thanks for your advice.

Great! You're very welcome--good luck.

DD

(2014/05/12 21:43), gamma235 wrote:
> Your description of what is going on with my macro was really helpful.
> In my head I was imagining recursive evals running over the code, saying
> first, then, etc. I didn't really think about  compile time vs. run-time. 
> 
> I am impressed with James' code as well, but I am having trouble fully
> understanding it and getting it to run. From the transparent put
> definition, it doesn't seem like it is possible to pass a channel value
> as a parameter in the call. The x is referring to the map that is to be
> added in as a parameter, right? at least that is why I learned, when I
> studied destructuring: 
> 
> (def point {:x 5 :y 7})
> 
>  
> 
> (let [{:keys [x y]} point]
>   (println "x:" x "y:" y))
> 
>  
> 
> => :x 5 :y 7
> 
> 
> Does it work different different for defining function parameters? I
> posted more under his comment above, please have a look. 
> 
> Like you said, I also feel like I'm *starting* to get it and it is
> really exciting :) Thanks for your advice. 
> 
> Jesse
> 
> On Monday, May 12, 2014 7:46:34 PM UTC+9, David Della Costa wrote:
> 
> > to reason about and can be dangerous. I would suggest putting
> > dynamically created channels in a collection inside an atom if you
> > need to create them like this.
> 
> P.S. I just read James's response and I see he said something similar
> regarding this--it's better to structure this as a hash-map or other
> data structure, and use an atom if it needs to be updated dynamically.
> Notice that his code is far simpler and easier to reason about, and
> avoids the use of macros.
> 
> DD
> 
> (2014/05/12 19:40), Dave Della Costa wrote:
> >> I think I am confused about how to distinguish between a symbol
> and a
> >> variable, as I thought that the symbol being derefed pointed to the
> >> atom that it was made to define when transparent-chan was called.
> >
> > I think it's not so much that, as being mistaken about what is
> going at
> > compile-time vs. run-time in your macros.  Going back to your
> original
> > code, your log-name function is just fine:
> >
> > (defn log-name [ch] (symbol (str ch '-log)))
> >
> > It returns a symbol, which is what you want for the second arg to
> def.
> >
> > However, keep in mind that this is going to return a list which will
> > then get evaluated, but it will only be the last value returned
> from 'do':
> >
> > (defmacro transparent-chan [ch]
> >   (do
> > `(def ~ch (chan))
> > `(def (log-name ~ch) (atom []))
> > `(println "new transparent channel created!")))
> >
> > that is, a list like this:
> >
> > `(println "new transparent channel created!")
> >
> > ...which will then get evaluated at run-time.  So your def calls will
> > never run!  If we know that we can adjust it--
> >
> > (defmacro transparent-chan [ch]
> >   `(do (def ~ch (async/chan))
> >(def (log-name ~ch) (atom []))
> >(println "new transparent channel created!")))
> >
> > ...but then we get:
> >
> > user=> (transparent-chan my-chan)
> >
> > CompilerException java.lang.RuntimeException: First argument to
>

Re: recur code

2014-05-12 Thread Dave Della Costa
I can give you places to begin at least--recur is a special form and in
Clojure is written in Java,

https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Compiler.java#L42

whereas in ClojureScript it's written in Clojure:

https://github.com/clojure/clojurescript/blob/master/src/clj/cljs/analyzer.clj#L381-L382

DD

(2014/05/12 20:33), Catonano wrote:
> Where is the source code for recur ? How could I inspect it ?
> 
> 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: using atoms as logs for channels in core.async

2014-05-12 Thread Dave Della Costa
> to reason about and can be dangerous. I would suggest putting
> dynamically created channels in a collection inside an atom if you
> need to create them like this.

P.S. I just read James's response and I see he said something similar
regarding this--it's better to structure this as a hash-map or other
data structure, and use an atom if it needs to be updated dynamically.
Notice that his code is far simpler and easier to reason about, and
avoids the use of macros.

DD

(2014/05/12 19:40), Dave Della Costa wrote:
>> I think I am confused about how to distinguish between a symbol and a
>> variable, as I thought that the symbol being derefed pointed to the
>> atom that it was made to define when transparent-chan was called.
> 
> I think it's not so much that, as being mistaken about what is going at
> compile-time vs. run-time in your macros.  Going back to your original
> code, your log-name function is just fine:
> 
> (defn log-name [ch] (symbol (str ch '-log)))
> 
> It returns a symbol, which is what you want for the second arg to def.
> 
> However, keep in mind that this is going to return a list which will
> then get evaluated, but it will only be the last value returned from 'do':
> 
> (defmacro transparent-chan [ch]
>   (do
> `(def ~ch (chan))
> `(def (log-name ~ch) (atom []))
> `(println "new transparent channel created!")))
> 
> that is, a list like this:
> 
> `(println "new transparent channel created!")
> 
> ...which will then get evaluated at run-time.  So your def calls will
> never run!  If we know that we can adjust it--
> 
> (defmacro transparent-chan [ch]
>   `(do (def ~ch (async/chan))
>(def (log-name ~ch) (atom []))
>(println "new transparent channel created!")))
> 
> ...but then we get:
> 
> user=> (transparent-chan my-chan)
> 
> CompilerException java.lang.RuntimeException: First argument to def must
> be a Symbol, compiling... ; etc.
> user=>
> 
> Hmm...still a problem.  Let's see, when is the 'log-name' function
> getting run?  Oh, at *run-time*...but we want it run at compile-time.
> So, knowing that, we can adjust it again:
> 
> (defmacro transparent-chan [ch]
>   `(do (def ~ch (async/chan))
>(def ~(log-name ch) (atom []))
>(println "new transparent channel created!")))
> 
> Now we see:
> 
> user=> (transparent-chan my-chan)
> new transparent channel created!
> nil
> user=> my-chan
> # clojure.core.async.impl.channels.ManyToManyChannel@7b3287a>
> user=> my-chan-log
> #
> user=> my-chan-log
> 
> Etc. I think that you need to keep playing with it and you'll get it; it
> doesn't seem too far off.
> 
> That said, if I were you I'd still try it the simpler way I proposed
> before--this seems like a lot of work for not a lot of payoff, when you
> can just dump out logging information at the time you send or receive a
> message. And in general creating vars like this dynamically is not easy
> to reason about and can be dangerous. I would suggest putting
> dynamically created channels in a collection inside an atom if you need
> to create them like this.
> 
>> Later I was thinking about incorporating it into a gui to see
>> if it's possible to design an asynchronous message passing system
>> using drag and drop icons that represent pubs and subs, channels with
>> a drop-down contents tab, and running listening processes.
>> I know this is probably out of my league, but I was just asking
>> myself how something like that might be implemented.
> 
> I think it's totally possible and there's no reason it would be out of
> your league. Just keep trying and asking questions here (and on IRC too
> if you want to jump on, plenty of folks there willing to help out).
> 
> DD
> 
> (2014/05/12 17:26), gamma235 wrote:
>> Thank you for your answer David. 
>>
>> I think I am confused about how to distinguish between a symbol and a
>> variable, as I thought that the symbol being derefed pointed to the atom
>> that it was made to define when transparent-chan was called.
>>
>> Also, I am trying to specifically solve the logging problem  to
>> understand how I might use stored values or state outside the scope of
>> the channel as a means of creating the illusion of referencing its
>> contents. Later I was thinking about incorporating it into a gui to see
>> if it's possible to design an asynchronous message passing system using
>> drag and drop icons that represent pubs and subs, channels with a
>> drop-down contents tab, and running listening processes. I k

Re: using atoms as logs for channels in core.async

2014-05-12 Thread Dave Della Costa
> I think I am confused about how to distinguish between a symbol and a
> variable, as I thought that the symbol being derefed pointed to the
> atom that it was made to define when transparent-chan was called.

I think it's not so much that, as being mistaken about what is going at
compile-time vs. run-time in your macros.  Going back to your original
code, your log-name function is just fine:

(defn log-name [ch] (symbol (str ch '-log)))

It returns a symbol, which is what you want for the second arg to def.

However, keep in mind that this is going to return a list which will
then get evaluated, but it will only be the last value returned from 'do':

(defmacro transparent-chan [ch]
  (do
`(def ~ch (chan))
`(def (log-name ~ch) (atom []))
`(println "new transparent channel created!")))

that is, a list like this:

`(println "new transparent channel created!")

...which will then get evaluated at run-time.  So your def calls will
never run!  If we know that we can adjust it--

(defmacro transparent-chan [ch]
  `(do (def ~ch (async/chan))
   (def (log-name ~ch) (atom []))
   (println "new transparent channel created!")))

...but then we get:

user=> (transparent-chan my-chan)

CompilerException java.lang.RuntimeException: First argument to def must
be a Symbol, compiling... ; etc.
user=>

Hmm...still a problem.  Let's see, when is the 'log-name' function
getting run?  Oh, at *run-time*...but we want it run at compile-time.
So, knowing that, we can adjust it again:

(defmacro transparent-chan [ch]
  `(do (def ~ch (async/chan))
   (def ~(log-name ch) (atom []))
   (println "new transparent channel created!")))

Now we see:

user=> (transparent-chan my-chan)
new transparent channel created!
nil
user=> my-chan
#
user=> my-chan-log
#
user=> my-chan-log

Etc. I think that you need to keep playing with it and you'll get it; it
doesn't seem too far off.

That said, if I were you I'd still try it the simpler way I proposed
before--this seems like a lot of work for not a lot of payoff, when you
can just dump out logging information at the time you send or receive a
message. And in general creating vars like this dynamically is not easy
to reason about and can be dangerous. I would suggest putting
dynamically created channels in a collection inside an atom if you need
to create them like this.

> Later I was thinking about incorporating it into a gui to see
> if it's possible to design an asynchronous message passing system
> using drag and drop icons that represent pubs and subs, channels with
> a drop-down contents tab, and running listening processes.
> I know this is probably out of my league, but I was just asking
> myself how something like that might be implemented.

I think it's totally possible and there's no reason it would be out of
your league. Just keep trying and asking questions here (and on IRC too
if you want to jump on, plenty of folks there willing to help out).

DD

(2014/05/12 17:26), gamma235 wrote:
> Thank you for your answer David. 
> 
> I think I am confused about how to distinguish between a symbol and a
> variable, as I thought that the symbol being derefed pointed to the atom
> that it was made to define when transparent-chan was called.
> 
> Also, I am trying to specifically solve the logging problem  to
> understand how I might use stored values or state outside the scope of
> the channel as a means of creating the illusion of referencing its
> contents. Later I was thinking about incorporating it into a gui to see
> if it's possible to design an asynchronous message passing system using
> drag and drop icons that represent pubs and subs, channels with a
> drop-down contents tab, and running listening processes. I know this is
> probably out of my league, but I was just asking myself how something
> like that might be implemented. I will of course continue to learn and
> reinforce the basics though on my own. 
> 
> Jesse
> 
> On Monday, May 12, 2014 1:26:57 PM UTC+9, David Della Costa wrote:
> 
> I apologize, apparently you can't use go-loop how I did below,
> 
> => (def my-go-loop (async/go-loop [msg (async/ msg "
>     msg " from channel " 'c)))
> 
> ...try this instead:
> 
> (def my-go-loop (async/go-loop [] (let [msg (async/ msg " msg " from channel " 'c
> 
> Sorry about that!
> 
> DD
> 
> (2014/05/12 13:21), Dave Della Costa wrote:
> >
> >> 1) I feel like it is a redundant to define bindings multiple
> times in
> >> my go's let exprs when the params have already been passed in as
> >> arguments. Is there a more idiomatic way to do this?
> >

Re: using atoms as logs for channels in core.async

2014-05-11 Thread Dave Della Costa
I apologize, apparently you can't use go-loop how I did below,

=> (def my-go-loop (async/go-loop [msg (async/ 
>> 1) I feel like it is a redundant to define bindings multiple times in
>> my go's let exprs when the params have already been passed in as
>> arguments. Is there a more idiomatic way to do this?
> 
> I think the fact that you are re-binding in a let should show you that
> these variables are already in scope: that let is wholly redundant, just
> remove it.
> 
> 
>> 2) Whenever I try to create a generic process to automatically
>> generate a log-name for each channel and then call update, I get a
>> 'symbol cannot be cast to atom' error. How can I get around this? It
>> seems to happen even if I don't use the log-name function.
> 
> It's simple: a symbol is not an atom.  It's telling you exactly what you
> need to know: you cannot call swap! on a symbol.  Make sure your atom is
> the first argument to swap! wherever you use it.
> 
> 
>> 3) Is there a better way to keep track of what's on a channel that
>> doesn't use macros?
> 
> You cannot look inside of a channel, but to do what you want and get a
> sense of how core.async works, I think you are on the right track by
> logging as you put stuff in and take it out.
> 
> That said, I would start by getting rid of the log and the macro--these
> are unnecessary complications--and do things very simply:
> 
> => (require '[clojure.core.async :as async])
> nil
> => (def c (async/chan))
> #'user/c
> => (def my-go-loop (async/go-loop [msg (async/ msg " from channel " 'c)))
> #'user/my-go-loop
> => (defn put-and-print! [c msg] (println "putting msg " msg " onto
> channel " 'c) (async/put! c msg))
> #'user/put-and-print!
> => (put-and-print! c "I am a message!")
> putting msg  I am a message!  onto channel  c
> got msg  I am a message!  from channel  c
> nil
> =>
> 
> Printing out "channel c" is kind of silly since there is only one, but
> it sounds like you may want to do this with multiple channels so this is
> one way to print out the variable name--simply quote it.
> 
> DD
> 
> (2014/05/12 11:41), gamma235 wrote:
>> Hi everyone,
>>
>> I am getting my feet wet with core.async and am trying to attach atoms
>> to channels that update automatically and print out to the console as
>> you take and put. This is not for anything serious, just a way to get
>> familiar with the behavior and functionality of the library and practice
>> my Clojure skills. Thanks in advaan
>>
>> Here is my code: 
>>
>> (defn log-name [ch] (symbol (str ch '-log)))
>>  
>>  ;; Is this efficiently written?
>> (defmacro transparent-chan [ch]   
>>   (do
>> `(def ~ch (chan))
>> `(def (log-name ~ch) (atom []))
>> `(println "new transparent channel created!")))
>>  
>> (defn- update [log v]
>>   (do
>> (swap! log conj v)
>> (println "log test passed: " v " has been logged")
>> (println "channel contents: " @log)))
>>  
>>  (defn transparent-put [ch v]
>>(let [log (log-name ch)]
>>  (go
>>   (let [ch ch
>> v v]
>> (>! ch v)
>> (println v " has been successfully moved through the channel")))
>>  (update log v)
>>  (println "put test passed: " v " has been put on the channel")
>>  (println " rechecking channel contents: " @log)))
>>  
>> (defn transparent-take [ch]
>>   (go
>>(let [v (>  log-name (symbol (str ch '-log))]
>>  (swap! log-name #(remove #{v} %))
>>(println v "has been removed from channel")))
>>   (println " removal pending"))
>>
>>  
>>
>> ;; tests
>> (transparent-chan c)
>> c
>> c-log
>> @c-log
>> (transparent-put c 42)
>> (transparent-take c)
>>
>>
>>
>> My main questions are regarding variable scope: 
>> 1) I feel like it is a redundant to define bindings multiple times in my
>> go's let exprs when the params have already been passed in as arguments.
>> Is there a more idiomatic way to do this?
>>
>> 2) Whenever I try to create a generic process to automatically generate
>> a log-name for each channel and then call update, I get a 'symbol cannot
>> be cast to atom' error. How can I get around this? It seems to happen
>> even if I don't use the log-name function.
>>
>> 3) Is there a better way to keep track of what's on a channel that
>> doesn't use macros?
>>
>> -- 
>> 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 

Re: using atoms as logs for channels in core.async

2014-05-11 Thread Dave Della Costa

> 1) I feel like it is a redundant to define bindings multiple times in
> my go's let exprs when the params have already been passed in as
> arguments. Is there a more idiomatic way to do this?

I think the fact that you are re-binding in a let should show you that
these variables are already in scope: that let is wholly redundant, just
remove it.


> 2) Whenever I try to create a generic process to automatically
> generate a log-name for each channel and then call update, I get a
> 'symbol cannot be cast to atom' error. How can I get around this? It
> seems to happen even if I don't use the log-name function.

It's simple: a symbol is not an atom.  It's telling you exactly what you
need to know: you cannot call swap! on a symbol.  Make sure your atom is
the first argument to swap! wherever you use it.


> 3) Is there a better way to keep track of what's on a channel that
> doesn't use macros?

You cannot look inside of a channel, but to do what you want and get a
sense of how core.async works, I think you are on the right track by
logging as you put stuff in and take it out.

That said, I would start by getting rid of the log and the macro--these
are unnecessary complications--and do things very simply:

=> (require '[clojure.core.async :as async])
nil
=> (def c (async/chan))
#'user/c
=> (def my-go-loop (async/go-loop [msg (async/ (defn put-and-print! [c msg] (println "putting msg " msg " onto
channel " 'c) (async/put! c msg))
#'user/put-and-print!
=> (put-and-print! c "I am a message!")
putting msg  I am a message!  onto channel  c
got msg  I am a message!  from channel  c
nil
=>

Printing out "channel c" is kind of silly since there is only one, but
it sounds like you may want to do this with multiple channels so this is
one way to print out the variable name--simply quote it.

DD

(2014/05/12 11:41), gamma235 wrote:
> Hi everyone,
> 
> I am getting my feet wet with core.async and am trying to attach atoms
> to channels that update automatically and print out to the console as
> you take and put. This is not for anything serious, just a way to get
> familiar with the behavior and functionality of the library and practice
> my Clojure skills. Thanks in advaan
> 
> Here is my code: 
> 
> (defn log-name [ch] (symbol (str ch '-log)))
>  
>  ;; Is this efficiently written?
> (defmacro transparent-chan [ch]   
>   (do
> `(def ~ch (chan))
> `(def (log-name ~ch) (atom []))
> `(println "new transparent channel created!")))
>  
> (defn- update [log v]
>   (do
> (swap! log conj v)
> (println "log test passed: " v " has been logged")
> (println "channel contents: " @log)))
>  
>  (defn transparent-put [ch v]
>(let [log (log-name ch)]
>  (go
>   (let [ch ch
> v v]
> (>! ch v)
> (println v " has been successfully moved through the channel")))
>  (update log v)
>  (println "put test passed: " v " has been put on the channel")
>  (println " rechecking channel contents: " @log)))
>  
> (defn transparent-take [ch]
>   (go
>(let [v (  log-name (symbol (str ch '-log))]
>  (swap! log-name #(remove #{v} %))
>(println v "has been removed from channel")))
>   (println " removal pending"))
> 
>  
> 
> ;; tests
> (transparent-chan c)
> c
> c-log
> @c-log
> (transparent-put c 42)
> (transparent-take c)
> 
> 
> 
> My main questions are regarding variable scope: 
> 1) I feel like it is a redundant to define bindings multiple times in my
> go's let exprs when the params have already been passed in as arguments.
> Is there a more idiomatic way to do this?
> 
> 2) Whenever I try to create a generic process to automatically generate
> a log-name for each channel and then call update, I get a 'symbol cannot
> be cast to atom' error. How can I get around this? It seems to happen
> even if I don't use the log-name function.
> 
> 3) Is there a better way to keep track of what's on a channel that
> doesn't use macros?
> 
> -- 
> 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 grou

Re: comparison with 3 arguments. Do I understand it right ?

2014-04-23 Thread Dave Della Costa
What James meant was that you should use it like so:

=> (defn teen? [age] (< 12 age 20))
#'user/teen?
=> (teen? 50)
false
=> (teen? 10)
false
=> (teen? 14)
true
=> (if (teen? 14) "yes is a teen" "no, not a teen")
"yes is a teen"

You don't need to set up these wrappers returning true and false.  nil
and false are false in Clojure, everything else is true.  Remember that
and you'll be good to go.

DD

(2014/04/23 19:45), Roelof Wobben wrote:
> Thanks,
> 
> But something is not going right.
> 
> When delete the if as you said and have this :
> 
> (defn boolean [x]
>   (or (false? x)(nil? x))
>   false;
>   true)
> 
> (defn abs [x]
>   (< x 0)
> (* x -1);
> x)
> 
> (defn teen? [age]
>   (< 12 age 20)
>   true;
>   false)
> 
> Then all tests fail and if I put a if before it , they all work well.
> 
> Roelof
> 
> Op woensdag 23 april 2014 12:19:01 UTC+2 schreef James Reeves:
> 
> (< a b c) is equivalent to (and (< a b) (< b c)), so yes, (< 12 age
> 20) is the same as 12 < age < 20.
> 
> You could write your function more concisely as:
> 
> (defn teen? [age]
>   (< 12 age 20))
> 
> The "if" statement is unnecessary.
> 
> - James
> 
> 
> On 23 April 2014 11:11, Roelof Wobben  > wrote:
> 
> Hello,
> 
> I do not understand why this work.
> 
> I have to check if someone is between 12 and 20 years.
> 
> So after some trail and error this seems to work
> 
> (defn teen? [age]
>   (if (< 12 age 20)
>   true;
>   false))
> 
> Is it right it stated 12 < age <  20 ?
> 
> Roelof
> 
> -- 
> 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=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/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: Help with data structures and dereferencing

2014-02-27 Thread Dave Della Costa
Hi Robert,

I completely understand the desire to structure your code in a way that
isolates business logic.  It's something I struggle with all the time
and I think it's not simple when you're shifting from thinking in an OO
way (as you and I and so many folks are) to thinking more functionally
about things.  I mean, this is not simple, period--design is hard.

One point of advice I can make regarding this is that sometimes I've
found it useful to design a structure in an expedient way, asking the
question, "what makes it easiest to get at and manipulate my data?" Then
I ask questions about what that design implies: what concerns get mixed
up that I'd rather not get mixed up, what is more complex than it should
be, etc.  Then I see if I can maintain or increase the simplicity while
addressing the remaining concerns.

> my concern was that i was missing some clojure idiom for "hiding"
> whether a data structure was fully populated vs. requiring an explicit
> look ups.

You can still abstract this functionality without coupling your data and
the lookup functions.  It's fine to provide the API user with a function
that says, "get me this data, I don't care how, and here's the tree of
entity relationships."  Heck, you can even hide the entity relationship
data structure if really really need to, depending on the needs of the
API.  That maintains the abstraction of a lookup method which could be
doing anything from pulling it from memory to looking it up in a
database to making an HTTP request...etc.  But your relationships can
still be expressed in that one isolated data structure, living wherever
it lives, getting managed however it gets managed.

But I would start by designing the lowest layer to make everything
explicit and as pure as possible: a function which gets an entity id and
this resource and tries to look up the data here, a function which gets
the id and that other resource and tries to look it up there, etc.  And
then the "get-me-the-data-I-don't-care-how" function would simply be
wrapping those up in logic which figures out which one succeeds (for
example).

If you want something on top of all of that that is more semantically
meaningful and matches your domain vocabulary, you can then do that too.
 You can always wrap these functions in other functions.

Rick Hickey's comments in this interview (I could swear I saw this
interview on a different site, but can't find it...ah well) may be
pertinent here:

http://www.codequarterly.com/2011/rich-hickey/

"Fogus: Following that idea—some people are surprised by the fact that
Clojure does not engage in data-hiding encapsulation on its types. Why
did you decide to forgo data-hiding?
Hickey: Let’s be clear that Clojure strongly emphasizes programming to
abstractions. At some point though, someone is going to need to have
access to the data. And if you have a notion of “private”, you need
corresponding notions of privilege and trust. And that adds a whole ton
of complexity and little value, creates rigidity in a system, and often
forces things to live in places they shouldn’t. This is in addition to
the other losing that occurs when simple information is put into
classes. To the extent the data is immutable, there is little harm that
can come of providing access, other than that someone could come to
depend upon something that might change. Well, okay, people do that all
the time in real life, and when things change, they adapt. And if they
are rational, they know when they make a decision based upon something
that can change that they might in the future need to adapt. So, it’s a
risk management decision, one I think programmers should be free to make."

I don't think there's any magic answer to how to design something
correctly, and there are always tradeoffs and loose ends.  But perhaps
the thoughts in the quote above can provide a bit more of a basis to
start from when thinking about these kinds of design problems in Clojure.

Anyways, I was long-winded here, my apologies.  I hope at least some of
this helps.

DD

(2014/02/27 0:48), Robert Quinn wrote:
> david, 
> 
> I think you're right.  I've complicated things by conflating the two
> concepts.
> 
> the overall structure of the data is a graph. when you look at an entity
> and their relationships it's a tree.  entity (LHS) has a set of
> relationships.  that was my reason for even thinking a zipper might help
> to maintain the RHS state.  
> 
> i'm trying to pass data between the "business functions" but I need them
> to have access to the latest state.  I was trying not couple/expose the
> business functions to data access ("utility functions") so that's where
> the complexity got introduced.
> 
> the embedded functions are doing exactly what you suggest, they look up
> the related entities using the references.  the advantage (i thought) of
> having the functions embedded in the data is that the business functions
> don't have any control logic to choose an appropriate utility function,
> they j

Re: Help with data structures and dereferencing

2014-02-25 Thread Dave Della Costa
You are saying a zipper may be a solution--so do you have a tree or
graph structure?

If your RHS value is something that changes over time but has an
identity independent of its relationship to other nodes, then retrieving
or constructing its value could simply be a function or set of
functions--or just a lookup in a table--once you have access to its key,
could it not?

At least based on your description, it seems like you are complicating
the design by conflating two different things: accessing the most recent
value of the RHS value and establishing ways to look up values based on
their node relationships.

(2014/02/26 1:35), Robert Quinn wrote:
> David, 
> 
> thanks for the reply.  I started down that path.  
> 
> RHS is an entity itself.  Its state changes over time, with Identity
> independent of its relationships, it can be related to many entities
> (LHS).  So its state has to live in one place or employ synchronization
> (complex watchers?).  I remember seeing a reference to zipper
> functionality that seemed to imply a possible solution, I'll try to find
> that again..
> 
> Thanks,
> 
> Robert
> 
> 
> 
> 
> 
> On Tuesday, February 25, 2014 10:26:30 AM UTC-5, David Della Costa wrote:
> 
> Is there no way to simply structure the maps inside your main atom in
> such a way that you can look up your entities?
> 
> {lhs-uuid1 {rhs-uuid1 ["values"] rhs-uuid2 ["values"]}}
> 
> (get-in @myatom [lhs-uuid1 rhs-uuid2])
> 
> You can wrap this in a function that does some other work to look it up
> if need be, if the result of the above is nil (for example)...etc.
> 
> Seems like you're making things more complicated than they need to be
> here, but it's hard to know without knowing more about your data.
> 
> But if I were you I would start there, as I've found thinking hard
> about
> the structure of your data and and using the facilities provided by the
> standard library usually helps simplify things tremendously.
> 
> (2014/02/25 23:14), Robert Quinn wrote:
> > new to clojure, in the process of unlearning years of OO.  sorry
> for the
> > long post.
> >
> > struggling with a design/impl and hoping to get some outside
> opinions so
> > I can understand my options (clojure better)
> >
> > basic concepts are straightforward and in a nutshell I'm modeling
> > entities and relationships  (aren't we all)
> >
> > ---
> >
> > created a pool of entities (people and groups) implemented as maps.
> >  each map has a :rels which is set of relationships to other
> entities.
> >  the pool is an atom.
> >
> > first approach; relationships are in the entity, add RHS entities
> into
> > the LHS :rels.  the state of the RHS can change, I need the latest
> state
> > of RHS not as it was when the relationship was created. I decided
> not to
> > make each entity a ref (ref, atom, agent), it seemed too fine
> grained.
> > *thoughts?*
> >
> > each entity has a uuid
> >
> > second approach, a pool of relationships (:lhs uuid :rhs uuid
> :type x).
> > pool has all the relationships, also an atom.  the pool has lots of
> > benefits it "improves" other parts of the code.
> >
> > it doesn't solve the original problem, just moves it around, i still
> > can't put the actual RHS, so i'm using the uuid as a reference, i
> look
> > up RHS get the latest. (second guessing why didn't i make them
> atoms and
> > use @uuid).
> >
> > now my relationships aren't embedded in my entity, that doesn't feel
> > right, anyone dealing with the entity should still be able to say...
> > (:rels entity) and get the relationships, so i add a function to
> :rels
> > that returns all the relationship based on the uuid of the LHS, this
> > works great. syntax changes and requires me to use ((:rels entity)).
> >
> > *the problem is... (assumes everything within a single process)*
> >
> > I want to pass this data structure around and now dereferencing is
> > bleeding out.  Instead of passing around a data structure, I'm
> passing
> > around a data structure that has functions embedded in it.  which
> seems
> > like a cool idea, but now the callee needs to know that :rels
> returns a
> > function, when it's supposed to have data in it. (which is the same
> > thing?) but I don't know how to treat it seamlessly.  (i have not
> > considered eval).
> >
> > for the :rels it's not too bad.  doesn't feel like I'm using all the
> > power correctly, but it works.
> >
> > *additional problem is, my rels look like this.*
> >
> > (:lhs uuid :rhs uuid :type x)
> >
> >  :lhs and :rhs "should be" entities, not references.  more
> functions?  I
> > make :lhs and :rhs return functions which dereference entities. of
> > course that makes selec

Re: Help with data structures and dereferencing

2014-02-25 Thread Dave Della Costa
Is there no way to simply structure the maps inside your main atom in
such a way that you can look up your entities?

{lhs-uuid1 {rhs-uuid1 ["values"] rhs-uuid2 ["values"]}}

(get-in @myatom [lhs-uuid1 rhs-uuid2])

You can wrap this in a function that does some other work to look it up
if need be, if the result of the above is nil (for example)...etc.

Seems like you're making things more complicated than they need to be
here, but it's hard to know without knowing more about your data.

But if I were you I would start there, as I've found thinking hard about
the structure of your data and and using the facilities provided by the
standard library usually helps simplify things tremendously.

(2014/02/25 23:14), Robert Quinn wrote:
> new to clojure, in the process of unlearning years of OO.  sorry for the
> long post.
> 
> struggling with a design/impl and hoping to get some outside opinions so
> I can understand my options (clojure better)
> 
> basic concepts are straightforward and in a nutshell I'm modeling
> entities and relationships  (aren't we all)
> 
> ---
> 
> created a pool of entities (people and groups) implemented as maps.
>  each map has a :rels which is set of relationships to other entities.
>  the pool is an atom.
> 
> first approach; relationships are in the entity, add RHS entities into
> the LHS :rels.  the state of the RHS can change, I need the latest state
> of RHS not as it was when the relationship was created. I decided not to
> make each entity a ref (ref, atom, agent), it seemed too fine grained.
> *thoughts?*
> 
> each entity has a uuid
> 
> second approach, a pool of relationships (:lhs uuid :rhs uuid :type x).
> pool has all the relationships, also an atom.  the pool has lots of
> benefits it "improves" other parts of the code.
> 
> it doesn't solve the original problem, just moves it around, i still
> can't put the actual RHS, so i'm using the uuid as a reference, i look
> up RHS get the latest. (second guessing why didn't i make them atoms and
> use @uuid).
> 
> now my relationships aren't embedded in my entity, that doesn't feel
> right, anyone dealing with the entity should still be able to say...
> (:rels entity) and get the relationships, so i add a function to :rels
> that returns all the relationship based on the uuid of the LHS, this
> works great. syntax changes and requires me to use ((:rels entity)).
> 
> *the problem is... (assumes everything within a single process)*
> 
> I want to pass this data structure around and now dereferencing is
> bleeding out.  Instead of passing around a data structure, I'm passing
> around a data structure that has functions embedded in it.  which seems
> like a cool idea, but now the callee needs to know that :rels returns a
> function, when it's supposed to have data in it. (which is the same
> thing?) but I don't know how to treat it seamlessly.  (i have not
> considered eval).
> 
> for the :rels it's not too bad.  doesn't feel like I'm using all the
> power correctly, but it works.
> 
> *additional problem is, my rels look like this.*
> 
> (:lhs uuid :rhs uuid :type x)
> 
>  :lhs and :rhs "should be" entities, not references.  more functions?  I
> make :lhs and :rhs return functions which dereference entities. of
> course that makes selecting from rel-pool much harder 
> 
> that's when I knew I had to seek professional help (smile)
> 
> even with a long post hard to capture all the requirements... 
> 
>  1. the pools aren't supposed to be "public" so I can't have all the
> callee functions understanding how to do the dereference.  
>  2. the :rels function isn't one function, the truth is the rels-pool
> doesn't have all relationships, some are virtual, the function
> creates them on the fly, each entity could have it's own version of
> "get-relationships"
> 
> any help is appreciated.
> 
> i've considered
> 
>   * creating a function that "denormalizes" the data before sending it
> out to.  now its fully formed but i lose some recency (not much diff
> i know)
>   * centralizing all the derefs functions - so the callee knows that all
> the data isn't embedded but the functions don't live in structure,
> just the uuids... that works well for LHS/RHS deref, but makes the
> per entity virtual relationships much harder.  
>   * rethinking my atom granularity and using @ but i don't think that
> really helps
> 
> 
> thanks for reading
> 
> -- 
> 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 s

Re: I'm trying to make proper urls, but I seem to be failing at it.

2014-02-25 Thread Dave Della Costa
You can use the default Java classes which are available:

=> (-> (java.net.URI. "http" "www.mysite" "/some user" nil) .toURL
.toString)
"http://www.mysite/some%20user";
=>

ring-codec is easy too:

(https://github.com/ring-clojure/ring-codec)

=> (str "www.mysite/" (ring.util.codec/url-encode "some user"))
"www.mysite/some%20user"
=>


(2014/02/25 16:14), David Toomey wrote:
> I'm building a site and I would like to allow users to create and
> account, and I would like them to have an option to use whitespaces in
> their handle. Apparently I am doing something way wrong here, so it is
> possible that I messed up something somewhere else.
> 
> When I create a user, for example "some user", this user name is
> inserted into a database. The site is set up so that users can have
> profiles. This person's profile would be this:
> 
>   www.mysite/some user
> 
> That is bad. I am hoping to have profile pages look like this:
> 
>  www.mysite/some%20user
> 
> or:
> 
>   www.mysite/some-user
> 
> I attempted to use (url-encode), (url-decode), regex, and all sorts of
> things. Nothing I have tried has worked.
> 
> I'm actually kind of surprised that this isn't baked into Compojure
> itself, but I digress.
> 
> 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.


Re: Email delivery libs not working

2014-02-24 Thread Dave Della Costa
I'm sending authenticated emails via Mandrill with Postal and not having
any trouble, and setting it up was pretty much a "smooth workable
out-of-the-gate solution."  If you describe the errors or issues you're
experiencing someone may be able to help, but it's absolutely not the
case that these libraries don't work.

(2014/02/24 19:33), The Dude (Abides) wrote:
> Hi, I'm new to clojure and have got a productive handle on CRUD,
> sessions, routing, writing functions. Last couple things are email
> delivery, image processing (resizing).
> 
> So I looked on the clojure-toolbox site for email delivery libs with
> smtp authentication for a Mandrill acct fo transactional emails. I've
> used Mandrill in other langs right away zero glitch. Here's the results
> thus far in Clojure as a frame of reference for web domain use 2014:
> 
> POSTAL
> https://github.com/drewr/postal#encryption-gmail-example
> 
> Doesn't deliver. Tried number of examples in the docs.
> 
> MAILER
> https://github.com/clojurewerkz/mailer
> 
> Worked briefly, but not via Mandrill, no emails reached there.
> Authentication settings have no impact, uses Postal above lib for
> delivery. Tried number of examples in the docs.
> 
> CLJ MAIL
> https://github.com/MayDaniel/clj-mail
> 
> Out of date syntax.
> 
> I googled and found a couple more in the quest to avoid having to do
> this via java heaven forbid:
> 
> MMEmail
> http://blog.8thlight.com/micah-martin/2010/04/21/mmemail-my-first-clojure-open-source-contribution.html
> 
> Says cannot connect to port 25 although my settings specify port 587 for
> Mandrill
> 
> POSTMARK
> http://sjl.bitbucket.org/clojure-postmark/
> 
> Transactional email delivery service with a clojure lib. Will create an
> acct in morning and try it out.
> 
> Doe anyone know of any other smooth workable out the gate solutions for
> email delivery?
> 
> -- 
> 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: om-sync

2014-02-19 Thread Dave Della Costa
> It's not clear to me that the server side should be tied to Om
> specifically. It seems like the requirement is more to have a server
> component that can pass messages / state changes in a generic way to
> clients (probably using core.async channels, with the ability to use
> websockets etc. as the underlying transport). This server component
> would be useful for all kinds of clients (not just Om, not just
> Clojurescript, maybe even other server systems).
>
> I've hacked some stuff together that does this kind of thing for
> specific projects, but it would be nice to get a solid standard
> library in the ecosystem for this.

We have a concrete need for a system like this and in fact already have
a prototype in production (which uses browserchannel as opposed to
websockets, but these should be interchangeable) with ampq messaging and
http wrapped in core.async and Om on the front-end, but we are working
through some issues relating to scaling while providing eventual
consistency across a number of web front-ends.  The end goal is
essentially materialized views in the client.

We would also be very interested in working with other folks to provide
something with general applicability to the whole community.  Please let
us know if you'd want to contribute!

DD

(2014/02/16 10:43), Mikera wrote:
> 
> 
> On Sunday, 16 February 2014 09:26:18 UTC+8, Conrad wrote:
> 
> On Thursday, February 13, 2014 8:55:00 PM UTC-6, David Nolen wrote:
> > I've been banging the drum about Om & modularity for a while now
> and I've come up with the very beginning of a simple reusable
> component that I think demonstrates the power of Om's emphasis on
> modularity and application wide state management:
> >
> >
> >
> > http://github.com/swannodette/om-sync
> 
> >
> >
> >
> > The whole point of Om is to create a universe of shareable
> components. I hope this gets people thinking about the possibilities.
> >
> >
> >
> > Feedback welcome!
> >
> >
> > David
> 
> I agree that creating an ecosystem of components is where the future
> is... I'm surprised that there isn't a "ReactjsUI" library yet.
> 
> Stop me if this is obvious, but it seems like the natural conclusion
> of Om is to have an Om-server library as well to build html
> server-side, and then have an Om-bridge component or something that
> automagically bridges between client and server. Then, when a
> client-side component updates any state that originates in the
> server part, the existing Om interfaces probably are already
> comprehensive enough that the Om-bridge component could just
> transparently use AJAX to push those updates into the state of the
> Om components residing on the server.
> 
> 
> It's not clear to me that the server side should be tied to Om
> specifically. It seems like the requirement is more to have a server
> component that can pass messages / state changes in a generic way to
> clients (probably using core.async channels, with the ability to use
> websockets etc. as the underlying transport). This server component
> would be useful for all kinds of clients (not just Om, not just
> Clojurescript, maybe even other server systems).
> 
> I've hacked some stuff together that does this kind of thing for
> specific projects, but it would be nice to get a solid standard library
> in the ecosystem for 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: Some advice about introducing clojurescript into a project using js/jquery

2014-02-16 Thread Dave Della Costa
Just because you are using jQuery extensively in your JS codebase
doesn't mean you need jayq/jQuery in your ClojureScript code.  If you
are trying to do inter-op and call some of your JavaScript code from
your ClojureScript code, then you can simply use standard JavaScript
inter-op; if you want to user your ClojureScript functions in JS you
simply need to label those functions with the metadata ^:export and call
them in a namespace-qualified fashion.

externs are only necessary when you need to tell the Google Closure
compiler that it should not mangle certain names when compiling in
advanced mode
(https://developers.google.com/closure/compiler/docs/api-tutorial3).
That being the case, you only really need to make sure you have an
externs file which includes JS function names that you are referring to
in your ClojureScript code, and that is only if you are compiling in
advanced mode.  If you use jayq in advanced mode, of course you'll need
this (https://github.com/ibdknox/jayq#compiling), but if you don't
include it you don't need to think about it...or jQuery.

If you find you need to access the DOM in your ClojureScript code I
would suggest starting with something like dommy or even the default
Google closure libraries (the approach David Nolen takes in most of his
blog posts).

DD


(2014/02/16 23:47), Kashyap CK wrote:
> Hi,
> 
> It took me some time to get started with clojurescript (on
> windows/cygwin)
> - http://swannodette.github.io/2013/11/07/clojurescript-101/ worked for me.
> 
> I'd like to use clojurescript to do some UI component development for
> product which is built using webkit/js/jquery. I was wondering if it is
> okay to develop a feature in such an application, where most of the UI
> is in jquery, in clojurescript?
> 
> I'd appreciate it very much to know if there are any known gotha's here
> or any tips that I could use?  
> 
> 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/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: CLJX & CLJS problem

2014-02-14 Thread Dave Della Costa
Hi Chas, thanks for the clarification--it was definitely not clear to me
how this worked so I appreciate the explanation.

Regarding the PR, I suppose the same points you brought up here are
relevant there, since I proposed including my (mistaken) notion of how
source-paths work for cljx-based libs in the documentation there.

So really the problem is a lack of knowledge about how leiningen works
when packaging up a jar.  However, despite the fact that this
information is not cljx-specific, it may be useful simply to re-state
what you've described in this email somewhere in the cljx docs for
clueless folks like myself, since obvious it's not clear what is
necessary configuration and what isn't...or else just provide a pointer
to the relevant leiningen docs (if they exist).

In any case, thanks!

DD

(2014/02/14 19:14), Chas Emerick wrote:
> This isn't really right.  :source-paths are for your _sources_, not a
> place to drop in whatever paths you want either on the classpath or
> included in jar files, etc.  Also, all generated content should go into
> `target/*`, so that `lein clean` will have its intended effect
> (eliminating all artifacts of previous build / project mgmt activities).
> 
> (Some tools [definitely Counterclockwise, perhaps other IDE plugins as
> well?] also use the value of :source-paths to configure go-to-definition
> operations and such, so including non-source directories in
> :source-paths will generally yield undesirable effects there.)
> 
> When it builds jars, Leiningen includes resources from :source-paths,
> :resource-paths, and :compile-path; the latter is almost never
> customized, and defaults to "target/classes".
> 
> So, you should put your cljx sources in :source-paths.  You should have
> cljx generate transformation results into some directory under
> `target/`. If you want to redistribute the results, you should either
> generate cljx results into `target/classes`, or investigate Leiningen's
> (plethora of) options for customizing jar contents; see e.g.
> https://github.com/technomancy/leiningen/blob/stable/sample.project.clj#L331
> 
> 
> FWIW, that isn't cljx-specific at all; the same applies to Clojure
> sources that are being AOT-compiled, and with a tweak, to Java sources
> to be javac-compiled.
> 
> cljsbuild produces *JavaScript* output, so its configuration is never
> going to be relevant to whether or not ClojureScript resources produced
> by cljx can be consumed by downstream projects.
> 
> Dave, thanks for the PR; I'll reply separately to that on github.
> 
> - Chas
> 
> On 02/13/2014 10:06 PM, Dave Della Costa wrote:
>> Hi Karsten,
>>
>> Strangely, I was doing the exact same thing as you yesterday and
>> struggled for a bit until I found settings that work.
>>
>> I achieved success when I used the configuration from Cornice as a
>> template:
>>
>> https://github.com/rkneufeld/cornice/blob/master/project.clj
>>
>> ...with one exception, my cljsbuild config contained only
>>
>> :cljsbuild {:builds [{:source-paths ["target/generated/cljs"]}]}
>>
>> vs. all the extra jar config and one not.  If I recall correctly, I was
>> getting the "java.util.zip.ZipException: duplicate entry" you mention
>> until I removed the extra settings in cljsbuild.
>>
>> Looking at your config I also suspect you want
>>
>>> :source-paths ["src-cljs"]
>> instead of
>>
>>> :source-paths ["src-clj" "src-cljs"]
>> in your cljsbuild config.
>>
>> However, when I leave the cljsbuild configuration out completely, it
>> seems to have no bearing on whether or not I can use the generated cljs
>> files when including the library in another project.  I suspect the
>> ":jar true" setting is only relevant if you have strictly cljs files
>> that need to be included--it seems like cljx has its own orthogonal
>> build process which automatically includes cljs files in the jar file
>> but I haven't dug into the code yet to confirm.  This is just based on
>> testing what happens when I tweak config settings (Kevin or Chas please
>> let me know if I'm off-base here).
>>
>> What does seem to make all the difference is the sourcepaths settings,
>> which it doesn't seem you have:
>>
>> :source-paths ["src" "target/generated-src/clj"
>> "target/generated-src/cljs"]
>>
>> I needed this before I could see the clj/cljs files getting included in
>> my library jar.
>>
>> Obviously, adjust all paths to fit your specific configuration.
>>
>> I've made a pull request to

Re: CLJX & CLJS problem

2014-02-13 Thread Dave Della Costa
Hi Karsten,

Strangely, I was doing the exact same thing as you yesterday and
struggled for a bit until I found settings that work.

I achieved success when I used the configuration from Cornice as a template:

https://github.com/rkneufeld/cornice/blob/master/project.clj

...with one exception, my cljsbuild config contained only

:cljsbuild {:builds [{:source-paths ["target/generated/cljs"]}]}

vs. all the extra jar config and one not.  If I recall correctly, I was
getting the "java.util.zip.ZipException: duplicate entry" you mention
until I removed the extra settings in cljsbuild.

Looking at your config I also suspect you want

> :source-paths ["src-cljs"]

instead of

> :source-paths ["src-clj" "src-cljs"]

in your cljsbuild config.

However, when I leave the cljsbuild configuration out completely, it
seems to have no bearing on whether or not I can use the generated cljs
files when including the library in another project.  I suspect the
":jar true" setting is only relevant if you have strictly cljs files
that need to be included--it seems like cljx has its own orthogonal
build process which automatically includes cljs files in the jar file
but I haven't dug into the code yet to confirm.  This is just based on
testing what happens when I tweak config settings (Kevin or Chas please
let me know if I'm off-base here).

What does seem to make all the difference is the sourcepaths settings,
which it doesn't seem you have:

:source-paths ["src" "target/generated-src/clj" "target/generated-src/cljs"]

I needed this before I could see the clj/cljs files getting included in
my library jar.

Obviously, adjust all paths to fit your specific configuration.

I've made a pull request to add a bit of further explanation on using
cljx in libraries, as it would be helpful if this didn't require looking
up how others had done it to figure it out!

https://github.com/lynaghk/cljx/pull/30

Hope this helps--

Best,
Dave

(2014/02/13 20:22), Karsten Schmidt wrote:
> I've been busy working on a few libraries targetting both Clojure &
> ClojureScript, however so far have only tested the CLJ side and now that
> it comes to addressing CLJS am running in circles (and on fumes)
> unsuccessfully trying to tweak my project settings to make things work.
> 
> All my source is using CLJX stored in the the "src-cljx" folder. My
> rules then trigger generated sources into "src-clj" (for all Clojure and
> shared macros) and "src-cljs" for CLJS parts only.
> 
> My project.clj is as follows:
> 
> (defproject foo "0.1.0-SNAPSHOT"
>   :dependencies [[org.clojure/clojure "1.5.1"]
>  [org.clojure/clojurescript "0.0-2156"]]
>  
>   :jar-exclusions [#"\.cljx|\.DS_Store|\.js|\.html"]
> 
>   :cljx {:builds [{:source-paths ["src-cljx"]
>:output-path "src-clj"
>:rules :clj}
>   {:source-paths ["src-cljx"]
>:output-path "src-cljs"
>:rules :cljs}]}
> 
>   :cljsbuild {:builds
>   [{:id "dev"
> :source-paths ["src-clj" "src-cljs"]
> :compiler
> {:pretty-print true
>  :output-to "foo-0.1.0-SNAPSHOT.js"
>  :optimizations :simple}
> :jar true}]}
> 
>   :plugins [[com.keminglabs/cljx "0.3.2"]
> [lein-cljsbuild "1.0.2"]]
>   :hooks [cljx.hooks leiningen.cljsbuild])
> 
> I can successfully create a JAR from this with `lein install`, however
> if I try to use this library as dependency in another CLJS project, none
> of the namespaces of this dependency seem to be found, even though I
> verified that they're present in the JAR (contains both .clj & .cljs
> versions).
> 
> So I then assumed the reasons for this are the non-standard names for
> the source folders. But adding this line at the root level of
> project.clj will not work either and makes `lein install` fail with a
> "java.util.zip.ZipException: duplicate entry":
> 
> :source-paths ["src-clj" "src-cljs"]
> 
> Therefore can someone please explain or point me to a correct project
> setup to make this work? I've been trying to find answers on SO &
> Google, but it seems this (strangely?) isn't a popular use case and I
> couldn't find any helpful answers.
> 
> Once this is solved am happy to write up a short tutorial or create a
> lein template for future reference.
> 
> Thank you!
> K.
> 
> -- 
> 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

Re: How do I serve clojure pages with nginx

2013-12-20 Thread Dave Della Costa
Hi Zeynel,

I don't know if setting things up the way I've laid out there is such a
great idea.  What I would do instead is set the port and whatnot in the
jetty configuration inside of ring, assuming that's what you're using
(this assumes a lot about how your app is set up, so let me know if this
doesn't match your setup):

http://ring-clojure.github.io/ring/ring.adapter.jetty.html

Then, I would compile an uberjar with lein, like so:

$ lein uberjar

In your startup script, as Curtis laid out, call the jar file using
something like:

/path/to/java -jar /path/to/uberjar

That will be much simpler than what I have in my tutorial...which I
should really update, now that you mention it!

DD

(2013/12/19 9:28), Zeynel wrote:
> I am following your tutorial, but I am stuck with Jetty configuration.
> My installation does not seem to have a /contexts directory. Where is it?
> 
> On Tuesday, December 17, 2013 9:02:19 AM UTC-4, David Della Costa wrote:
> 
> I have not done this specifically with Nginx but I suspect you probably
> want something like what I set up with Apache + Jetty:
> 
> 
> https://github.com/ddellacosta/Clojure-under-Jetty-and-Apache#setting-up-jetty-with-apache-httpd
> 
> 
> 
> 
> That is, set up Nginx to act as a proxy for Jetty:
> 
> http://nginx.org/en/docs/beginners_guide.html#proxy
> 
> 
> One difference with how I would do it these days (vs. what I wrote in
> the piece above) is that I would probably simply push out an uberjar
> with lein which I would run with Java via an init script--for example,
> if using Ubuntu:
> 
> http://upstart.ubuntu.com/cookbook/#run-a-java-application
> 
> 
> So, I would imagine the basic construction would be something like:
> ring
> app w/jetty or http-kit, packaged as an uberjar (lein uberjar), then
> set
> up to run via an init script (via upstart in your case) on an
> alternative port, which is proxied by Nginx as in the link above.
> 
> Hope this helps--
> 
> DD
> 
> (2013/12/17 21:44), Zeynel wrote:
> > I've set up a home server with ubuntu and nginx and I can serve
> static
> > pages. Now I want to add clojure but I am not sure what I need to
> do. I
> > asked the same question in StackOverflow but for some reason it is
> voted
> > to be
> > closed:
> 
> http://stackoverflow.com/questions/20632987/how-to-serve-clojure-pages-with-nginx
> 
> 
> 
> >
> > Can you please direct me to documentation where I can read about
> this?
> > Some issues that I don't understand are: how do I tell nginx that
> I am
> > using clojure? Where do I install clojure, in the server? Where do I
> > create the clojure files? Thanks.
> >
> > --
> > --
> > 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=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_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 uns

Re: How do I serve clojure pages with nginx

2013-12-17 Thread Dave Della Costa
I have not done this specifically with Nginx but I suspect you probably
want something like what I set up with Apache + Jetty:

https://github.com/ddellacosta/Clojure-under-Jetty-and-Apache#setting-up-jetty-with-apache-httpd

That is, set up Nginx to act as a proxy for Jetty:

http://nginx.org/en/docs/beginners_guide.html#proxy

One difference with how I would do it these days (vs. what I wrote in
the piece above) is that I would probably simply push out an uberjar
with lein which I would run with Java via an init script--for example,
if using Ubuntu:

http://upstart.ubuntu.com/cookbook/#run-a-java-application

So, I would imagine the basic construction would be something like: ring
app w/jetty or http-kit, packaged as an uberjar (lein uberjar), then set
up to run via an init script (via upstart in your case) on an
alternative port, which is proxied by Nginx as in the link above.

Hope this helps--

DD

(2013/12/17 21:44), Zeynel wrote:
> I've set up a home server with ubuntu and nginx and I can serve static
> pages. Now I want to add clojure but I am not sure what I need to do. I
> asked the same question in StackOverflow but for some reason it is voted
> to be
> closed: 
> http://stackoverflow.com/questions/20632987/how-to-serve-clojure-pages-with-nginx
> 
> Can you please direct me to documentation where I can read about this?
> Some issues that I don't understand are: how do I tell nginx that I am
> using clojure? Where do I install clojure, in the server? Where do I
> create the clojure files? 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.


Re: [ClojureScript] Re: [ANN] A post on CLJS DOM manipulation libraries

2013-12-12 Thread Dave Della Costa
Hi Creighton, I've updated the post with a bit expanding on the Enfocus
section, including your suggestions.

Thanks again for your great feedback--

DD

(2013/12/12 23:00), Creighton Kirkendall wrote:
> Nice job! 
> 
> I noticed a few small things on the Enfocus section that I would tweak but 
> nothing that really makes all that big a difference.  I listed a few below.
> 
> You don't need to reference js/document when doing a single selector and you 
> don't need the [] around the selector.
> 
> (ef/at js/document ["#menu ul"] (ef/append li))
> 
> is equivalent to 
> 
> (ef/at "#menu ul" (ef/append li))
> 
> Enfocus is generally about chaining transforms and your add listener could be 
> seen as a custom transform.  With this in mind, I might recommend something 
> closer to this.   
> 
> (defn add-annoying-alert-listener_enfocus! []
>   (ef-events/listen
>  :click
>  (fn [evt]
>(let [atxt (-> evt (.-currentTarget) (.-text))
>  msg  (str "You clicked " atxt)]
>  (.alert js/window msg)
>  (.preventDefault evt)
> 
> 
> (defn add-menu-link_enfocus!
>   [link]
>   (let [link-str (-> link first name capitalize)
> href (last link)
> li   (ef/html [:li [:a {:href href} link-str]])]
> (ef/at 
>   "#menu ul" (ef/append li)
>   (str "a[href=" href "]") (add-annoying-alert-listener_enfocus!
> 
> 
> CK
>  
> 
> On Thursday, December 12, 2013 8:34:53 AM UTC-5, David Della Costa wrote:
>> Apologies...I messed something up temporarily fixing the issue Luke
>>
>> Morton found.  Is it still broken for you?
>>
>>
>>
>> (2013/12/12 22:33), Creighton Kirkendall wrote:
>>
>>> I seem to be getting a 404 on the link now.
>>
>>>
> 

-- 
-- 
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] A post on CLJS DOM manipulation libraries

2013-12-12 Thread Dave Della Costa
Hi Walter, thanks very much for the fix, good catch--I've updated the
github repo and the post to reflect this change.

Thanks!

DD

(2013/12/13 6:26), Walter van der Laan wrote:
> Hi Dave,
> 
> Thanks for the overview.
> 
> I found one error. When running the Google Clojure example on its own
> this expression gives an error:
> (first (query "#menu ul"))
> This is because 'first' depends on the protocols implemented in
> domina.events.
> 
> This expression will fix the error:
> (aget (query "#menu ul") 0)
> 
> On Thursday, December 12, 2013 8:05:57 AM UTC+1, David Della Costa wrote:
> 
> Hi folks,
> 
> Albeit a little later than I'd hoped, I've written a post giving a
> high-level overview of the DOM manipulation/Event handling libraries
> available in ClojureScript at the present time:
> 
> http://davedellacosta.com/cljs-dom-survey
> 
> 
> It's aimed at beginners in ClojureScript, for the most part, but may be
> useful to anyone who isn't familiar with the DOM libraries out there
> and
> their relative merits.
> 
> If I've forgotten anything or made any mistakes, or otherwise have
> comments, please drop me a line.
> 
> Thank you!
> 
> Best,
> 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.

-- 
-- 
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: [ANN] A post on CLJS DOM manipulation libraries

2013-12-12 Thread Dave Della Costa
Creighton, this is really excellent feedback and exactly what I was
hoping for.  I am relatively new to Enfocus and had a feeling I could
have written that code in a more idiomatic way.  I'll edit the piece to
incorporate your suggestions ASAP.

Many thanks!

DD

(2013/12/12 23:00), Creighton Kirkendall wrote:
> Nice job! 
> 
> I noticed a few small things on the Enfocus section that I would tweak but 
> nothing that really makes all that big a difference.  I listed a few below.
> 
> You don't need to reference js/document when doing a single selector and you 
> don't need the [] around the selector.
> 
> (ef/at js/document ["#menu ul"] (ef/append li))
> 
> is equivalent to 
> 
> (ef/at "#menu ul" (ef/append li))
> 
> Enfocus is generally about chaining transforms and your add listener could be 
> seen as a custom transform.  With this in mind, I might recommend something 
> closer to this.   
> 
> (defn add-annoying-alert-listener_enfocus! []
>   (ef-events/listen
>  :click
>  (fn [evt]
>(let [atxt (-> evt (.-currentTarget) (.-text))
>  msg  (str "You clicked " atxt)]
>  (.alert js/window msg)
>  (.preventDefault evt)
> 
> 
> (defn add-menu-link_enfocus!
>   [link]
>   (let [link-str (-> link first name capitalize)
> href (last link)
> li   (ef/html [:li [:a {:href href} link-str]])]
> (ef/at 
>   "#menu ul" (ef/append li)
>   (str "a[href=" href "]") (add-annoying-alert-listener_enfocus!
> 
> 
> CK
>  
> 
> On Thursday, December 12, 2013 8:34:53 AM UTC-5, David Della Costa wrote:
>> Apologies...I messed something up temporarily fixing the issue Luke
>>
>> Morton found.  Is it still broken for you?
>>
>>
>>
>> (2013/12/12 22:33), Creighton Kirkendall wrote:
>>
>>> I seem to be getting a 404 on the link now.
>>
>>>
> 

-- 
-- 
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: [ANN] A post on CLJS DOM manipulation libraries

2013-12-12 Thread Dave Della Costa
Apologies...I messed something up temporarily fixing the issue Luke
Morton found.  Is it still broken for you?

(2013/12/12 22:33), Creighton Kirkendall wrote:
> I seem to be getting a 404 on the link now.
> 

-- 
-- 
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] [ANN] A post on CLJS DOM manipulation libraries

2013-12-12 Thread Dave Della Costa
Most definitely a mistake--good catch Luke!  I've updated it with
something jayq-specific.

Thank you!

DD

(2013/12/12 19:52), Luke Morton wrote:
> Informative, nice work Dave! Perhaps a small mistake: looks like you're
> using `dommy/text` in your jayq example.
> 
> 
> On 12 December 2013 07:05, Dave Della Costa  <mailto:ddellaco...@gmail.com>> wrote:
> 
> Hi folks,
> 
> Albeit a little later than I'd hoped, I've written a post giving a
> high-level overview of the DOM manipulation/Event handling libraries
> available in ClojureScript at the present time:
> 
> http://davedellacosta.com/cljs-dom-survey
> 
> It's aimed at beginners in ClojureScript, for the most part, but may be
> useful to anyone who isn't familiar with the DOM libraries out there and
> their relative merits.
> 
> If I've forgotten anything or made any mistakes, or otherwise have
> comments, please drop me a line.
> 
> Thank you!
> 
> Best,
> Dave
> 
> --
> Note that posts from new members are moderated - please be patient
> with your first post.
> ---
> You received this message because you are subscribed to the Google
> Groups "ClojureScript" group.
> To unsubscribe from this group and stop receiving emails from it,
> send an email to clojurescript+unsubscr...@googlegroups.com
> <mailto:clojurescript%2bunsubscr...@googlegroups.com>.
> To post to this group, send email to clojurescr...@googlegroups.com
> <mailto:clojurescr...@googlegroups.com>.
> Visit this group at http://groups.google.com/group/clojurescript.
> 
> 
> -- 
> Note that posts from new members are moderated - please be patient with
> your first post.
> ---
> You received this message because you are subscribed to the Google
> Groups "ClojureScript" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to clojurescript+unsubscr...@googlegroups.com.
> To post to this group, send email to clojurescr...@googlegroups.com.
> Visit this group at http://groups.google.com/group/clojurescript.

-- 
-- 
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] A post on CLJS DOM manipulation libraries

2013-12-11 Thread Dave Della Costa
Hi folks,

Albeit a little later than I'd hoped, I've written a post giving a
high-level overview of the DOM manipulation/Event handling libraries
available in ClojureScript at the present time:

http://davedellacosta.com/cljs-dom-survey

It's aimed at beginners in ClojureScript, for the most part, but may be
useful to anyone who isn't familiar with the DOM libraries out there and
their relative merits.

If I've forgotten anything or made any mistakes, or otherwise have
comments, please drop me a line.

Thank you!

Best,
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: java.jdbc DSLs (java.jdbc.sql / java.jdbc.ddl)

2013-11-22 Thread Dave Della Costa
> How much impact would it have on you, Alexander, if the java.jdbc.sql
> namespace went away?

I work for Alex and I can say that it wouldn't be such a big deal since
we are already including honeysql, and I would simply swap the built-in
DSL for that where necessary.

I can't speak for him but personally I feel like this would be a good move.

(2013/11/22 15:12), seancorfi...@gmail.com wrote:
> I spent this afternoon removing use of java.jdbc.sql from World Singles’
> code base to see how much work it would be. The worst part for us was
> how much we relied on the naming strategy convenience macros (especially
> entities, since it flows :entities through all the DSL constructs).
> 
> How much impact would it have on you, Alexander, if the java.jdbc.sql
> namespace went away? 
> 
> Sean Corfield -- (904) 302-SEAN
> An Architect's View -- http://corfield.org
> 
> *From:* Alexander Hudek 
> *Sent:* Thursday, November 21, 2013 7:37 PM
> *To:* clojure@googlegroups.com 
> 
> 
> Is anyone using the java.jdbc.sql namespace? (besides World Singles :)
> 
> 
> We are using it but not the DDL. We also use honeysql in places where
> jdbc.sql cannot express the query.
> 
> -- 
> -- 
> 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: Friend roles stored in a database table

2013-11-17 Thread Dave Della Costa
Heh--I know exactly what you mean, had the exact same kind of experience
myself many times.  In any case, glad you got it working!

(2013/11/18 4:42), wm.mark@gmail.com wrote:
> Sometimes you can't see the wood for the trees I guess, I have it
> working with this trivial change:
> 
> (defn credential-fn [username]
>   (update-in (read-user username) [:roles] read-string))
> 
> Still learning the basics...
> 
> On Sunday, 17 November 2013 17:04:27 UTC, wm.ma...@gmail.com wrote:
> 
> Presumably when I read my user record from the database I need to
> "de-stringify" the roles from the database column to an actual set
> for the ":roles" rather than a string, so how do I do that for a
> string like this?
> 
>  #{:my-app-ns/admin :my-app-ns/some-other-role} 
> 
> -- 
> -- 
> 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: Friend roles stored in a database table

2013-11-17 Thread Dave Della Costa
Sounds like you've got some of this working smoothly already, so
apologies in advance if any of this is redundant.

Regarding database roles, the way I have it working in one of my simpler
apps with the default interactive form workflow is to set the
credential-fn in the workflow configuration to something like this:

(defn verify-credentials
  [creds]
  (let [valid-user (creds/bcrypt-credential-fn users/get-user-creds creds)]
;; other app-specific logic ...
valid-user)) ; finally, returns the valid-user

My get-user-creds function is what queries the database and returns the
user info, including roles, formatted for use in friend's identity map.
 In this case the roles are simply a column in the db, but of course
this can be anything as long as you end up with something that looks the
same as the map described in the friend docs (a little further down from
here: https://github.com/cemerick/friend#httpfriend-demoherokuappcom).

The password is checked using bcrypt-credential-fn (obviously you can
substitute this with a different function if you so desire) which
returns either nil or the user-record with the password stripped out.

https://github.com/cemerick/friend/blob/master/src/cemerick/friend/credentials.clj#L20

It then is returned to the interactive-form workflow, which loads it up
into friend's identity map to be stored in the session and used for
role-based authorization checks from that point forward.

https://github.com/cemerick/friend/blob/master/src/cemerick/friend/workflows.clj#L80

As far as actually storing the roles in the database, they are simply a
stringified set of namespace-qualified keywords, like so:

#{:my-app-ns/user}
#{:my-app-ns/admin :my-app-ns/some-other-role}

etc.

I hope this helps, definitely let me know if I didn't answer one of your
questions.

And I'm very happy to hear the tutorial helped you get going, by the way!

DD


(2013/11/17 18:50), wm.mark@gmail.com wrote:
> Hello,
> 
> As a long-time Java web developer, I've now been doing clojure for a few
> days so there's a lot I don't get yet, but I do have an end-to-end
> working Compojure web application with a UI, JSON web services, and
> working form-based authentication using Friend - originally using the
> in-memory users 'database' from the demos.
> 
> So what I am doing now is trying to get user name and password
> validation going against a database table.
> 
> I actually managed to get this integrated and working as a Friend
> credential-fn.
> 
> The state my application in right now is that username and password
> combinations are properly validated against my database table. So I can
> authenticate, or not, correctly.
> 
> The only piece that is not yet working is to get role authorisations
> working according to the roles in my database table.
> 
> I just can't see how I'm supposed to map one or more namespaced roles to
> either a "roles" column value, or a roles join table in the database. 
> 
> The examples for Friend show roles like "::admin", "::user", and I use
> similar roles from more than one namespace - so what should I persist in
> the database to load those roles via my credential-fn, and how should I
> populate the :roles property from the result-set?
> 
> I feel like I'm really close to getting this fully working, but I've hit
> a road-block so any pointers would be greatly appreciated.
> 
> Regards,
> 
> -M.
> 
> PS
> 
> This tutorial was very helpful, so thanks to @ddellacosta
> 
> [1] https://github.com/ddellacosta/friend-interactive-form-tutorial
> 
> -- 
> -- 
> 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] friend-oauth2 0.1.1

2013-11-12 Thread Dave Della Costa
friend-oauth2 0.1.1 is out.
https://github.com/ddellacosta/friend-oauth2

This is small fix release: Kevin Lynagh's credential-fn addition in
there for real, this time.

Thanks to Jérémie Campari (https://github.com/jeremieca) for testing it
out and discovering this issue.

DD

(2013/11/07 21:43), Dave Della Costa wrote:
> Hi folks,
> 
> friend-oauth2 0.1.0 is out.
> 
> https://github.com/ddellacosta/friend-oauth2
> 
> Changes:
> 
> - adds credential-fn for injecting your own functionality in the
> post-3rd-party-authentication stage. Thanks go to Kevin Lynagh
> (https://github.com/lynaghk) for this feature.
> 
> - More refactoring of entire codebase. Tests and code re-written to be
> more idiomatic Clojure.
> 
> Examples have been updated to reflect these changes:
> 
> https://github.com/ddellacosta/friend-oauth2-examples
> 
> ...with additional thanks to Ken Restivo (https://github.com/kenrestivo)
> for code improvements which were incorporated both into the
> friend-oauth2 lib and the examples.
> 
> Please feel free to drop me a line if you have questions or comments.
> And of course bug reports/feature requests/patches/etc. welcome.
> 
> Cheers,
> 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] Yesql 0.2.1 - Clojure & SQL queries rethought.

2013-11-11 Thread Dave Della Costa
I was about to be like, "oh no, not another one!" and then I read the
README and I thought, "oh, interesting...

So, kudos on thinking outside the box.  I certainly agree with a lot of
the points you've made.  I'll definitely be playing around with this.

Cheers,
DD

(2013/11/11 20:10), Kris Jenkins wrote:
> https://github.com/krisajenkins/yesql
> 
> Yesql is a simple library for blending SQL & Clojure together, cleanly.
> Here's how it works ,
> and how to use it .
> 
> Feedback welcomed,
> Kris
> 
> -- 
> -- 
> 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] friend-oauth2 0.1.0

2013-11-07 Thread Dave Della Costa
Hi folks,

friend-oauth2 0.1.0 is out.

https://github.com/ddellacosta/friend-oauth2

Changes:

- adds credential-fn for injecting your own functionality in the
post-3rd-party-authentication stage. Thanks go to Kevin Lynagh
(https://github.com/lynaghk) for this feature.

- More refactoring of entire codebase. Tests and code re-written to be
more idiomatic Clojure.

Examples have been updated to reflect these changes:

https://github.com/ddellacosta/friend-oauth2-examples

...with additional thanks to Ken Restivo (https://github.com/kenrestivo)
for code improvements which were incorporated both into the
friend-oauth2 lib and the examples.

Please feel free to drop me a line if you have questions or comments.
And of course bug reports/feature requests/patches/etc. welcome.

Cheers,
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: recommended: "Java: The Good Parts"

2013-11-05 Thread Dave Della Costa
Rich, thanks for the recommendation--will definitely be checking this
book out, it's just what I need.

Thanks,
DD

(2013/11/05 13:03), Rich Morin wrote:
> When I first started looking into Clojure, I was dismayed to find that
> it is deeply entangled with Java (which I had successfully avoided for
> some decades.  You mean I have to learn FP, Lisp, _and_ Java ?!?!?
> 
> I got some Java books, looked them over, and decided to hope that I
> could mostly ignore the Java-based parts of Clojure.  This was not a
> great strategy, to be sure, but it was better than diving into piles
> of Java books (and worse).
> 
> However, I recently ran across a tiny (200 pp) conceptual guide to Java
> that seems to have most of the needed information (and a healthy dose
> of opinionated advice from a highly qualified source).  I particularly
> like the fact that the author tries hard to explain the concepts as well
> as the details.  So, check it out...
> 
>   Java: The Good Parts
>   http://www.amazon.com/dp/0596803737
>   Jim Waldo, 2010; O'Reilly Media
> 
> -r
> 
>  -- 
> http://www.cfcl.com/rdm   Rich Morin   r...@cfcl.com
> http://www.cfcl.com/rdm/resumeSan Bruno, CA, USA   +1 650-873-7841
> 
> Software system design, development, and documentation
> 
> 

-- 
-- 
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: evaluating compiled clojurescript functions at the REPL

2013-10-12 Thread Dave Della Costa
Link?

(2013/10/13 14:14), Benjamin Vulpes wrote:
> Hey all!
> 
> I've written a S.O. question about Emacs/ClojureScript REPL integration.
> My basic question is:
> 
> "how ams call compiled functions and execute in browser context?"
> 
> I love working with Emacs and I also love all of the work that everyone
> has put into building a robust Emacs/CLJ* toolchain, and really look
> forward to any tips anyone has to share on getting all of the nrepl.el
> functionality in a browser-executing cljs repl.
> 
> Thanks!
> --vulpes
> 
> -- 
> -- 
> 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] 美味しいClojure

2013-10-03 Thread Dave Della Costa
Well, that would be mighty fine too. :-)

(2013/10/04 9:57), Ambrose Bonnaire-Sergeant wrote:
> Only through the magic of the internet! I'll be giving a video
> conference talk + QA.
> 
> Ambrose
> 
> 
> On Fri, Oct 4, 2013 at 8:54 AM, Dave Della Costa  <mailto:ddellaco...@gmail.com>> wrote:
> 
> Ambrose, you're in Tokyo??
> 
> In any case, Alan, that sounds great and I'm definitely interested.  It
> would be wonderful if we could keep it integrated somehow with the
> Tokyo.clj folks--I know that a lot of Japanese devs want to speak and
> hear more English, and I know that a good number of expats speak
> Japanese, so maybe we could do some kind of joint thing.  The Ruby group
> I joined a few times had that sort of setup and it was great for
> cultural exchange (both in terms of ethnic culture and programming
> community culture).
> 
> But whatever the case may be, I'm certainly interested and would love to
> get more involved with the Clojure community here.  I would certainly be
> interested in giving a talk too, or putting together some sort of
> workshop or something if that appealed.  And I'd love to hear more about
> core.typed from Ambrose!
> 
> Best,
> Dave
> 
> (2013/10/03 16:43), Ambrose Bonnaire-Sergeant wrote:
> > Me! :)
> >
> > Ambrose
> >
> >
> > On Thu, Oct 3, 2013 at 3:07 PM, Alan Busby  <mailto:thebu...@gmail.com>
> > <mailto:thebu...@gmail.com <mailto:thebu...@gmail.com>>> wrote:
> >
> > Hi Dave,
> >
> > Regarding Clojure events in Tokyo, I'm only aware of Tokyo.clj at
> > the moment and it's held in Japanese. It sounds like we have a few
> > expats here in Tokyo using Clojure though, so it might be worth
> > putting something together (in English?).
> >
> > I can likely host something at the Gracenote office here in
> Shibuya
> > if there is enough interest. If schedules work out Mr. Ambrose may
> > be able to give us a quick intro / Q+A on core.typed as well.
> >
> > Anyone interested?
> >
> >
> > Thanks,
> >Alan Busby
> >
> >
> >
> > On Thu, Oct 3, 2013 at 2:32 PM, Dave Della Costa
> > mailto:ddellaco...@gmail.com>
> <mailto:ddellaco...@gmail.com <mailto:ddellaco...@gmail.com>>> wrote:
> >
> > Speaking of, is there anything other than Tokyo.clj (which
> seems
> > pretty
> > infrequent based on this: http://atnd.org/event/tokyoclj)
> going
> > on for
> > Clojurians in Tokyo?   I work remotely, using Clojure, and
> would
> > love to
> > get together more frequently with other Clojure developers if
> > possible.
> >  If anyone is interested in doing something like
> co-working on a
> > more
> > regular basis, let me know!
> >
> > Cheers,
> > DD
> >
> > (2013/10/03 9:44), Alan Busby wrote:
> > > On Thu, Oct 3, 2013 at 9:30 AM, Marek Kubica
> > mailto:ma...@xivilization.net>
> <mailto:ma...@xivilization.net <mailto:ma...@xivilization.net>>
> > > <mailto:ma...@xivilization.net
> <mailto:ma...@xivilization.net>
> > <mailto:ma...@xivilization.net
> <mailto:ma...@xivilization.net>>>> wrote:
> > >
> > > On Tue, 1 Oct 2013 22:01:02 -0700 (PDT)
> > > Nicolas Modrzyk  <mailto:hellon...@gmail.com>
> > <mailto:hellon...@gmail.com <mailto:hellon...@gmail.com>>
> <mailto:hellon...@gmail.com <mailto:hellon...@gmail.com>
> > <mailto:hellon...@gmail.com <mailto:hellon...@gmail.com>>>>
> > > wrote:
> > >
> > > > The whole text has also been written in English, so I
> > guess there
> > > > could be a chance to put it out there.
> > > > But we have had no contacts with US/UK publishers
> so far.
> > >
> > > Did you try the usual suspects like O'Reilly or
> PragProg?
> > They are
&

Re: [ANN] 美味しいClojure

2013-10-03 Thread Dave Della Costa
Ambrose, you're in Tokyo??

In any case, Alan, that sounds great and I'm definitely interested.  It
would be wonderful if we could keep it integrated somehow with the
Tokyo.clj folks--I know that a lot of Japanese devs want to speak and
hear more English, and I know that a good number of expats speak
Japanese, so maybe we could do some kind of joint thing.  The Ruby group
I joined a few times had that sort of setup and it was great for
cultural exchange (both in terms of ethnic culture and programming
community culture).

But whatever the case may be, I'm certainly interested and would love to
get more involved with the Clojure community here.  I would certainly be
interested in giving a talk too, or putting together some sort of
workshop or something if that appealed.  And I'd love to hear more about
core.typed from Ambrose!

Best,
Dave

(2013/10/03 16:43), Ambrose Bonnaire-Sergeant wrote:
> Me! :)
> 
> Ambrose
> 
> 
> On Thu, Oct 3, 2013 at 3:07 PM, Alan Busby  <mailto:thebu...@gmail.com>> wrote:
> 
> Hi Dave,
> 
> Regarding Clojure events in Tokyo, I'm only aware of Tokyo.clj at
> the moment and it's held in Japanese. It sounds like we have a few
> expats here in Tokyo using Clojure though, so it might be worth
> putting something together (in English?).
> 
> I can likely host something at the Gracenote office here in Shibuya
> if there is enough interest. If schedules work out Mr. Ambrose may
> be able to give us a quick intro / Q+A on core.typed as well.
> 
> Anyone interested?
> 
> 
> Thanks,
>Alan Busby
> 
> 
> 
> On Thu, Oct 3, 2013 at 2:32 PM, Dave Della Costa
> mailto:ddellaco...@gmail.com>> wrote:
> 
> Speaking of, is there anything other than Tokyo.clj (which seems
> pretty
> infrequent based on this: http://atnd.org/event/tokyoclj) going
> on for
> Clojurians in Tokyo?   I work remotely, using Clojure, and would
> love to
> get together more frequently with other Clojure developers if
> possible.
>  If anyone is interested in doing something like co-working on a
> more
> regular basis, let me know!
> 
> Cheers,
> DD
> 
> (2013/10/03 9:44), Alan Busby wrote:
> > On Thu, Oct 3, 2013 at 9:30 AM, Marek Kubica
> mailto:ma...@xivilization.net>
> > <mailto:ma...@xivilization.net
> <mailto:ma...@xivilization.net>>> wrote:
> >
> > On Tue, 1 Oct 2013 22:01:02 -0700 (PDT)
> > Nicolas Modrzyk  <mailto:hellon...@gmail.com> <mailto:hellon...@gmail.com
> <mailto:hellon...@gmail.com>>>
> > wrote:
> >
> > > The whole text has also been written in English, so I
> guess there
> > > could be a chance to put it out there.
> > > But we have had no contacts with US/UK publishers so far.
> >
> > Did you try the usual suspects like O'Reilly or PragProg?
> They are
> > surprisingly approachable.
> >
> >
> > The O'Reilly Tokyo office is on the ground floor of where
> Tokyo.clj is
> > hosted too!
> >
> > --
> > --
> > 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
> <mailto: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
> <mailto:clojure%2bunsubscr...@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
> <mailto:clojure%2bunsubscr...@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" g

Re: [ANN] 美味しいClojure

2013-10-03 Thread Dave Della Costa
2010...bummer!  That sounds really interesting.

(2013/10/03 22:24), Raoul Duke wrote:
> an olide: http://www.starling-software.com/en/tsac.html. i went once
> when in town years back. it was fun. wish it were still going on.
> 

-- 
-- 
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

2013-10-02 Thread Dave Della Costa
Speaking of, is there anything other than Tokyo.clj (which seems pretty
infrequent based on this: http://atnd.org/event/tokyoclj) going on for
Clojurians in Tokyo?   I work remotely, using Clojure, and would love to
get together more frequently with other Clojure developers if possible.
 If anyone is interested in doing something like co-working on a more
regular basis, let me know!

Cheers,
DD

(2013/10/03 9:44), Alan Busby wrote:
> On Thu, Oct 3, 2013 at 9:30 AM, Marek Kubica  > wrote:
> 
> On Tue, 1 Oct 2013 22:01:02 -0700 (PDT)
> Nicolas Modrzyk mailto:hellon...@gmail.com>>
> wrote:
> 
> > The whole text has also been written in English, so I guess there
> > could be a chance to put it out there.
> > But we have had no contacts with US/UK publishers so far.
> 
> Did you try the usual suspects like O'Reilly or PragProg? They are
> surprisingly approachable.
> 
> 
> The O'Reilly Tokyo office is on the ground floor of where Tokyo.clj is
> hosted too! 
> 
> -- 
> -- 
> 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: RBAC/ACL using core.logic or similar

2013-10-02 Thread Dave Della Costa
Hi ronen,

This doesn't address your question re: how do it in pure Clojure, but as
a data point we recently implemented a wrapper for Shiro in Clojure for
use in setting policies on a ring-based web app.

We are using our own solution for checking the access policies on routes
themselves, which is wholly unrelated to Shiro.  For that matter, we
don't use anything Shiro provides (other than what it forces us to
setup, see below) relating to authentication, session or web routing,
just its authorization capabilities, and we extend their JdbcRealm
(http://shiro.apache.org/static/1.2.2/apidocs/index.html?org/apache/shiro/realm/jdbc/JdbcRealm.html)
to plug it into our system.

I'll try to lay out the pluses and minuses simply.  Pluses:

- once we figured out the architecture and where to "jack-in," it was
pretty easy to wrap stuff up inside of Clojure.

- the permission check stuff in our system was basically simply wrapping
a specific method on the Subject class:
http://shiro.apache.org/static/1.2.2/apidocs/org/apache/shiro/subject/Subject.html#checkPermission(java.lang.String)
 (more here: http://shiro.apache.org/permissions.html)

- it has a really comprehensive role and permission management set of
interfaces, and if you want to set up caching for your roles and
whatnot, it's easy to extend--from a Java perspective.

- as much as you go the "Shiro way," you will find it easy to implement
and extend.

Minuses:

- as much as you go the "Shiro way," you will find it easy to implement
and extend.

I think that, if you already had your own authentication framework set
up, it *may* be worth looking elsewhere for a RBAC/DAC/etc. solution.
If you want something comprehensive, Shiro is definitely worth checking
out.  For us I think the jury is still out on whether or not it was
worth the trouble or not.

DD

(2013/09/29 22:16), ronen wrote:
> Hey, 
> 
> I was thinking about how to approach role and permission management in
> Clojure, https://shiro.apache.org/ is one example of same a framekwork 
> 
> It sounds like a problem that core.logic could solve but I'm not sure
> how to approach it
> 
> Thought and ideas are 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/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 : Up and Running...." Newbie problem?

2013-09-06 Thread Dave Della Costa
Prasad, I'm not positive but I suspect your issue is here:

>   :cljsbuild [:builds []])

...the argument to cljsbuild must be a hashmap I believe.  It's
currently a vector.  Try:

>   :cljsbuild {:builds []})

Let us know if that doesn't work.

DD

(2013/09/07 11:25), prasad wrote:
> When I followed all the steps in the book in the "Using lein-cljsbuild"
> section I get the following behavior: (both on windows and linux, with
> different versions of clojure and lein cljsbuild. )
> 
> lein  trampoline cljsbuild repl-rhino
> java.lang.IllegalArgumentException: Key must be integer
> at clojure.lang.APersistentVector.assoc(APersistentVector.java:316)
> at clojure.lang.APersistentVector.assoc(APersistentVector.java:18)
> at clojure.lang.RT.assoc(RT.java:702)
> at clojure.core$assoc.invoke(core.clj:187)
> at clojure.core$update_in.doInvoke(core.clj:5587)
> at clojure.lang.RestFn.invoke(RestFn.java:445)
> at leiningen.cljsbuild.config$convert_builds_map.invoke(config.clj:41)
> at leiningen.cljsbuild.config$normalize_options.invoke(config.clj:148)
> at leiningen.cljsbuild.config$extract_options.invoke(config.clj:182)
> at leiningen.cljsbuild$cljsbuild.doInvoke(cljsbuild.clj:194)
> at clojure.lang.RestFn.invoke(RestFn.java:425)
> at clojure.lang.Var.invoke(Var.java:419)
> at clojure.lang.AFn.applyToHelper(AFn.java:163)
> at clojure.lang.Var.applyTo(Var.java:532)
> at clojure.core$apply.invoke(core.clj:619)
> at leiningen.core.main$resolve_task$fn__2160.doInvoke(main.clj:148)
> at clojure.lang.RestFn.applyTo(RestFn.java:139)
> at clojure.lang.AFunction$1.doInvoke(AFunction.java:29)
> at clojure.lang.RestFn.applyTo(RestFn.java:137)
> at clojure.core$apply.invoke(core.clj:619)
> at leiningen.core.main$apply_task.invoke(main.clj:188)
> at leiningen.trampoline$trampoline$fn__3842.invoke(trampoline.clj:57)
> at leiningen.trampoline$trampoline.doInvoke(trampoline.clj:55)
> at clojure.lang.RestFn.invoke(RestFn.java:442)
> at clojure.lang.Var.invoke(Var.java:423)
> at clojure.lang.AFn.applyToHelper(AFn.java:167)
> at clojure.lang.Var.applyTo(Var.java:532)
> at clojure.core$apply.invoke(core.clj:619)
> at leiningen.core.main$resolve_task$fn__2160.doInvoke(main.clj:148)
> at clojure.lang.RestFn.applyTo(RestFn.java:139)
> at clojure.lang.AFunction$1.doInvoke(AFunction.java:29)
> at clojure.lang.RestFn.applyTo(RestFn.java:137)
> at clojure.core$apply.invoke(core.clj:619)
> at leiningen.core.main$apply_task.invoke(main.clj:188)
> at leiningen.core.main$resolve_and_apply.invoke(main.clj:192)
> at leiningen.core.main$_main$fn__2223.invoke(main.clj:256)
> at leiningen.core.main$_main.doInvoke(main.clj:246)
> at clojure.lang.RestFn.invoke(RestFn.java:436)
> at clojure.lang.Var.invoke(Var.java:423)
> at clojure.lang.AFn.applyToHelper(AFn.java:167)
> at clojure.lang.Var.applyTo(Var.java:532)
> at clojure.core$apply.invoke(core.clj:617)
> at clojure.main$main_opt.invoke(main.clj:335)
> at clojure.main$main.doInvoke(main.clj:440)
> at clojure.lang.RestFn.invoke(RestFn.java:482)
> at clojure.lang.Var.invoke(Var.java:431)
> at clojure.lang.AFn.applyToHelper(AFn.java:178)
> at clojure.lang.Var.applyTo(Var.java:532)
> at clojure.main.main(main.java:37)
> 
> 
> c:\projects\code\clojurescript\hello-world>
> 
> Contents of project.clj:
> 
> (defproject hello-world "0.1.0-SNAPSHOT"
>   :description "FIXME: write description"
>   :url "http://example.com/FIXME";
>   :license {:name "Eclipse Public License"
> :url "http://www.eclipse.org/legal/epl-v10.html"}
>   :dependencies [[org.clojure/clojure "1.5.1"]]
>   :plugins [[lein-cljsbuild "0.3.2"]]
>   :cljsbuild [:builds []])
> 
> Any suggestions on how to move forward.
> 
> Thanks,
> -Prasad
> 
> -- 
> -- 
> 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, s

Re: always function?

2013-08-25 Thread Dave Della Costa
That's what I get for posting late on a Sunday.  I see now I misread
your request as a desire for a function that always returns its
argument, but it's clear now what you were looking for and constantly is
exactly it.

Sorry for the noise!

(2013/08/25 21:02), Christian Sperandio wrote:
> Not really.
> 
> The identity function returns the value. I want to have the function that 
> returns the value.
> constantly is the good answer for my needs.
> 
> 
> Le 25 août 2013 à 13:57, Dave Della Costa  a écrit :
> 
>> There is also identity, which returns what it was passed, which seems
>> closer to what you described initially.
>>
>> => (identity "foo")
>> "foo"
> 

-- 
-- 
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: always function?

2013-08-25 Thread Dave Della Costa
There is also identity, which returns what it was passed, which seems
closer to what you described initially.

=> (identity "foo")
"foo"


(2013/08/25 20:41), Christian Sperandio wrote:
> Thanks, exactly what I want :)
> 
> Le 25 aoűt 2013 ŕ 13:40, László Török  > a écrit :
> 
>> Hi,
>> 
>> (constantly 5)
>> 
>> will return a function that takes any number of args and always
>> returns 5.
>> 
>> See http://clojuredocs.org/clojure_core/clojure.core/constantly.
>> 
>> Las
>> 
>> 
>> 2013/8/25 Christian Sperandio > >
>> 
>> Hi,
>> 
>> Is there a function builds a function that returns always the
>> same value?
>> 
>> In coder words, this sort of function: (defn always [v] (fn [& _]
>> v))
>> 
>> If this function exists already, I prefer use it rather than 
>> reinvent the wheel :)
>> 
>> Christian
>> 
>> 
>> -- -- 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.
>> 
>> 
>> 
>> 
>> -- László Török
>> 
>> -- -- 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: calling java static member using string?

2013-08-14 Thread Dave Della Costa
Sorry, somehow I got the wrong line pasted in there!  Should be:

user=> (defn is-day-of-week? [day-enum] (= (.get (Calendar/getInstance)
Calendar/DAY_OF_WEEK) (day-enum weekdays)))

...but you probably figured that out. ;-)

DD


(2013/08/14 12:43), Daniel Meneses Báez wrote:
> m... the function you wrote only returns true on saturdays
> 
> but I get the point!
> 
> thanks for your answer
> 
> 
> On Wed, Aug 14, 2013 at 12:14 PM, Dave Della Costa
> mailto:ddellaco...@gmail.com>> wrote:
> 
> I know you said clj-time solved this for you, but here's another way to
> handle it which avoids using a macro (using a map of keywords to
> java.util.Calendar weekday enums for convenience and to be more
> Clojure-esque, but it isn't necessary):
> 
> user=> (def weekdays {:mon Calendar/MONDAY :tues Calendar/TUESDAY :wed
> Calendar/WEDNESDAY :thurs Calendar/THURSDAY :fri Calendar/FRIDAY :sat
> Calendar/SATURDAY :sun Calendar/SUNDAY})
> #'user/weekdays
> user=> (defn is-day-of-week? [day-enum] (= Calendar/DAY_OF_WEEK
> (day-enum weekdays)))
> #'user/is-day-of-week?
> user=> (is-day-of-week? :sat)
> false
> user=> (is-day-of-week? :wed)
> true
> user=>
> 
> You don't need to use all the Java interop syntax you're using, you can
> refer to and compare these static fields directly.  In the end these are
> simply Integer comparisons.
> 
> DD
> 
> (2013/08/14 11:45), Daniel Meneses Báez wrote:
> > I don't know if you have a differente approach, but as a defn it
> doesn't
> > work
> >
> > user> (import '[java.util Calendar])
> > java.util.Calendar
> > user> (defn is [s instant]
> > (= (.get instant Calendar/DAY_OF_WEEK)
> >(. Calendar s)))
> > CompilerException java.lang.NoSuchFieldException: s,
> > compiling:(NO_SOURCE_PATH:3:12)
> >
> > user> (defmacro is [s instant]
> > `(= (.get ~instant Calendar/DAY_OF_WEEK)
> >(. Calendar ~s)))
> > #'user/is
> > user> (is WEDNESDAY (Calendar/getInstance))
> > true
> >
> > I think that when you declare this as a function it will it attempt to
> > validate that Calendar has an 's' member, at this point that is an
> > error, on the other hand when the macro gets replaced the
> generated form
> > is valid.
> >
> > just for the fun of it, I got this working:
> >
> > user> (defmacro is [s]
> > `#(= (.get % Calendar/DAY_OF_WEEK)
> >(. Calendar ~s)))
> > #'user/is
> > user> ((is WEDNESDAY) (Calendar/getInstance))
> > true
> >
> > now I can write what I had in mind
> >
> > user> (def is-friday (is FRIDAY))
> > #'user/is-friday
> > user> (is-friday (Calendar/getInstance))
> > false
> > user> (def is-wednesday (is WEDNESDAY))
> > #'user/is-wednesday
> > user> (is-wednesday (Calendar/getInstance))
> > true
> >
> > cool xD
> >
> >
> >
> > On Wed, Aug 14, 2013 at 11:33 AM, Jim - FooBar();
> mailto:jimpil1...@gmail.com>
> > <mailto:jimpil1...@gmail.com <mailto:jimpil1...@gmail.com>>> wrote:
> >
> > why on earth is this a macro and not a regular fn?
> >
> >
> > Jim
> >
> > On 14/08/13 16:19, Daniel Meneses wrote:
> >> Hi!
> >>
> >> Thanks for your answer Sean I got it solved using clj-time
> >>
> >> Also I found the problem with my macro attempt
> >>
> >> user> (defmacro is
> >> [s instant]
> >> `(= (.get ~instant Calendar/DAY_OF_WEEK)
> >> (. Calendar ~s)))
> >> #'current-day.core/is
> >> user> (is FRIDAY (Calendar/getInstance))
> >> false
> >> user> (is WEDNESDAY (Calendar/getInstance))
> >> true
> >>
> >> I was quoting the symbol !!
> >>
> >> On Tuesday, August 13, 2013 8:21:39 PM UTC-4, Sean Corfield
> wrote:
> >>
> >> Perhaps clj-time might help you?
> >>
> >> https://github.com/clj-time/__clj-

Re: calling java static member using string?

2013-08-14 Thread Dave Della Costa
I know you said clj-time solved this for you, but here's another way to
handle it which avoids using a macro (using a map of keywords to
java.util.Calendar weekday enums for convenience and to be more
Clojure-esque, but it isn't necessary):

user=> (def weekdays {:mon Calendar/MONDAY :tues Calendar/TUESDAY :wed
Calendar/WEDNESDAY :thurs Calendar/THURSDAY :fri Calendar/FRIDAY :sat
Calendar/SATURDAY :sun Calendar/SUNDAY})
#'user/weekdays
user=> (defn is-day-of-week? [day-enum] (= Calendar/DAY_OF_WEEK
(day-enum weekdays)))
#'user/is-day-of-week?
user=> (is-day-of-week? :sat)
false
user=> (is-day-of-week? :wed)
true
user=>

You don't need to use all the Java interop syntax you're using, you can
refer to and compare these static fields directly.  In the end these are
simply Integer comparisons.

DD

(2013/08/14 11:45), Daniel Meneses Báez wrote:
> I don't know if you have a differente approach, but as a defn it doesn't
> work
> 
> user> (import '[java.util Calendar])
> java.util.Calendar
> user> (defn is [s instant]
> (= (.get instant Calendar/DAY_OF_WEEK)
>(. Calendar s)))
> CompilerException java.lang.NoSuchFieldException: s,
> compiling:(NO_SOURCE_PATH:3:12)
> 
> user> (defmacro is [s instant]
> `(= (.get ~instant Calendar/DAY_OF_WEEK)
>(. Calendar ~s)))
> #'user/is
> user> (is WEDNESDAY (Calendar/getInstance))
> true
> 
> I think that when you declare this as a function it will it attempt to
> validate that Calendar has an 's' member, at this point that is an
> error, on the other hand when the macro gets replaced the generated form
> is valid.
> 
> just for the fun of it, I got this working:
> 
> user> (defmacro is [s]
> `#(= (.get % Calendar/DAY_OF_WEEK)
>(. Calendar ~s)))
> #'user/is
> user> ((is WEDNESDAY) (Calendar/getInstance))
> true
> 
> now I can write what I had in mind
> 
> user> (def is-friday (is FRIDAY))
> #'user/is-friday
> user> (is-friday (Calendar/getInstance))
> false
> user> (def is-wednesday (is WEDNESDAY))
> #'user/is-wednesday
> user> (is-wednesday (Calendar/getInstance))
> true
> 
> cool xD
> 
> 
> 
> On Wed, Aug 14, 2013 at 11:33 AM, Jim - FooBar();  > wrote:
> 
> why on earth is this a macro and not a regular fn?
> 
> 
> Jim
> 
> On 14/08/13 16:19, Daniel Meneses wrote:
>> Hi!
>>
>> Thanks for your answer Sean I got it solved using clj-time
>>
>> Also I found the problem with my macro attempt
>>
>> user> (defmacro is
>> [s instant]
>> `(= (.get ~instant Calendar/DAY_OF_WEEK)
>> (. Calendar ~s)))
>> #'current-day.core/is
>> user> (is FRIDAY (Calendar/getInstance))
>> false
>> user> (is WEDNESDAY (Calendar/getInstance))
>> true
>>
>> I was quoting the symbol !!
>>
>> On Tuesday, August 13, 2013 8:21:39 PM UTC-4, Sean Corfield wrote:
>>
>> Perhaps clj-time might help you?
>>
>> https://github.com/clj-time/__clj-time
>> 
>>
>> (ns time.core
>>   (:require [clj-time.core :as time]
>> [clj-time.local :as local]
>> [clj-time.predicates :as p]))
>>
>> (p/monday? (time/now)) ;; false
>> (p/tuesday? (time/now)) ;; false
>> (p/wednesday? (time/now)) ;; true (for me in California since
>> (time/now) is UTC)
>>
>> (p/monday? (local/local-now)) ;; false
>> (p/tuesday? (local/local-now)) ;; true (for me)
>> (p/wednesday? (local/local-now)) ;; false (not yet in California)
>>
>> Sean
>>
>> On Tue, Aug 13, 2013 at 3:14 PM, Daniel Meneses Báez
>>  wrote:
>> > Hi :)
>> >
>> > I really want to know if there is a way to do this:
>> >
>> > (ns ...
>> >(:import [java.util Calendar]))
>> >
>> > (defsomething ;; if it is possible using a macro I'm ok with
>> that
>> >calendar-member
>> >[member]
>> > (symbol (str "Calendar/" member)))
>> >
>> > what I want to know if an instance of Calendar "isMonday",
>> "isFriday"
>> > "isSunday" etc...
>> >
>> > so I was thinking to write something like
>> >
>> > (defn- isss [day instant]
>> > (= (.get instant Calendar/DATE) (calendar-member day)))
>> >
>> > and then use it like (def is-friday (partial isss 'FRIDAY)) ;;
>> >
>> > am I being to crazy?
>> >
>> > btw I'm really loving the language.
>> >
>> >
>> >
>> > --
>> > Daniel Meneses Báez
>> >
>> > --
>> > --
>> > 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 m

Re: [ANN] verily, non-magic testing lib

2013-07-24 Thread Dave Della Costa
I think I may have been the one on IRC that provoked you to this
decision Steven, so I'm happy that you've put the project back up.  I
certainly never intended that you not build something to suit your own
purposes, and I absolutely didn't intend to suggest you shouldn't put
software out there for other people to use.

I said explicitly at one point that you may want to consider adding the
features you found missing to the libraries that are already out
there--and I still think this could be a really useful thing to do--but
that was responding to your points about what you felt was missing from
those libs.  I never meant to suggest you were being arrogant by putting
something out there in the world, or that this project was pointless or
a waste of time--that's not something I would ever want to make anyone
feel about anything they'd worked on.  So I sincerely apologize if what
I said came off that way, and I'll work on being more diplomatic in how
I phrase things in the future.

All the best, and I look forward to seeing how the project
develops--don't give up on it, and don't give up on trying new things
and putting them out there in the world for people to see!

Dave

(2013/07/24 22:16), Steven Degutis wrote:
> First, the goal of Verily was not the same as Test2. It wasn't intended
> to unify any existing test libs. It was really just meant to succeed
> clojure.test in spirit. That's all.
> 
> Second, nobody "bullied" me into this decision. Some people asked how
> Verily improved upon the alternatives, and, try as I might, I couldn't
> come up with any good answer. That's how I realized that the project was
> pointless, a waste of time, and was wrought in arrogance.
> 
> But, whether it really is useful to anyone else, that's not my decision
> to make. So I'm putting it back up and letting the community be the
> judge of that. https://github.com/evanescence/verily -- I'll still
> rename it though, soon.
> 
> -Steven
> 
> 
> On Wed, Jul 24, 2013 at 6:46 AM, Jay Fields  > wrote:
> 
> I've never spoken to Steven in anything that wasn't a public email
> to this list, so it wasn't me. I'm not sure who the self-proclaimed
> project guardians are, but I just wanted to make sure no one thought
> I was trying to "protect" https://github.com/jaycfields/expectations
> in anyway.
> 
> I don't actually think there's much value in unifying the
> infrastructure, but I agree with Meikel that no one has the right to
> tell you what you can and cannot work on. My *opinion* is that it's
> a waste of your (Steven's) time, but it costs me nothing for you
> (Steven) to try. If I'm wrong then we all benefit, which is
> obviously a good thing. I mean, we're all here because Rich wanted
> something better, right?
> 
> That said, if all you want is the ability to run the different
> styles of tests side by side, start sending pull requests to align
> the internals of the 3. I can't imagine any of Brian, Micah, and I
> would have a problem with you tweaking internals that might allow
> more people to use our software.
> 
> 
> On Wed, Jul 24, 2013 at 7:31 AM, Meikel Brandmeyer (kotarak)
> mailto:m...@kotka.de>> wrote:
> 
> 
> Am Mittwoch, 24. Juli 2013 08:14:15 UTC+2 schrieb Steven Degutis:
> 
> It's been brought to my attention that this project is an
> utter waste of time, brings no real improvement over the
> existing solutions, and was wrought in complete arrogance.
> So I've deleted the project. Sorry for wasting a thread on this.
> 
> 
> Wat? Don't let yourself be pushed by self-proclaimed project
> guardians. If you saw any use of your library, then by-all-means
> you should continue it! Even if there are other libraries
> already, you'll maybe come up with the cool new feature. Who
> knows. The worst that can happen is that you learned yourself a
> lot about doing things. And that is always a win.
> 
> From your message I get the impression that the act of "bringing
> things to your attention" was done in a rather non-diplomatic
> way. Feel free to make things public in such a case (maybe the
> case itself, not the names of the people involved). I don't
> think that this an appropriate behaviour for a community like
> clojure's. Especially since it is not done in public. It is
> absolutely arrogant to judge other people's projects in such a
> way. The other person has no right whatsoever to tell you which
> projects you should pursue and which not.
> 
> 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 fro

Re: using httpkit + core.async to build a simple WebSocket-based chat demo

2013-07-21 Thread Dave Della Costa
Excellent, glad to hear it.  And I'd love to hear more about how porting
AutobahnJS goes for you!  Seems like a perfect application of core.async
on the client-side.

(2013/07/22 3:10), Christopher Martin wrote:
> Thanks for sharing this! I'm in a similar mindset right now, working on
> a cljs port of a JS WebSocket library (AutoBahnJS) for clj-wamp
> . 
> Examples like these have been very helpful for getting up to speed on
> ClojureScript and core.async.
> 
> Cheers,
> ~Christopher Martin
> 
> On Sunday, July 21, 2013 11:43:25 AM UTC-4, David Della Costa wrote:
> 
> Hi folks,
> 
> More core.async fun.  Would love to hear comments, criticisms, etc.,
> especially on how to better integrate core.async into this.  Otherwise,
> maybe it can be inspiration to someone else to do something grander.
> Granted, it's pretty stupidly simple.
> 
> https://github.com/ddellacosta/cljs-core-async-chat
> 
> 
> Really enjoying playing with core.async, especially with ClojureScript!
> 
> Cheers,
> DD
> 
> -- 
> -- 
> 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.




using httpkit + core.async to build a simple WebSocket-based chat demo

2013-07-21 Thread Dave Della Costa
Hi folks,

More core.async fun.  Would love to hear comments, criticisms, etc.,
especially on how to better integrate core.async into this.  Otherwise,
maybe it can be inspiration to someone else to do something grander.
Granted, it's pretty stupidly simple.

https://github.com/ddellacosta/cljs-core-async-chat

Really enjoying playing with core.async, especially with ClojureScript!

Cheers,
DD

-- 
-- 
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: OAuth2

2013-07-16 Thread Dave Della Costa
Here are some more in-depth examples:

https://github.com/ddellacosta/friend-oauth2-examples

Please do use version 0.0.4 or above as anti-CSRF protection is
incorporated.  I still owe Chas a pull request with an up to date
version of friend-oauth2.

Please note, it is in development, still rather alpha, and there are
still some deficiencies I am working through now.  Depending on what you
are trying to do, you may also want to take a look at:

https://github.com/DerGuteMoritz/clj-oauth2

DD

(2013/07/16 15:36), Bastien wrote:
> Hi Plínio,
> 
> Plínio Balduino  writes:
> 
>> What are you using to authenticate with Google, Facebook, GitHub or
>> Twitter?
> 
> I'm experimenting with "friend":
> 
> https://github.com/cemerick/friend
> http://friend-demo.herokuapp.com/
> 
> HTH,
> 

-- 
-- 
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: Database migrations

2013-06-14 Thread Dave Della Costa
Coming from the Rails world, for a while I searched for a way to do
this, and at this point I've come to the conclusion that

* "raw" SQL migrations are the way to go
* rollback/down migrations are problematic for environments other than test.

Regarding specific experiences, I used Lobos for a while, and while I
don't hate it, I quickly ran into situations where its DSL just didn't
cover the types or alterations I wanted to make, and it ended up causing
more issues than it solved.

My choice was to extend it or just use SQL directly.  In another project
I was using Flyway (http://flywaydb.org/), which does everything it
needs to reasonably well, explicitly doesn't support rollbacks, and uses
SQL which supports everything I need.  It's database schema table is
easy enough to understand that I can manually rollback during
testing/development or write some scripting to handle specific cases if
need be.  So I've started moving in that direction.

TL;DR straight SQL is the way to go, and what Korny said in another reply.

DD

(2013/06/15 1:24), Reginald Choudari wrote:
> Hello all,
> 
> I am trying to implement database migrations with Clojure. So far I have
> been looking at Drift (https://github.com/macourtney/drift) as a
> candidate for implementing this. My question is, does anyone have a
> database migration workflow that they use and would like to share? One
> problem I have been thinking is how to tackle database credentials/db
> name configuration. I know in Rails its common to use a YAML to provide
> this info, wondering if there was something more idiosyncratic to clojure?
> 
> Thanks in advance
> 
> -- 
> -- 
> 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 How To Make Your Open Source Project Awesome (or: Not Suck)

2013-04-19 Thread Dave Della Costa
Good points.  I've tried to follow many of these with code I've written,
but there are still some things I could stand to do better.

Thanks for writing this, it can serve as a checklist for my own projects
from now on!

Cheers,
DD

(2013/04/20 7:09), Michael Klishin wrote:
> Month after month there are more and more people who announce their open
> source
> Clojure projects. This is great and we can't get enough of this.
> 
> What is not great is how easy it often is to get started with some of
> the projects.
> Some of the most basic "maintainer best practices" are completely
> ignored, even though
> it often takes 3 minutes to fix some annoyances.
> 
> So I wrote a little ranty blog post about what you can do to make your
> project awesome
> (or at least not suck). This also sums up what we've been trying to
> practice with
> ClojureWerkz.
> 
> I hope it will help the Clojure community to be better library
> maintainers. Here it is:
> http://blog.clojurewerkz.org/blog/2013/04/20/how-to-make-your-open-source-project-really-awesome/
> 
> Now you have no excuse to not make your library totally awesome.
> -- 
> MK
> 
> http://github.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 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: keyword bug

2013-04-14 Thread Dave Della Costa
If you give keyword two arguments the first one is the namespace, and
you are generating a namespaced keyword.  To expand on your example:

clojure.core=> (in-ns 'm)
#
m=> (clojure.core/keyword "m" "7")
:m/7
m=> {::7 "foo"}
{:m/7 "foo"}
m=>

If you want to chain strings together to make a keyword, then you'll
have to wrap them in str or the like:

clojure.core=> (keyword (str "m" "7"))
:m7
clojure.core=>

Cheers,
DD

(2013/04/15 0:37), ubun2 wrote:
> (keyword "m" "7") ;;=> :m/7
> 
> :m/7 ;;=> # :m/7>
> 
> a bug right?
> 
> -- 
> -- 
> 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: friend-oauth2 0.0.2

2012-10-24 Thread Dave Della Costa
Hi folks, for those with interest:

friend-oauth2 is an oauth2 workflow for Chas Emerick's Friend library.

https://github.com/ddellacosta/friend-oauth2

(Examples were also updated to conform to changes:
https://github.com/ddellacosta/friend-oauth2-examples)

Changelog 0.0.1 -> 0.0.2

* Added tests! Refactored!

* A helper function has been added (format-config-uri) to configure the
redirect url in the config.

* :redirect-uri in the uri-config has been renamed to
:authentication-uri, as it more closely matches the RFC (and it actually
makes sense)

* The access-token-parsefn functionality has been tweaked. If the
access-token is returned as defined in the spec
(http://tools.ietf.org/html/draft-ietf-oauth-v2-31#section-5.1, as
"application/json"), then it will automatically handle that. Otherwise
you can still pass in the access-token-parsefn to override, and it will
use that. See the Facebook and Github examples for reference. Note that
this function also now takes the entire response, rather than just the body.

Cheers,
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: ANN clojure-doc.org (aka CDS), a new community-driven Clojure documentation site

2012-10-08 Thread Dave Della Costa
Hi John, regarding the backticks for code blocks, are you talking about 
using Markdown?


It looks like because Jekyll uses the markdown parser Maruku 
(http://maruku.rubyforge.org/maruku.html), instead of the redcarpet that 
GFM uses, you'll have to use tildes instead of backticks.


Dave

(12/10/09 2:50), John Gabriele wrote:

On Monday, October 8, 2012 12:26:23 PM UTC-4, Michael Klishin wrote:

## Announcing clojure-doc.org 

I am starting a new thread because the existing one about CDS is now
polluted by all kinds of off-topics.

About a week ago, John Gabrielle


Just one ell. :)

announced CDS (Clojure Documentation Site): a new Clojure
documentation resource
for the Clojure community by the Clojure community.

We are past dealing with all the plumbing and happy to announce that
our work is now public at http://clojure-doc.org


The site is now generated using jekyll, and uses pygments for syntax
highlighting (rather than using Pandoc and my own tools like I
originally had it).

But there's one minor issue we're not crazy about: for code blocks to
get syntax highlighting, they must now be written `{% highlight clojure
%} ... {% endhighlighting %}` instead of

```clojure ... ```

If you know how to set things up such that we can use the regular
backtick syntax for codeblocks with jekyll, please let us know.

Thanks,
---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 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: Some Friend documentation and regarding documentation in general

2012-10-07 Thread Dave Della Costa

Hi Chas,

Great, I'm glad you think this is a useful contribution, and thanks for
the encouraging words!

To address some specific points:

> I know that Friend's docs are
> particularly dense, especially for anyone that just wants to use the
> stuff.  That's probably due to my using the docs to talk through the
> library's design more than anything else, in part to help potential
> workflow authors understand what's going on,

Yes, the Friend README is dense, but at the same time it is really 
helpful to have that volume of information there (especially rather than 
not at all).  What I would like to do is help provide some transitional 
material from a more basic integration level up to the level of detail 
you provide in your README.


I'm wondering if you are game for changing that into a structure 
somewhat like how Ring and Compojure are structured--I personally feel 
like those have a great setup:


- Basic high-level information in the main README, with links to
  - Wiki with detailed examples and rationale, and
  - API docs

So, that's my proposal, and I'm happy to do a pull request 
re-structuring the README to fit in this pattern (or something 
else...just one proposal) if you're interested.


Also, it's awesome, but damn, that Tolkien quote is long. ;-)

> in part to provoke
> people into protesting certain decisions (this is my first swing at
> writing an authentication/authorization library, which should petrify
> you... ;-)

I have to be honest and say I am not a security guy either; but I have 
been doing this long enough that I'm not entirely naive about web 
security (and I really doubt you are from what you've written).  It 
seems like you're starting from a good basis by attempting to emulate 
some of the other systems you listed--stuff like Warden (which I'm 
familiar with) and Spring Security (which I have to learn more about).


In the end, I think the best thing is to get the software out there as 
quickly as possible and describe your thought process--exactly as you've 
done.


And once I've implemented more Friend-based apps, I'll have a better 
idea of suggestions to make to improve both architecture and 
security--so I'll speak up when I've got more experience with it.


> I daresay you're getting the jump on me in both directions, which I
> really appreciate.

Great--if you think this is a good direction then I'll keep working on 
all of this stuff.


> I think a good next step would be for me to create a Friend
> organization (of course https://github.com/friend is taken! :-P),

Doh.  Damnit, there's nothing there, that's annoying.  I wonder if we 
could politely ask them to hand it over and see if whoever is there is 
open to the possibility...


Well, another option is to format it like ring:

https://github.com/ring-clojure/ring

...something like "friend-clojure" perhaps?

> so
> that you and others can readily contribute tutorials, example
> projects, and more that can be gradually cultivated into canonical,
> easily-approachable code and content.

Okay, sounds great!  Just let me know, and I'll start adding this stuff 
to that group.


Cheers,
DD

(12/10/07 6:33), Chas Emerick wrote:

Hi Dave,

This is a metric ton of awesome; thank you very much for taking the
time and effort to put all this together.  And, BTW, based on what
I've seen so far, I never would have thought you were new to Clojure.
:-)

cont'd…

On Oct 6, 2012, at 11:49 AM, Dave Della Costa wrote:


I think Chas Emerick writes much better docs than much of what
accompanies most Clojure libraries, but he's quite an advanced
Clojure developer, and he's moving very fast--so as a newbie, I had
difficulty even with his relatively good docs for Friend.  And I
suspect you'll be getting more and more folks from the web
development world in the next few years like me.  So it will be
good to have things from the perspective of someone not just trying
to grok the libraries that exist, but also trying to understand how
Clojure works, and how the eco-system fits together.


Noted re: Friend's docs.  I've actually fallen behind a bit on my
documentation activities this year; both Friend and nREPL are
underdocumented at the moment. I know that Friend's docs are
particularly dense, especially for anyone that just wants to use the
stuff.  That's probably due to my using the docs to talk through the
library's design more than anything else, in part to help potential
workflow authors understand what's going on, in part to provoke
people into protesting certain decisions (this is my first swing at
writing an authentication/authorization library, which should petrify
you... ;-)

I've known for some time that I'd like to have a companion project
that implements all sorts of common us

Re: Some Friend documentation and regarding documentation in general

2012-10-06 Thread Dave Della Costa
Sorry Michael, I was mistaken about it being Compojure, this is 
obviously all lein-ring territory (see in particular, "Starting a web 
server"):


https://github.com/weavejester/lein-ring

(12/10/07 2:57), Michael Klishin wrote:

2012/10/6 Dave Della Costa mailto:ddellaco...@gmail.com>>

And sorry, what do you mean by "what port?"


Will the example be accessible on http://localhost:4000, :3000 or :8080?
--
MK


--
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: Some Friend documentation and regarding documentation in general

2012-10-06 Thread Dave Della Costa
Ah, right.  Again, something I'm making assumptions about that maybe I 
shouldn't be.


I use 'lein ring server-headless' to run the app, and it always shows up 
on port 3000.  I believe this is a part of Compojure, but I have to 
admit I'm not positive--it shows up in the Compojure docs here (minus 
the 'headless' bit, which just avoids loading a browser up, something I 
don't want to be happening every time):


https://github.com/weavejester/compojure/wiki/Getting-Started

(12/10/07 2:57), Michael Klishin wrote:

2012/10/6 Dave Della Costa mailto:ddellaco...@gmail.com>>

And sorry, what do you mean by "what port?"


Will the example be accessible on http://localhost:4000, :3000 or :8080?
--
MK


--
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: Some Friend documentation and regarding documentation in general

2012-10-06 Thread Dave Della Costa
Thanks Shantanu!  Yeah, I'll ping Chas Emerick to see what he thinks if 
he doesn't tune in on this thread.


(12/10/07 2:25), Shantanu Kumar wrote:

This is fantastic documentation and Michael's feedback is apt and
valuable. I think resources like this should be linked-to from the
Friend README (or an appropriate documentation site, e.g. CDS) to
collect such pointers in one place.

Shantanu

On Oct 6, 10:02 pm, Michael Klishin 
wrote:

2012/10/6 Dave Della Costa 


I've written some material on how to use Friend, including some OAuth2
resources.  I'd appreciate any feedback you can give, I'm pretty new to
Clojure (and Lisp in general).



In any case:



https://github.com/ddellacosta/friend-interactive-form-tutorial


This tutorial is missing the crucial first step: explaining how to add
Friend as a dependency with Leiningen
(and Maven). Another thing worth adding is a section of what kind of
features Friend has: not everybody
is coming from the same background and knows what Devise and CanCan are or
what they are used
for.

I haven't done Web development in a while so maybe it's just me but I have
no idea what the "interactive form workflow"
is.




https://github.com/ddellacosta/friend-oauth2-examples


This one is missing the information about what port the example is running
on. It's running now, cool,
how do I try it out?


I have a bunch of other Clojure-related stuff on my github account too,
feedback is most welcome!


It's great to see someone writing tutorials for projects that are
fundamental building blocks (if you choose to
build a Web app in Clojure, you probably gonna need Friend or something
like Friend fairly quickly).
It will take a few rounds to make your tutorial good, don't get discouraged
by it.

And I really hope it will make it into Friend's documentation in some shape
or form.
--
MK




--
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: Some Friend documentation and regarding documentation in general

2012-10-06 Thread Dave Della Costa

Michael, this is great feedback.

> This tutorial is missing the crucial first step: explaining how to
> add Friend as a dependency with Leiningen
> (and Maven).

So, part of me had thought that these details would covered by looking 
through the source of the repo, but on consideration, I think you're 
right--this is indeed the kind of stuff I was bit by when I started 
working with Clojure.  Point taken; I'll tweak it to make that part clear.


> features Friend has: not everybody
> is coming from the same background and knows what Devise and CanCan
> are or what they are used for.

Good point--I'll add some links and/or descriptions, as it seems 
appropriate.


> I haven't done Web development in a while so maybe it's just me but I
> have no idea what the "interactive form workflow"
> is.

Another good point: this is what it is called in Friend.  I'll fix this 
so it is more clear what I mean by this (or just change the wording).


> This one is missing the information about what port the example is
> running on. It's running now, cool,
> how do I try it out?

You should just be able to clone the repo, and start it up, assuming 
you've got the necessary oauth config for FB or App.net.  The source 
should make it pretty clear, but if anything is unclear, do let me know. 
 Obviously the README is not enough, so if you play with it and have 
ideas how it can be improved, let me know.


And sorry, what do you mean by "what port?"

> It will take a few rounds to make your tutorial good, don't get
> discouraged by it.

Not at all!  This kind of feedback is exactly what I want.  I want to 
help make these docs as high quality as possible, so they can be a 
resource for those coming into the community.


I have an ulterior motive: the more folks that are using Clojure for 
building high-quality web apps, the more chance I can get a job doing 
Clojure stuff fulltime, instead of as a hobby...haha.


Anyways, I'll update this stuff as soon as I have time.  Thanks again 
for the feedback, Michael.


DD

(12/10/07 2:01), Michael Klishin wrote:



2012/10/6 Dave Della Costa mailto:ddellaco...@gmail.com>>

I've written some material on how to use Friend, including some OAuth2
resources.  I'd appreciate any feedback you can give, I'm pretty new to
Clojure (and Lisp in general).

In any case:

https://github.com/ddellacosta/friend-interactive-form-tutorial


This tutorial is missing the crucial first step: explaining how to add
Friend as a dependency with Leiningen
(and Maven). Another thing worth adding is a section of what kind of
features Friend has: not everybody
is coming from the same background and knows what Devise and CanCan are
or what they are used
for.

I haven't done Web development in a while so maybe it's just me but I
have no idea what the "interactive form workflow"
is.


https://github.com/ddellacosta/friend-oauth2-examples


This one is missing the information about what port the example is
running on. It's running now, cool,
how do I try it out?

I have a bunch of other Clojure-related stuff on my github account too,
feedback is most welcome!


It's great to see someone writing tutorials for projects that are
fundamental building blocks (if you choose to
build a Web app in Clojure, you probably gonna need Friend or something
like Friend fairly quickly).
It will take a few rounds to make your tutorial good, don't get
discouraged by it.

And I really hope it will make it into Friend's documentation in some
shape or form.
--
MK


--
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


Some Friend documentation and regarding documentation in general

2012-10-06 Thread Dave Della Costa
Hi folks,

I've been pretty slack in communicating via the mailing list, but I
realized today that there is a lot of important dialogue going on here
so I have to make more of an effort to take part--I want to be a part of
this community!

In any case, I've been using Friend a lot lately, since I come from
Ruby-on-Rails-land, and it addresses a lot of the pain points that
Devise does for me.

But (as has been mentioned in other threads quite recently),
documentation is definitely the Clojure community's week point: it's
inconsistent, formatted inconsistently (Ring and Compojure, for example,
are wonderful exceptions), and updated erratically.  When it's good,
it's great; but when it's not, it puts me off from using a library.  For
example, I stayed away from Enlive for months before I realized what a
useful library it is--so I re-wrote the README to suit my tastes
(https://github.com/ddellacosta/enlive).

I think Chas Emerick writes much better docs than much of what
accompanies most Clojure libraries, but he's quite an advanced Clojure
developer, and he's moving very fast--so as a newbie, I had difficulty
even with his relatively good docs for Friend.  And I suspect you'll be
getting more and more folks from the web development world in the next
few years like me.  So it will be good to have things from the
perspective of someone not just trying to grok the libraries that exist,
but also trying to understand how Clojure works, and how the eco-system
fits together.

I've written some material on how to use Friend, including some OAuth2
resources.  I'd appreciate any feedback you can give, I'm pretty new to
Clojure (and Lisp in general).

In any case:

https://github.com/ddellacosta/friend-interactive-form-tutorial
https://github.com/ddellacosta/friend-oauth2-examples
https://github.com/ddellacosta/friend-oauth2

I have a bunch of other Clojure-related stuff on my github account too,
feedback is most welcome!

Cheers,
DD

-- 
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: deployment

2012-08-24 Thread Dave Della Costa
Oh, and I should add that I didn't know about Pallet 
(http://palletops.com/) until your post (thanks!).  As you described, 
seems like an easy way to deploy to cloud services.  Very slick, at 
least on paper.


Sounds cool, I'll check it out.

Cheers,
Dave

(12/08/24 20:03), David Della Costa wrote:

Hi George,

It's been a few months since I was researching it but I did a similar
investigation.  I'm a web developer, with a bit (but not significant)
Java experience, but mostly coming from the Ruby/Python world.  So I
think we are probably coming from similar places.

What I ended up feeling like was, these are the options more or less:

1) Some kind of hosting which provides "out-of-the-box" Clojure
support, more or less.  I actually tried Heroku; it was was super easy
to get up and running, and very nice to work with (at least, for the
trivially simple app I set up).  I didn't try AWS but I can't imagine
it'd be that much more difficult.

2) Some people were using the strategy of keeping a REPL running
constantly and running jetty via ring:
https://github.com/ring-clojure/ring/wiki/Interactive-Development

3) Then there is setting up Jetty or Tomcat, buildling a WAR and
running your app that way.

( 4, sort-of... > * libraries like appengine-magic for hosting on GAE

GAE seems to have so many conditions to getting it set up, compared to
Heroku, say, that I didn't even begin to attempt it.  Also having used
GAE for some production sites lately, I'm not super psyched about it,
but YMMV.)

I'm leaving out some ways of approaching this but it kind of sums up
the general strategies for web apps, to the best of my knowledge.

#1 is ideal if you've got some money to throw at it.

#2 to me is crazy, but I'm thinking about things in terms of actually
deploying real web applications with a team of people.

so that leaves #3.  It seems to be the most flexible and cheapest
option, while still being stable.  It has the (perhaps major)
disadvantage of forcing you to run your own version of Tomcat/Jetty
and therefore have a setup where you can host that kind of thing.

I wrote a tutorial explaining my approach, which also has some links
to other approaches, maybe it'll be helpful to you. (I'd also love to
hear any feedback you have about things that are missing or incorrect
or outdated.)

https://github.com/ddellacosta/Clojure-under-Jetty-and-Apache

Cheers,
Dave

2012/8/18 George Oliver :

hi,

I'm a Clojure beginner working on a web project and starting to think about
deployment. Currently I host my project in a local VM and have a small VPS
for public testing. Looking down the road I'd like a more flexible hosting
solution.

It seems like the hosting landscape is changing fast so I'd like to know --
how do you deploy your projects 'now'?

So far I've found stuff like:

* A continuum of Clojure support from cloud providers, with some free tiers
at AWS, Heroku, Openshift, etc.
* tools like lein-beanstalk for hosting apps on Elastic Beanstalk
* libraries like appengine-magic for hosting on GAE
* libraries like pallet for abstracting deployment to multiple cloud
providers
* many more tools depending on how much 'more Java' you're willing to
incorporate into your project, for example deploying a WAR in a Tomcat
container (not even sure I have the lingo right there! :) )
* combining these tools and libraries with CI tools such as Jenkins for a
complete automatic develop -> build -> deploy solution.

 From what I've seen, and given that (a) I have a small project (probably not
more than 5k users eventually) and (b) I'm not a professional programmer,
but (c) I'd like to manage this in a professional way, it seems like a
strategy could be:

1. use a tool like lein-beanstalk for public deployment and use simple
scripts for building
2. in the meantime get familiar with pallet for more flexibility in the
future
3. eventually deploy using pallet
4. at this point learn a CI tool to fully automate the process.

What do you think?


thanks, George

--
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