Re: testing clojure.core/group-by with clojure.test.check

2014-05-01 Thread henry w
thanks Alex and others for helping out. Some very interesting ideas here 
but the one about leveraging the grouping function seemed easy and reading 
that was an epiphany moment where i realised i had been subconsciously 
constrained by thinking I should generate data and use a grouping fn that 
was similar to the narrow ways I happen to have used the group-by fn in the 
past.

I would like to read more though and if I see good resources on scala or 
haskell equivalent I will try to pass on via pull request.

fyi, here are encodings of the 3 properties I originally stated. I used 
count for group-by fn in all 3.

;;test group by

(def vector-of-strings (gen/vector gen/string))

(def grouping-retains-all-input
  flattening the vals of the group-by result should give back contents of 
the original collection
  (prop/for-all [group-by-input vector-of-strings]
(= (set group-by-input) (- (group-by count group-by-input) 
vals flatten set

(def all-members-under-grouping-key-should-be-there
  applying the grouping fn to each item under a grouping should result in 
the grouping key
  (prop/for-all [group-by-input vector-of-strings]
(every? #(= true %)
   (map (fn [[key group]] (apply = key (map count 
group)))
(group-by count group-by-input)

(def grouping-does-not-duplicate
  (prop/for-all [group-by-input vector-of-strings]
(= (count group-by-input) (- (group-by count 
group-by-input) vals flatten count


On Thursday, May 1, 2014 12:49:31 AM UTC+1, Andrew Chambers wrote:

 One approach you can use is write the generators in such a way that they 
 generate the final answer group-by should return, then you write code
 which does the inverse to group by and then you check the group by answer 
 is equal to the originally generated solution.  

 On Wednesday, April 30, 2014 11:38:19 PM UTC+12, henry w wrote:

 Hi, I wanted to get started with clojure.test.check (formerly 
 simple-check) and I am new to property based testing.

 I plucked clojure.core/group-by for no particular reason as a function to 
 test.

 I started by stating some properties i think should hold:

 ;; 1. applying the grouping key function to each member in a grouping 
 should result in the grouping key
 ;; 2. flattening the vals of the group-by result should give back the 
 contents of the original collection.
 ;; 3. no element appears in more than one grouping.

 so far so good I think. there may be others but this seems ok for now. 

 now, how to generate some data.

 for group-by we need two params:
 1) a grouping function
 2) a collection of items to be grouped

 If I start by naively generating collections of maps (containing keyword 
 keys and int vals, for example), the data is of the right shape to use in 
 group by, but there is no guarantee that:
 1) any of the maps share a key that I could use for grouping
 2) the values under a common key are shared

 This is really the crux of my problem ideally I would have the 
 generator *mostly* produce data which is actually doing to result in the 
 sort of collection i might want to call group-by on in real life (ie not 
 have everything grouped under nil on each generation). So should i create a 
 generator that creates keywords (which i will want to use as grouping 
 function) then have another generator that produces what are going to be 
 the values under this grouping key, then a generator that uses both of 
 these to create collections of maps from these. then i would have to find 
 out what the grouping keyword was that was generated this could all 
 work, I have read enough about generators to have a stab at this... but is 
 it the right approach?

 as far as implementing tests for the properties so far, I have done 
 property 2 above, using a basic generator and yanking out an arbitrary key 
 from it clearly a flawed approach as not much 'realistic' grouping is 
 going to happen here.

 (def vector-of-maps (gen/such-that not-empty (gen/vector (gen/such-that 
 not-empty (gen/map gen/keyword gen/int)

 (def all-elements-are-grouped
   (prop/for-all [group-by-input vector-of-maps]
 (let [a-map-key (- group-by-input first keys first)] ;; 
 hmm, seems far from ideal
   (= (set group-by-input) (- (group-by a-map-key 
 group-by-input) vals flatten set)

 help appreciated... perhaps I need to learn more about the paradigm 
 first, but resources linked from the readme are all a bit more basic than 
 this. so if you know of some more advanced tutorials please let me know.

 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

Re: clojure code to java

2014-05-01 Thread henry w
for understanding what goes on in clojure to class file compilation, i have 
found this blog series very interesting: 
http://blog.guillermowinkler.com/blog/2014/04/27/decompiling-clojure-iii/

On Thursday, May 1, 2014 5:56:08 AM UTC+1, Andy Fingerhut wrote:

 Leiningen can convert Clojure source code to Java .class files (compiled 
 Java byte code, not Java source code), with the help of the Clojure 
 compiler.

 I don't know of a way Leiningen can convert that to Java source code, 
 unless there is some feature of Leiningen I haven't learned about yet, or 
 some plugin that does that.

 There are several programs out there, some open source, some commercial, 
 that can decompile Java byte code files into Java source code, of varying 
 quality.  I have used a trial version of the AndroChef Java Decompiler 1.0 
 a few times in the past, and found its results better than one other open 
 source Java decompiler I tried (I don't remember what that was called right 
 now).

 
 http://www.neshkov.com/ac_decompiler.htmlhttp://www.google.com/url?q=http%3A%2F%2Fwww.neshkov.com%2Fac_decompiler.htmlsa=Dsntz=1usg=AFQjCNELMB-Kz689Y3YbzpIgravhxAF7Gw

 Andy


 On Wed, Apr 30, 2014 at 7:05 PM, Julio Berina julio...@gmail.comjavascript:
  wrote:

 I've been programming a bit in Clojure, and in my opinion it's like 
 making Java programs without typing long Java because of it running on the 
 JVM.  However, I wanna be able to convert my Clojure code to Java code.  I 
 know Leiningen can do that, but I am really clueless at this point, and I 
 don't know what other programs out there will convert Clojure to Java 
 .class file.  Does anyone have any tips?

 -- 
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clo...@googlegroups.comjavascript:
 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 javascript:
 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 javascript:.
 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: Access the datastructure used to create a function?

2014-05-01 Thread henry w
related to this discussion and v. interesting: 
http://blog.guillermowinkler.com/blog/2014/04/27/decompiling-clojure-iii/

On Tuesday, November 26, 2013 10:04:12 PM UTC, Guru Devanla wrote:

 The important caveat here is what  do we label as data?. If we are okay 
 with just 'streams of bytes' that will make us understand and reason some 
 information about the function, then may be the bytecode itself could be 
 sufficient and could be considered to be data. But, I guess the original 
 question was regarding data that one could reason in the form on clojure 
 forms itself. At least, that is what I believe Henry was referring to, 
 isn't?

 -Guru 



 On Tue, Nov 26, 2013 at 1:51 PM, henry w henr...@gmail.com 
 javascript:wrote:

 The thing is, the data contained in the source definition is all still 
 there in the compiled version - but apparently it is not easily accessible. 
 It feels like it must be possible to write a function that looks at a 
 function object and it's class and can produce at least a decent 
 approximation to the original, or at least a clojure list version of the 
 compiled code. No doubt completely faithful recreation wouldn't be 
 possible, not least because of macros.

 Also, sometimes, such as when developing possibly, it is not always 
 necessary to have optimum performance.




 On Tuesday, November 26, 2013 8:30:38 PM UTC, Alex Miller wrote:

 Seems like you lost the clojure mailing list in this response, so I 
 re-added it.

 On Tue, Nov 26, 2013 at 2:09 PM, henry w henr...@gmail.com wrote:

 Thanks to all respondents. 

 This was really just something I was curious about, although I can 
 think of some practical uses. 

 It's just not clear to me still if there is some really good reason 
 code stops being data (or at least having an accessible data 
 representation) after it is compiled. Jamie has shown it is still data, 
 although in a very platform-specific way. Is it just the case that there 
 aren't compelling use-cases that people have come up with perhaps?


 Code stops being data so it can be a more efficient form to the host 
 platform (bytecode), which is what makes Clojure perform well. If you 
 always left the data in the original form, you would just need an 
 interpreter (and Clojure would be much slower). Clojure is always compiled 
 as performance is a key concern.
  

 Pratically, some examples of use might be related to the 
 https://github.com/clojure/tools.trace library. Here vars are 
 temporarily bound to functions that are wrapped versions of the functions 
 they held previously in order to print input and output. A nice 
 alternative 
 would be to show the function form with the parameters interpolated. 
 Another case might be to see not just the source of a function, but to 
 'inline' the source of functions called from it. Or just generally mess 
 about with functions I don't own.


 There has been a recent enhancement discussion (perhaps here, perhaps 
 jira, can't find it now) to have functions retain their source definition 
 at runtime. I'm not sure how that would be possible without significantly 
 affecting performance and memory footprint however.
  




 On Tuesday, November 26, 2013 7:01:57 PM UTC, Alex Miller wrote:

 It would help to know what your real goal is, but compiled Clojure 
 does not retain the original source form. 

 One hook you do have though is macros which will be invoked prior to 
 compilation. At macro execution time, you have access to the special 
 form 
 var which is the original form (as a Clojure data structure). 

 Thus you could write a defn-like macro which when called to define a 
 function definition would define the function and decorate it with meta 
 that included the definition. I am a poor enough macrologist that I will 
 not attempt that here but merely suggest it should be feasible. :)  

 Alex

 On Thursday, November 21, 2013 12:14:39 PM UTC-6, henry w wrote:

 Say you have a function created like this:

 (fn [x] (+ x y))

 and then you have a reference to an instance of this function, is 
 there some way to use the function reference to access the list '(fn [x] 
 (+ 
 x y)),
 including the symbol 'y' (such that you could dereference 'y' and get 
 its value)? The source function is not the right thing and so far 
 googling 
 hasn't got me the answer.

 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.comjavascript:
 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 javascript:
 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 

Re: Proposing a new Clojure documentation system (in Clojure)

2014-05-01 Thread Phillip Lord
Sean Corfield s...@corfield.org writes:

 Short, clear docstrings and well-structured code with well-named
 symbols short provide enough information for maintenance.

But, sadly, not enough documentation for use. The state of Clojure
survey brings up complaints about the documentation of clojure.core
every year.

Partly this because the documentation is not very good -- I still use
Clojuredocs regularly, even though it's rather rusting away being on
1.3.  I rarely read the documentation, just skip to the examples.

But, partly, it's because the documentation format is just too simple.
Javadoc, for example, is far better. And is Javadoc literate
programming? If it is, then the idea that no one uses literate
programming is wrong, if it is not, then literate programming is
irrelevant.

Even some simple documentation standards for Clojure, distinguishing
parameters, functions and so on would be a step forward. And it needs to
go into clojure.core so that tools support it.

Phil


-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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 code to java

2014-05-01 Thread Phillip Lord

I've used procyon

https://bitbucket.org/mstrobel/procyon/wiki/Java%20Decompiler

It decompiles all of clojure.core and produces nicely laid out code (see
below).

package clojure;

import clojure.lang.*;

public final class core$first extends AFunction
{
public Object invoke(Object coll) {
final Object x = coll;
coll = null;
return RT.first(x);
}
}


Phil


Andy Fingerhut andy.finger...@gmail.com writes:
 There are several programs out there, some open source, some commercial,
 that can decompile Java byte code files into Java source code, of varying
 quality.  I have used a trial version of the AndroChef Java Decompiler 1.0
 a few times in the past, and found its results better than one other open
 source Java decompiler I tried (I don't remember what that was called right
 now).

 http://www.neshkov.com/ac_decompiler.html

 Andy


 On Wed, Apr 30, 2014 at 7:05 PM, Julio Berina juliober...@gmail.com wrote:

 I've been programming a bit in Clojure, and in my opinion it's like making
 Java programs without typing long Java because of it running on the JVM.
  However, I wanna be able to convert my Clojure code to Java code.  I know
 Leiningen can do that, but I am really clueless at this point, and I don't
 know what other programs out there will convert Clojure to Java .class
 file.  Does anyone have any tips?

 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from 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.


-- 
Phillip Lord,   Phone: +44 (0) 191 222 7827
Lecturer in Bioinformatics, Email: phillip.l...@newcastle.ac.uk
School of Computing Science,
http://homepages.cs.ncl.ac.uk/phillip.lord
Room 914 Claremont Tower,   skype: russet_apples
Newcastle University,   twitter: phillord
NE1 7RU 

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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.


[pre-ANN] Clortex - a VisiCalc for Machine Intelligence Based on Neuroscience?

2014-05-01 Thread Fergal Byrne
Until today, I've been developing Clortex using a private repo on Github.
While far from complete, I feel that Clortex is now at the stage where
people can take a look at it, give feedback on the design, and help shape
the completion of the first alpha release over the coming weeks.

I'll be hacking on Clortex this weekend (May 3rd-4th) at the NuPIC Spring
Hackathon in San José, please join us on the live feeds and stay in touch
using the various Social Media tools.

Details - http://numenta.org/events.html#nupic_spring_2014_hackathon

*WARNING:* Clortex is not even at the alpha stage yet. I'll post
instructions over the next few days which will allow you to get some
visualisations running.

You can find Clortex on Github at https://github.com/fergalbyrne/clortex

A quick intro:

*A new kind of computing requires a new kind of software design.*

Hierarchical Temporal Memory (HTM) and the Cortical Learning Algorithm
(CLA) represent a new kind of computing, in which many, many millions of
tiny, simple, unreliable components interact in a massively parallel,
emergent choreography to produce what we would recognise as intelligence.

Jeff Hawkins and his company, Numenta, have built a system called NuPIC
using the principles of the neocortex. Clortex is a reimagining of CLA,
using modern software design ideas to unleash the potential of the theory.

Clortex’ design is all about turning constraints into synergies, using the
expressive power and hygiene of Clojure and its immutable data structures,
the unique characteristics of the Datomic database system, and the
scaleability and portability characteristics of the Java Virtual Machine.
Clortex will run on hosts as small as Raspberry Pi, a version will soon run
in browsers and phones, yet it will scale layers and hierarchies across
huge clusters to deliver real power and test the limits of HTM and CLA in
production use.

*How can you get involved?*

Clortex is just part of a growing effort to realise the potential of
Machine Intelligence based on the principles of the brain.

   - Visit the Numenta.org site for videos, white papers, details of the
   NuPIC mailing list, wikis, etc.
   - Have a look at (and optionally pre-purchase) my Leanpub.com book: Real
   Machine Intelligence with Clortex and
NuPIChttp://leanpub.com/realsmartmachines
   .
   - Join the Clortex Google
Grouphttps://groups.google.com/forum/#!forum/clortexfor discussion
and updates.
   - We'll be launching an Indiegogo campaign during May 2014 to fund
   completion of Clortex, please let us know if you're interested in
   supporting us when we launch.



-- 

Fergal Byrne, Brenter IT

Author, Real Machine Intelligence with Clortex and NuPIC
https://leanpub.com/realsmartmachines

Speaking on Clortex and HTM/CLA at euroClojure Krakow, June 2014:
http://euroclojure.com/2014/
and at LambdaJam Chicago, July 2014: http://www.lambdajam.com

http://inbits.com - Better Living through Thoughtful Technology
http://ie.linkedin.com/in/fergbyrne/ - https://github.com/fergalbyrne

e:fergalbyrnedub...@gmail.com t:+353 83 4214179
Join the quest for Machine Intelligence at http://numenta.org
Formerly of Adnet edi...@adnet.ie http://www.adnet.ie

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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: Do not understand the - macro here

2014-05-01 Thread Roelof Wobben
Is this a nice explanation about macros : 
http://bryangilbert.com/code/2013/07/30/anatomy-of-a-clojure-macro/

or is there a better one for a beginner. 

Roelof
 

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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 code to java

2014-05-01 Thread Alex Miller
In general, the bytecode the Clojure compiler produces is not directly 
transformable back into Java source by any decompiler I'm aware of.


On Wednesday, April 30, 2014 11:56:08 PM UTC-5, Andy Fingerhut wrote:

 Leiningen can convert Clojure source code to Java .class files (compiled 
 Java byte code, not Java source code), with the help of the Clojure 
 compiler.

 I don't know of a way Leiningen can convert that to Java source code, 
 unless there is some feature of Leiningen I haven't learned about yet, or 
 some plugin that does that.

 There are several programs out there, some open source, some commercial, 
 that can decompile Java byte code files into Java source code, of varying 
 quality.  I have used a trial version of the AndroChef Java Decompiler 1.0 
 a few times in the past, and found its results better than one other open 
 source Java decompiler I tried (I don't remember what that was called right 
 now).

 http://www.neshkov.com/ac_decompiler.html

 Andy


 On Wed, Apr 30, 2014 at 7:05 PM, Julio Berina julio...@gmail.comjavascript:
  wrote:

 I've been programming a bit in Clojure, and in my opinion it's like 
 making Java programs without typing long Java because of it running on the 
 JVM.  However, I wanna be able to convert my Clojure code to Java code.  I 
 know Leiningen can do that, but I am really clueless at this point, and I 
 don't know what other programs out there will convert Clojure to Java 
 .class file.  Does anyone have any tips?

 -- 
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clo...@googlegroups.comjavascript:
 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 javascript:
 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 javascript:.
 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: difference in behavior for :let modifiers in for vs. doseq

2014-05-01 Thread Alex Miller
The code in question is of course easily transformable into:

 (let [a 1] (for [b '(1 2 3)] (println a b)))

and I think that most examples people have given are similarly rewritable. 
I'm generally in favor of fixing nits like this (removing exceptional 
cases) so the question does not need to be asked, it is a low priority (and 
others in the approval chain may not concur with me :).

Alex

On Wednesday, April 30, 2014 11:48:39 PM UTC-5, Andy Fingerhut wrote:

 At least a few people consider it a bug, and two of them created a ticket, 
 the first of which was declined as not a bug.  That is some evidence that 
 it is considered not a bug:

 http://dev.clojure.org/jira/browse/CLJ-1316
 http://dev.clojure.org/jira/browse/CLJ-207

 Andy


 On Wed, Apr 30, 2014 at 9:39 PM, Yuri Niyazov 
 yuri.n...@gmail.comjavascript:
  wrote:

 Hello everyone, 

   In Clojure 1.6:

 user (doseq [:let [a 1] b '(1 2 3)] (println a b))
 1 1
 1 2
 1 3
 nil
 user (for [:let [a 1] b '(1 2 3)] (println a b))
 IllegalStateException Can't pop empty vector 
  clojure.lang.PersistentVector.pop (PersistentVector.java:381)
 user 

 Is this expected behavior? a bug? Something I missed in the documentation?

 -- 
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clo...@googlegroups.comjavascript:
 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 javascript:
 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 javascript:.
 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: Parameter order for APIs

2014-05-01 Thread Alex Miller


On Wednesday, April 30, 2014 10:22:55 PM UTC-5, Colin Fleming wrote:

 Hi everyone,

 After the very interesting keyword argument debate, I have another 
 question about API design. Specifically I'm interested in suggestions about 
 parameter order. The new API guidelines, which have changed very recently 
 to favour maps over keyword args, also changed to include a suggestion that 
 the keyword map be the first argument, since it's the least variance 
 argument. 

 I've been using some fairly simple rules to order my parameters, basically 
 1) functions that operate on collections should have the collection last to 
 interoperate with -,

 

  

and 2) functions operating on a main object should accept that first, to 
 interoperate with -. #2 is generally pretty intuitive since it's the same 
 as Java interop and protocol calls, but there's still a fair amount of 
 ambiguity with just these rules unless all your functions have one or two 
 arguments.


In the core library, collection functions (that take a collection and 
return a modified collection, ex: get, assoc, conj) take their argument 
*first* and work with -. Sequence functions (which take a seqable and 
return a sequence) take their argument *last* and work with -. I would 
suggest that as a first preference. 
 


 I'm interested in opinions about the variance ordering, since I assume 
 this is to facilitate use of partial and the like. I never really use 
 partial myself so I don't have a good feeling for how this ordering should 
 work - any comments or opinions?


I don't tend to use partial a lot but do occasionally re-order args to make 
that feasible. 
 


 Thanks,
 Colin


-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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: Do not understand the - macro here

2014-05-01 Thread Erlis Vidal
I think the confusion is because they used multiple values when comparing
the equality

(= (__ (sort (rest (reverse [2 5 4 1 3 6]
   (- [2 5 4 1 3 6] (reverse) (rest) (sort) (__))
   5)

This can be seen as :
(def A (__ (sort (rest (reverse [2 5 4 1 3 6])
(def B (- [2 5 4 1 3 6] (reverse) (rest) (sort) (__)))

Then the 4Clojure exercise can be written as:

(= A B 5)

Do not feel bad, this took me some time to realize 5 was not part of B.



On Thu, May 1, 2014 at 7:52 AM, Roelof Wobben rwob...@hotmail.com wrote:

 Is this a nice explanation about macros :
 http://bryangilbert.com/code/2013/07/30/anatomy-of-a-clojure-macro/

 or is there a better one for a beginner.

 Roelof


 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from 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: Do not understand the - macro here

2014-05-01 Thread Roelof Wobben


Op donderdag 1 mei 2014 15:20:38 UTC+2 schreef Erlis Vidal:

 I think the confusion is because they used multiple values when comparing 
 the equality 

 (= (__ (sort (rest (reverse [2 5 4 1 3 6]
(- [2 5 4 1 3 6] (reverse) (rest) (sort) (__))
5)

 This can be seen as :  
 (def A (__ (sort (rest (reverse [2 5 4 1 3 6])
 (def B (- [2 5 4 1 3 6] (reverse) (rest) (sort) (__)))

 Then the 4Clojure exercise can be written as: 

 (= A B 5)

 Do not feel bad, this took me some time to realize 5 was not part of B.


No problem. But still it does not make any sense. 

If I do it right. this schould be the output of the functions 

A [ 1 2 3 4 5] 
B [ 1 2 3 4 5] 
(= A B 5) -- [1,2,3,4,5] = [1,2,3,4,5] = 5 and this is not true. 

 




 On Thu, May 1, 2014 at 7:52 AM, Roelof Wobben rwo...@hotmail.comjavascript:
  wrote:

 Is this a nice explanation about macros : 
 http://bryangilbert.com/code/2013/07/30/anatomy-of-a-clojure-macro/

 or is there a better one for a beginner. 

 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.comjavascript:
 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 javascript:
 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 javascript:.
 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] om-start lein template for nrepl compliant editors/IDEs

2014-05-01 Thread Ivan L
Thanks mimmo!  Looking forward to trying this 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/d/optout.


Re: clojure code to java

2014-05-01 Thread Phillip Lord

Really, try procyon.

Of course, it depends on whether you mean java code that you can look
at, and get an idea of what is going on easier than looking at
bytecode, or java code that you can compile to get the same thing that
you decompiled. The latter no, but the former works.

Phil

Alex Miller a...@puredanger.com writes:

 In general, the bytecode the Clojure compiler produces is not directly 
 transformable back into Java source by any decompiler I'm aware of.


-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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: Do not understand the - macro here

2014-05-01 Thread Maik Schünemann
On Thu, May 1, 2014 at 3:51 PM, Roelof Wobben rwob...@hotmail.com wrote:



 Op donderdag 1 mei 2014 15:20:38 UTC+2 schreef Erlis Vidal:

 I think the confusion is because they used multiple values when comparing
 the equality

 (= (__ (sort (rest (reverse [2 5 4 1 3 6]
(- [2 5 4 1 3 6] (reverse) (rest) (sort) (__))
5)

 This can be seen as :
 (def A (__ (sort (rest (reverse [2 5 4 1 3 6])
 (def B (- [2 5 4 1 3 6] (reverse) (rest) (sort) (__)))

 Then the 4Clojure exercise can be written as:

 (= A B 5)

 Do not feel bad, this took me some time to realize 5 was not part of B.


 No problem. But still it does not make any sense.

 If I do it right. this schould be the output of the functions

 A [ 1 2 3 4 5]
 B [ 1 2 3 4 5]
 (= A B 5) -- [1,2,3,4,5] = [1,2,3,4,5] = 5 and this is not true.

   This is the output when you don't write the function to replace __.








 On Thu, May 1, 2014 at 7:52 AM, Roelof Wobben rwo...@hotmail.com wrote:

 Is this a nice explanation about macros : http://bryangilbert.com/code/
 2013/07/30/anatomy-of-a-clojure-macro/

 or is there a better one for a beginner.

 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: Do not understand the - macro here

2014-05-01 Thread Maik Schünemann
The task is to replace __ with the function that makes this true in this
case makes [1 2 3 4 5] to 5


On Thu, May 1, 2014 at 4:23 PM, Maik Schünemann
maikschuenem...@gmail.comwrote:




 On Thu, May 1, 2014 at 3:51 PM, Roelof Wobben rwob...@hotmail.com wrote:



 Op donderdag 1 mei 2014 15:20:38 UTC+2 schreef Erlis Vidal:

 I think the confusion is because they used multiple values when
 comparing the equality

 (= (__ (sort (rest (reverse [2 5 4 1 3 6]
(- [2 5 4 1 3 6] (reverse) (rest) (sort) (__))
5)

 This can be seen as :
 (def A (__ (sort (rest (reverse [2 5 4 1 3 6])
 (def B (- [2 5 4 1 3 6] (reverse) (rest) (sort) (__)))

 Then the 4Clojure exercise can be written as:

 (= A B 5)

 Do not feel bad, this took me some time to realize 5 was not part of B.


 No problem. But still it does not make any sense.

 If I do it right. this schould be the output of the functions

 A [ 1 2 3 4 5]
 B [ 1 2 3 4 5]
 (= A B 5) -- [1,2,3,4,5] = [1,2,3,4,5] = 5 and this is not true.

This is the output when you don't write the function to replace __.








 On Thu, May 1, 2014 at 7:52 AM, Roelof Wobben rwo...@hotmail.comwrote:

 Is this a nice explanation about macros : http://bryangilbert.com/code/
 2013/07/30/anatomy-of-a-clojure-macro/

 or is there a better one for a beginner.

 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: Do not understand the - macro here

2014-05-01 Thread Erlis Vidal
Look that (def A ...) won't compile as given, so you cannot say A is [1 2 3
4 5], A is something else once you make it compile filling the blank space
with the missing function.


On Thu, May 1, 2014 at 10:24 AM, Maik Schünemann
maikschuenem...@gmail.comwrote:

 The task is to replace __ with the function that makes this true in this
 case makes [1 2 3 4 5] to 5


 On Thu, May 1, 2014 at 4:23 PM, Maik Schünemann maikschuenem...@gmail.com
  wrote:




 On Thu, May 1, 2014 at 3:51 PM, Roelof Wobben rwob...@hotmail.comwrote:



 Op donderdag 1 mei 2014 15:20:38 UTC+2 schreef Erlis Vidal:

 I think the confusion is because they used multiple values when
 comparing the equality

 (= (__ (sort (rest (reverse [2 5 4 1 3 6]
(- [2 5 4 1 3 6] (reverse) (rest) (sort) (__))
5)

 This can be seen as :
 (def A (__ (sort (rest (reverse [2 5 4 1 3 6])
 (def B (- [2 5 4 1 3 6] (reverse) (rest) (sort) (__)))

 Then the 4Clojure exercise can be written as:

 (= A B 5)

 Do not feel bad, this took me some time to realize 5 was not part of B.


 No problem. But still it does not make any sense.

 If I do it right. this schould be the output of the functions

 A [ 1 2 3 4 5]
 B [ 1 2 3 4 5]
 (= A B 5) -- [1,2,3,4,5] = [1,2,3,4,5] = 5 and this is not true.

This is the output when you don't write the function to replace __.








 On Thu, May 1, 2014 at 7:52 AM, Roelof Wobben rwo...@hotmail.comwrote:

 Is this a nice explanation about macros :
 http://bryangilbert.com/code/2013/07/30/anatomy-of-a-clojure-macro/

 or is there a better one for a beginner.

 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.


-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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: Do not understand the - macro here

2014-05-01 Thread Roelof Wobben
oke, 

I misunderstood everyone.
The right answer is last. 

(def A (__ (sort (rest (reverse [2 5 4 1 3 6])
which would be : 

(def A (last (sort (rest (reverse [2 5 4 1 3 6])
which resolves to 5 

(def B (- [2 5 4 1 3 6] (reverse) (rest) (sort) (__)))
Which would be : 

(def B (- [2 5 4 1 3 6] (reverse) (rest) (sort) (last)))

which resolves also to 5 

so the last part : 

( = a b 5) is also true ( = 5 5 5) 

Still I find it wierd to make such sort of form. 

Roelof
 

Op donderdag 1 mei 2014 16:35:59 UTC+2 schreef Erlis Vidal:

 Look that (def A ...) won't compile as given, so you cannot say A is [1 2 
 3 4 5], A is something else once you make it compile filling the blank 
 space with the missing function. 


 On Thu, May 1, 2014 at 10:24 AM, Maik Schünemann 
 maiksch...@gmail.comjavascript:
  wrote:

 The task is to replace __ with the function that makes this true in this 
 case makes [1 2 3 4 5] to 5


 On Thu, May 1, 2014 at 4:23 PM, Maik Schünemann 
 maiksch...@gmail.comjavascript:
  wrote:




 On Thu, May 1, 2014 at 3:51 PM, Roelof Wobben 
 rwo...@hotmail.comjavascript:
  wrote:



 Op donderdag 1 mei 2014 15:20:38 UTC+2 schreef Erlis Vidal:

 I think the confusion is because they used multiple values when 
 comparing the equality 

 (= (__ (sort (rest (reverse [2 5 4 1 3 6]
(- [2 5 4 1 3 6] (reverse) (rest) (sort) (__))
5)

 This can be seen as :  
 (def A (__ (sort (rest (reverse [2 5 4 1 3 6])
 (def B (- [2 5 4 1 3 6] (reverse) (rest) (sort) (__)))

 Then the 4Clojure exercise can be written as: 

 (= A B 5)

 Do not feel bad, this took me some time to realize 5 was not part of B.


 No problem. But still it does not make any sense. 

 If I do it right. this schould be the output of the functions 

 A [ 1 2 3 4 5] 
 B [ 1 2 3 4 5] 
 (= A B 5) -- [1,2,3,4,5] = [1,2,3,4,5] = 5 and this is not true. 

This is the output when you don't write the function to replace __.
  


  

  


 On Thu, May 1, 2014 at 7:52 AM, Roelof Wobben rwo...@hotmail.comwrote:

 Is this a nice explanation about macros : 
 http://bryangilbert.com/code/2013/07/30/anatomy-of-a-clojure-macro/

 or is there a better one for a beginner. 

 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 clo...@googlegroups.comjavascript:
 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 javascript:
 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 javascript:.
 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 clo...@googlegroups.comjavascript:
 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 javascript:
 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 javascript:.
 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: Proposing a new Clojure documentation system (in Clojure)

2014-05-01 Thread Mars0i


On Wednesday, April 30, 2014 1:03:24 PM UTC-5, Gregg Reynolds wrote:

 The one thing that I think would be genuinely useful and developer 
 friendly with respect to Clojure is a means of making type signatures 
 explicit.  Clojure may be dynamically typed, but everything has an intended 
 type, and I would like to see it.  I'm thinking of something along the way 
 Haskell and other languages express type sigs.  The paradigmatic example is 
 factorial (or fibonacci).  So given a factorial function fact I want to 
 be able to write something like (type-sig fact) and get something like Int 
 - Int


I think this is a great idea.  A type-sig functions is a nice idea, but one 
can do this now, by adding to docstrings.  I am going to think about adding 
something like this to the docstrings for my own code.  Sean made an 
interesting point about core.typed, but I'm not sure whether it gets in the 
way of documenting intended signatures.  Jony suggested Prismatic/schema.  
That looks like a useful tool, but it wasn't clear to me, without 
installing it an playing with it for a bit, whether it generates nice 
signatures as documentation that can be called up in the REPL, IDEs, etc.  
(It also seems to be Clojurescript-specific at this point.)

It seems as if a syntax for intended type signatures is obviously not 
entirely simple, for at least two reasons. 

1. Functions have complex intended type signatures:  Functions can have 
multiple parameter sequences, because of optional arguments with , and 
because of complex arguments such as maps.   

2. Many functions with a base intended use are also intended to have more 
general uses.  This is particularly common for functions that are part of 
the Clojure language itself.  (What sort of intended type signatures should 
the function seq have, given that the docstring for empty? says: Please 
use the idiom (seq x) rather than (not (empty? x)) ?)  On the other hand 
I'm sure that most functions defined outside of a general-purpose tool 
collection (such as Clojure itself) are intended *only* for very specific 
uses.  

Perhaps a syntax of such intended-type-signatures would be worth 
discussion in another thread.  The typed FP tradition embodied in Haskell 
may have already worked out solutions to the first set of complications, 
but not the second issue.

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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: Datascript and React.js for a Clojure web app

2014-05-01 Thread blake
Looks good. Is the admin login supposed to work?


On Wed, Apr 30, 2014 at 6:32 AM, Gijs S. gijsstuur...@gmail.com wrote:

 Hi all,

 I've released a Clojure web application. It includes a front-end using
 DataScript and React.js in ClojureScript.

 More details here:
 http://thegeez.net/2014/04/30/datascript_clojure_web_app.html

 The code is on github: https://github.com/thegeez/clj-crud

 Demo on heroku: http://clj-crud.herokuapp.com/

 Best regards,
 Gijs

 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from 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] Re: [ANN] om-start lein template for nrepl compliant editors/IDEs

2014-05-01 Thread Laurent PETIT
Hi Mimmo,

I sent 2 small pull requests for updating things in om-start README:

- link of the om basic tutorial has changed in swanodette's wiki
- starting leiningen projects in CCW uses the familiar (to Eclipse users)
Run as  Clojure Application instead of the specific Lein  Launch
headless REPL

Cheers,

-- 
Laurent



2014-05-01 15:56 GMT+02:00 Ivan L ivan.laza...@gmail.com:

 Thanks mimmo!  Looking forward to trying this out.

 --
 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/d/optout.


Re: Proposing a new Clojure documentation system (in Clojure)

2014-05-01 Thread Ambrose Bonnaire-Sergeant
(Author of core.typed) Typed Clojure's function syntax generally won't get
in your way if you're trying to jot down a type signature. It can handle
multiple arities, polymorphism, keyword arguments, rest arguments and more.

The whole point of Typed Clojure is to model how programmers use Clojure.
eg. the semantics for
firsthttps://github.com/clojure/core.typed/blob/master/src/main/clojure/clojure/core/typed/base_env.clj#L1261.
We're actively expanding what can be expressed with types.

Thanks,
Ambrose

On Fri, May 2, 2014 at 12:05 AM, Mars0i marsh...@logical.net wrote:



 On Wednesday, April 30, 2014 1:03:24 PM UTC-5, Gregg Reynolds wrote:

 The one thing that I think would be genuinely useful and developer
 friendly with respect to Clojure is a means of making type signatures
 explicit.  Clojure may be dynamically typed, but everything has an intended
 type, and I would like to see it.  I'm thinking of something along the way
 Haskell and other languages express type sigs.  The paradigmatic example is
 factorial (or fibonacci).  So given a factorial function fact I want to
 be able to write something like (type-sig fact) and get something like Int
 - Int


 I think this is a great idea.  A type-sig functions is a nice idea, but
 one can do this now, by adding to docstrings.  I am going to think about
 adding something like this to the docstrings for my own code.  Sean made an
 interesting point about core.typed, but I'm not sure whether it gets in the
 way of documenting intended signatures.  Jony suggested Prismatic/schema.
 That looks like a useful tool, but it wasn't clear to me, without
 installing it an playing with it for a bit, whether it generates nice
 signatures as documentation that can be called up in the REPL, IDEs, etc.
 (It also seems to be Clojurescript-specific at this point.)

 It seems as if a syntax for intended type signatures is obviously not
 entirely simple, for at least two reasons.

 1. Functions have complex intended type signatures:  Functions can have
 multiple parameter sequences, because of optional arguments with , and
 because of complex arguments such as maps.

 2. Many functions with a base intended use are also intended to have more
 general uses.  This is particularly common for functions that are part of
 the Clojure language itself.  (What sort of intended type signatures should
 the function seq have, given that the docstring for empty? says: Please
 use the idiom (seq x) rather than (not (empty? x)) ?)  On the other hand
 I'm sure that most functions defined outside of a general-purpose tool
 collection (such as Clojure itself) are intended *only* for very specific
 uses.

 Perhaps a syntax of such intended-type-signatures would be worth
 discussion in another thread.  The typed FP tradition embodied in Haskell
 may have already worked out solutions to the first set of complications,
 but not the second issue.

  --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from 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] Re: [ANN] om-start lein template for nrepl compliant editors/IDEs

2014-05-01 Thread Mimmo Cosenza
Hi Laurent,
thanks so much. Today I had the time to take a look at my repos on github after 
a while :((

just merged your PRs together with other couple which were pending there….

My best

mimmo

On 01 May 2014, at 18:49, Laurent PETIT laurent.pe...@gmail.com wrote:

 Hi Mimmo, 
 
 I sent 2 small pull requests for updating things in om-start README:
 
 - link of the om basic tutorial has changed in swanodette's wiki
 - starting leiningen projects in CCW uses the familiar (to Eclipse users) 
 Run as  Clojure Application instead of the specific Lein  Launch 
 headless REPL
 
 Cheers,
 
 -- 
 Laurent
 
 
 
 2014-05-01 15:56 GMT+02:00 Ivan L ivan.laza...@gmail.com:
 Thanks mimmo!  Looking forward to trying this out.
 
 --
 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/d/optout.



signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: Proposing a new Clojure documentation system (in Clojure)

2014-05-01 Thread guns
On Thu  1 May 2014 at 09:05:29AM -0700, Mars0i wrote:

 1. Functions have complex intended type signatures: Functions can have
 multiple parameter sequences, because of optional arguments with ,
 and because of complex arguments such as maps.

Schema expresses these scenarios quite well, as does core.typed AFAIK.

 2. Many functions with a base intended use are also intended to have
 more general uses. This is particularly common for functions that are
 part of the Clojure language itself.

Constraining inputs to those that satisfy protocols and interfaces goes
a long way, and provides considerable flexibility, while still providing
meaningful constraints.

Have a function that uses `slurp` or `spit` on a parameter? Declare that
the parameter satisfies clojure.java.io/Coercions.

Have a function that expects any kind of map-like object that supports
`get`? Declare that it must satisfy clojure.lang.Associative.

And so on. Together with Java type hierarchies, I have found it quite
easy to declare polymorphic function signatures using Schema.

guns


pgpbQdkXAUa7G.pgp
Description: PGP signature


Re: Clojure Office Hours

2014-05-01 Thread Jakub Holy
I too can only recommend to make use of this great opportunity. Many thanks 
to Ulises who helped to find a way with a problem I have always struggled 
with, namely the shape of the data you are working with is not visible and 
it is thus easy to make errors which are hard to troubleshoot. I have 
recorded the ideas with an example in the blog post Clojure: How To Prevent 
“Expected Map, Got Vector” And Similar 
Errorshttp://theholyjava.wordpress.com/2014/04/30/clojure-how-to-prevent-expected-map-got-vector-and-similar-errors/
.

I am looking forward to talking to Ulises again in the future to review the 
effect of applying the ideas in practice.

On Thursday, April 10, 2014 2:53:26 PM UTC+2, Leif wrote:

 Hi, everybody.  Inspired by the SF Bay Area clojure group, ClojureBridge, 
 and the great talks on community education from Clojure/West on youtube, 
 I've decided to try holding my own personal Clojure office hours (online).

 I am personally of the opinion that face-to-face interaction is superior, 
 so you may want to get your local user group to follow the Bay Area's 
 lead.  But if you don't agree, or you don't live near such a user group, 
 then read on.

 Borrowed from the Bay Area's posting:

 This is a [2-person] meetup for anyone who is working on a Clojure 
 project and wants to talk over their code or approach with an experienced 
 Clojure developer.

 Projects of all levels and complexity are welcome, anyone just getting 
 started in Clojure is encouraged to come in and talk through their first 
 Euler or 4Clojure problems.
 Disclaimer: This community being what it is, there may be projects of too 
 high a complexity for me, but I'll give it a shot.

 I'm going to try a test run of this for two weeks, and then I'll have to 
 see what state I'm in (mentally and geographically).  If interested, you 
 can book at this link:

 https://leifpoorman.youcanbook.me/

 Note: all the times are evening, US Eastern.  That pretty much limits it 
 to the western hemisphere and any east asian friends that want to do some 
 morning hacking.  Eastern hemisphere friends, make noise on this thread, 
 and maybe some brave European/Asian clojure developer will try something 
 similar.

 Cheers,
 Leif


-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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: Proposing a new Clojure documentation system (in Clojure)

2014-05-01 Thread John Gabriele
On Wednesday, April 30, 2014 5:48:17 PM UTC-4, Sean Corfield wrote:


 For a project that has its auxiliary documentation on a Github wiki, you 
 don't even need to git clone  edit the repo: you can simply click Edit 
 Page. That's about a low a barrier to entry as there can be and we still 
 don't see enough contribution to documentation. 

  
Via the wonders of github, this even works if the docs in question are just 
simple .md files. Once you're logged into github, forking, editing,  
submitting a PR is only a couple of clicks as well. Contributors can edit 
the doc/*.md file(s) right there without ever touching `git` or leaving the 
browser.

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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.


Cleaner solution, anyone?

2014-05-01 Thread Divyansh Prakash
Hey!
I wrote a blog post discussing Thomson's Paradox, and simulated it in 
Clojure-
http://pizzaforthought.blogspot.in/2014/05/and-infinity-beyond.html

The *state* function defined towards the end is not very functional. 
Could someone guide me towards a cleaner approach?

Also, I can't find good code-highlighting tools for blogger/clojure. Any 
suggestions?

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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: Cleaner solution, anyone?

2014-05-01 Thread Guru Devanla
Neat, so in your last solution are you trying to get rid of recur and solve
1 - (1/2)^x = time ?


On Thu, May 1, 2014 at 12:06 PM, Divyansh Prakash 
divyanshprakas...@gmail.com wrote:

 Hey!
 I wrote a blog post discussing Thomson's Paradox, and simulated it in
 Clojure-
 http://pizzaforthought.blogspot.in/2014/05/and-infinity-beyond.html

 The *state* function defined towards the end is not very functional.
 Could someone guide me towards a cleaner approach?

 Also, I can't find good code-highlighting tools for blogger/clojure. Any
 suggestions?

 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from 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: Cleaner solution, anyone?

2014-05-01 Thread James Reeves
I'd suggest generating an intermediate seq with the summed time:

(defn state [time]
  (- (thomsons-lamp)
   (reduce (fn [[_ t] [onoff dur]] [onoff (+ t dur)]))
   (drop-while (fn [[_ t]] ( t time)))
   first second))

- James



On 1 May 2014 20:06, Divyansh Prakash divyanshprakas...@gmail.com wrote:

 Hey!
 I wrote a blog post discussing Thomson's Paradox, and simulated it in
 Clojure-
 http://pizzaforthought.blogspot.in/2014/05/and-infinity-beyond.html

 The *state* function defined towards the end is not very functional.
 Could someone guide me towards a cleaner approach?

 Also, I can't find good code-highlighting tools for blogger/clojure. Any
 suggestions?

 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from 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: Cleaner solution, anyone?

2014-05-01 Thread Guru Devanla
Reduce is not lazy, correct? Will it ever return for drop-while to execute.
The problem here is not knowing how many iterations make up the sum, isnt?


On Thu, May 1, 2014 at 1:13 PM, James Reeves ja...@booleanknot.com wrote:

 I'd suggest generating an intermediate seq with the summed time:

 (defn state [time]
   (- (thomsons-lamp)
(reduce (fn [[_ t] [onoff dur]] [onoff (+ t dur)]))
(drop-while (fn [[_ t]] ( t time)))
first second))

 - James



 On 1 May 2014 20:06, Divyansh Prakash divyanshprakas...@gmail.com wrote:

 Hey!
 I wrote a blog post discussing Thomson's Paradox, and simulated it in
 Clojure-
 http://pizzaforthought.blogspot.in/2014/05/and-infinity-beyond.html

 The *state* function defined towards the end is not very functional.
 Could someone guide me towards a cleaner approach?

 Also, I can't find good code-highlighting tools for blogger/clojure. Any
 suggestions?

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


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


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


Re: Cleaner solution, anyone?

2014-05-01 Thread James Reeves
Yes, sorry, I didn't mean reduce, I meant reductions.

- James


On 1 May 2014 21:35, Guru Devanla grd...@gmail.com wrote:

 Reduce is not lazy, correct? Will it ever return for drop-while to
 execute. The problem here is not knowing how many iterations make up the
 sum, isnt?


 On Thu, May 1, 2014 at 1:13 PM, James Reeves ja...@booleanknot.comwrote:

 I'd suggest generating an intermediate seq with the summed time:

 (defn state [time]
   (- (thomsons-lamp)
(reduce (fn [[_ t] [onoff dur]] [onoff (+ t dur)]))
(drop-while (fn [[_ t]] ( t time)))
first second))

 - James



 On 1 May 2014 20:06, Divyansh Prakash divyanshprakas...@gmail.comwrote:

 Hey!
 I wrote a blog post discussing Thomson's Paradox, and simulated it in
 Clojure-
 http://pizzaforthought.blogspot.in/2014/05/and-infinity-beyond.html

 The *state* function defined towards the end is not very functional.
 Could someone guide me towards a cleaner approach?

 Also, I can't find good code-highlighting tools for blogger/clojure. Any
 suggestions?

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


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


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


-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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: Cleaner solution, anyone?

2014-05-01 Thread Stephen Gilardi
 I wrote a blog post discussing Thomson's Paradox, and simulated it in Clojure-
 http://pizzaforthought.blogspot.in/2014/05/and-infinity-beyond.html
 
 The state function defined towards the end is not very functional. 
 Could someone guide me towards a cleaner approach?

Here's an option:

(defn state [t]
  (reduce (fn [[v0 t0] [v1 dt]]
(cond (zero? dt) (reduced unknown)
  ( t0 t) (reduced v0)
  :else [v1 (+ t0 dt)]))
  [true 0]
  (thomsons-lamp)))
 
cljs.user= (state 0)
true
cljs.user= (state 0.99)
true
cljs.user= (state 1)
false
cljs.user= (state 1.49)
false
cljs.user= (state 1.5)
true
cljs.user= (state 1.)
true
cljs.user= (state 1.9)
false
cljs.user= (state 2)
unknown
cljs.user= 

--Steve

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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: Datascript and React.js for a Clojure web app

2014-05-01 Thread Kirstie Cook
very coolI've cloned it to play around with it. It runs locally just 
fine, but when deploying to heroku I get a 404 not found after trying to 
login or sign up. is there anything else that needs to be in order to 
deploy it to heroku?

On Wednesday, April 30, 2014 8:32:24 AM UTC-5, Gijs S. wrote:

 Hi all,

 I've released a Clojure web application. It includes a front-end using 
 DataScript and React.js in ClojureScript.

 More details here: 
 http://thegeez.net/2014/04/30/datascript_clojure_web_app.html

 The code is on github: https://github.com/thegeez/clj-crud

 Demo on heroku: http://clj-crud.herokuapp.com/

 Best regards,
 Gijs 


-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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 code to java

2014-05-01 Thread Atamert Ölçgen
Hi Julio,

There is a difference between `converting Clojure code to Java code` and
`compiling Clojure into .class files`. Can you clarify which one are you
trying to accomplish?

Also if you can provide some more context we might be able to make better
suggestions.


On Thu, May 1, 2014 at 4:56 AM, Andy Fingerhut andy.finger...@gmail.comwrote:

 Leiningen can convert Clojure source code to Java .class files (compiled
 Java byte code, not Java source code), with the help of the Clojure
 compiler.

 I don't know of a way Leiningen can convert that to Java source code,
 unless there is some feature of Leiningen I haven't learned about yet, or
 some plugin that does that.

 There are several programs out there, some open source, some commercial,
 that can decompile Java byte code files into Java source code, of varying
 quality.  I have used a trial version of the AndroChef Java Decompiler 1.0
 a few times in the past, and found its results better than one other open
 source Java decompiler I tried (I don't remember what that was called right
 now).

 http://www.neshkov.com/ac_decompiler.html

 Andy


 On Wed, Apr 30, 2014 at 7:05 PM, Julio Berina juliober...@gmail.comwrote:

 I've been programming a bit in Clojure, and in my opinion it's like
 making Java programs without typing long Java because of it running on the
 JVM.  However, I wanna be able to convert my Clojure code to Java code.  I
 know Leiningen can do that, but I am really clueless at this point, and I
 don't know what other programs out there will convert Clojure to Java
 .class file.  Does anyone have any tips?

 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from 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.




-- 
Kind Regards,
Atamert Ölçgen

-+-
--+
+++

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.
For more options, visit https://groups.google.com/d/optout.


Re: Managing State Changes, using Component

2014-05-01 Thread Atamert Ölçgen
I am not an expert on Component. But AFAIK it is not for managing mutable
state but for assembling and configuring components, that might or might
not be mutable themselves, in an immutable fashion.

However from what I can understand, your component-a has an atom, like:

(-component-a (atom something))

Which should be OK. I mean it shouldn't matter from which path you are
accessing this atom.

Can you share the constructor/definition of the components?

Also, have you tried confirming that only one :a is instantiated?




On Wed, Apr 30, 2014 at 9:13 PM, Timothy Washington twash...@gmail.comwrote:

 Hi all,

 I'm having a weird state problem with 
 Componenthttps://github.com/stuartsierra/component.
 Let's say I have a system component, like in fig.1. Starting / stopping and
 loading state is fine.
 However, let's say I have 2 other components (:updater , :reader) that use
 component :a. This is the problem that occurs.

1. When *:updater*, modifies an atom in *:a*, that change appears in
path [*:core :a*], not path [*:updater :a*] or [*:a*].
2. Because of the abouve, when *:reader* goes to it's local path [
*:reader :a*] to read that change, it doesn't see those modifications.
3. Using this scheme, *:a* is duplicated 4 times, in the system map.
However, the modifications only appear in path [*:core :a*]. Thus
:reader is unable to access it (it's local [*:a*] is unchanged).


 (def system-components [:a :updater :reader])

 (defrecord Core [env] component/Lifecycle
   (start [this] ...)
   (stop [this] ...))

 (defn component-core [env]

   (component/system-map
:a (component/using
   (ca/component-a env)
   {})
:updater (component/using
  (cs/component-updater env)
  {:a :a})
:reader(component/using
  (cs/component-reader env)
  {:a :a})
:core (component/using
 (map-Foobar {:env env})
 {:a :a

  :updater :updater

  :reader :reader })))

 *fig.1 *


 I was hoping to use Component to manage all internal application state.
 But maybe it's not designed for this use case (state changes between
 components). I imagine that immutability is preventing all those duplicates
 from seeing the modifications. However, in this case I do need an update to
 :a in one component, to be accessed by another component.

 Any suggestions on patterns here? I'm also looking at
 component/update-systemhttps://github.com/stuartsierra/component/blob/master/src/com/stuartsierra/component.clj#L116.
 But again, I don't have access to the core *system* var, from within my
 components.


 Any insights appreciated

 Tim Washington
 Interruptsoftware.com http://interruptsoftware.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.
 For more options, visit https://groups.google.com/d/optout.




-- 
Kind Regards,
Atamert Ölçgen

-+-
--+
+++

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.
For more options, visit https://groups.google.com/d/optout.


twitter-api and streaming calls

2014-05-01 Thread Simon Katz
Hi,

I'm playing with twitter-api (https://github.com/adamwynne/twitter-api) and 
streaming calls. I've also tried twitter-streaming-client 
(https://github.com/mccraigmccraig/twitter-streaming-client).

With the examples each of those provide, I'm getting *EOFException: JSON 
error (end-of-file)* errors.

I can of course post more details, but I'm hoping someone else might have 
come across this and be able to give me a pointer as to what's happening.

I wonder if perhaps something's changed in the Twitter API recently to 
break things.

__
Simon

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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: twitter-api and streaming calls

2014-05-01 Thread Gary Trakhman
I fixed this in my implementation about a week ago, have a look:

Basically, JSON might be split across multiple chunks.  You can assemble it
back with a PipedReader/Writer and then use cheshire's lazy seq.

https://github.com/gtrak/dashboard/blob/master/src/gtrak/dashboard/twitter.clj#L94


On Thu, May 1, 2014 at 6:59 PM, Simon Katz nomisk...@gmail.com wrote:

 Hi,

 I'm playing with twitter-api (https://github.com/adamwynne/twitter-api)
 and streaming calls. I've also tried twitter-streaming-client (
 https://github.com/mccraigmccraig/twitter-streaming-client).

 With the examples each of those provide, I'm getting *EOFException: JSON
 error (end-of-file)* errors.

 I can of course post more details, but I'm hoping someone else might have
 come across this and be able to give me a pointer as to what's happening.

 I wonder if perhaps something's changed in the Twitter API recently to
 break things.

 __
 Simon

 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from 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 Course on Coursera

2014-05-01 Thread Ivan Schuetz
What happened with this? I would really love to make a Clojure course in 
Coursera... Still none :(


Am Donnerstag, 20. September 2012 14:43:52 UTC+2 schrieb Belun:

 It would be really interesting to see a course about Clojure on 
 coursera.org, where a Scala and functional programming course just 
 started https://class.coursera.org/course/progfun

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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 Course on Coursera

2014-05-01 Thread Colin Fleming
There's this one here: http://mooc.cs.helsinki.fi/clojure, which is run by
the University of Helsinki. I haven't done the course but I heard good
things about it.


On 2 May 2014 11:21, Ivan Schuetz ivanschu...@gmail.com wrote:

 What happened with this? I would really love to make a Clojure course in
 Coursera... Still none :(


 Am Donnerstag, 20. September 2012 14:43:52 UTC+2 schrieb Belun:

 It would be really interesting to see a course about Clojure on
 coursera.org, where a Scala and functional programming course just
 started https://class.coursera.org/course/progfun

  --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from 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.


What's clojure killer app? I don't see any.

2014-05-01 Thread Ustun Ozgur
Paulo, I understand your concerns, you are basically taking a bet in choosing 
Clojure and you want some confirmation that you will not be wasting time/money 
during the process. 

Please watch Jay Fields' talk on this topic. I think he presents the upsides 
and downsides of his journey very well. One remark is that it was very tiring, 
it has been like having a second job (he remarks that he luckily didn't have 
any children during the process IIRC) but it was worth it in the end. 

http://yow.eventer.com/yow-2013-1080/lessons-learned-from-adopting-clojure-by-jey-fields-1397

Ustun

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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: Hosting Providers

2014-05-01 Thread Jarrod Swart
As Richard said most places that run Java, will run your Clojure.  Google 
App Engine and Engine Yard appear to take a WAR file.

lein ring uberwar (in your project dir)

While heroku pushes your code to the server and then does its magic.

git push git of project_name

If you run on your own servers most people do one of two things (from what 
I see):

1. They are familiar with Java app servers and so they use a WAR file
2. They do not have a dependecy on java servers and they create an uberjar, 
fronted by another server.

In the case of #2:

lein ring uberjar (in your project dir)

You then push up the uberjar to your server and put a proxy in front of it 
such as nginx.  This is what I do on digital ocean VPS for more trivial 
apps.

On Wednesday, April 30, 2014 6:27:05 AM UTC-4, Adrian Mowat wrote:

 Hi Richard

 Sorry for the delay.  We'll check that out!

 Having said that, my inclination would be to avoid the compile step if we 
 can and just run on top of the leiningen project (e.e. analogous to ruby 
 apps).

 Putting Engine Yard aside, it raises an interesting question so I am 
 wondering what other people on this list do.  Do you compile your code or 
 just run from the sources as you would in development?

 Many Thanks

 Adrian




 On Thu, Apr 24, 2014 at 2:51 PM, Richard Watson 
 rwa...@engineyard.comjavascript:
  wrote:

 Hi Adrian, 

 You don't have far to look ... Engine Yard now supports Java, and by 
 extension, Clojure.  If you can package up your Clojure app into a WAR file 
 (using Leiningen's 'lein ring uberwar', for example) you can deploy it onto 
 a Jetty or Tomcat server in an Engine Yard Java environment.

 This is a post I published recently on the Engine Yard blog describing 
 the components of a basic Clojure Web app and how to deploy onto Engine 
 Yard.
 https://blog.engineyard.com/2014/clojure-web-app-engine-yard

 I'm Richard, Product Manager for Java at Engine Yard. Please, drop me a 
 line if you're interested in trying your Clojure code on Engine Yard, or 
 just go ahead and try it out at http://ui.engineyard.com . We're 
 offering a $100 credit to try out the Java platform and give us feedback.

 Richard.


 On Friday, April 18, 2014 11:36:05 AM UTC+1, Adrian Mowat wrote:

 Hi Everyone,

 I am currently looking at hosting providers for Clojure for my company. 
  We are using Engine Yard for our Ruby applications and we looking for 
 something comparable in terms of providing an easy path to getting started 
 and easy ongoing maintenance (they allow you to apply OS patches with zero 
 downtime by simply clicking a button for example).  We also need 24/7 
 support for server issues.

 I was wondering if anyone here could share any experiences and/or 
 recommendations?

 Many Thanks

 Adrian

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


clojure.test parameterized tests

2014-05-01 Thread Brian Craft
I have a number of tests that I would like to run against different 
implementations of a protocol. In clojure.test there doesn't appear to be a 
way to parameterize a test over the implementations. Is there a good way to 
do this?

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


Re: twitter-api and streaming calls

2014-05-01 Thread Andrew Fitzgerald
I had the same (very frustrating issue) recently. I ended up just using the 
official twitter API which is written in Java 
https://github.com/twitter/hbc

On Thursday, May 1, 2014 6:59:04 PM UTC-4, Simon Katz wrote:

 Hi,

 I'm playing with twitter-api (https://github.com/adamwynne/twitter-api) 
 and streaming calls. I've also tried twitter-streaming-client (
 https://github.com/mccraigmccraig/twitter-streaming-client).

 With the examples each of those provide, I'm getting *EOFException: JSON 
 error (end-of-file)* errors.

 I can of course post more details, but I'm hoping someone else might have 
 come across this and be able to give me a pointer as to what's happening.

 I wonder if perhaps something's changed in the Twitter API recently to 
 break things.

 __
 Simon


-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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: twitter-api and streaming calls

2014-05-01 Thread Gary Trakhman
Oh, nice, I was concerned about reconnections and backfill issues, if I
have to change anything substantial again I'll reimplement on top of the
java api that provides this out of the box.


On Thu, May 1, 2014 at 9:13 PM, Andrew Fitzgerald 
andrewcfitzger...@gmail.com wrote:

 I had the same (very frustrating issue) recently. I ended up just using
 the official twitter API which is written in Java
 https://github.com/twitter/hbc


 On Thursday, May 1, 2014 6:59:04 PM UTC-4, Simon Katz wrote:

 Hi,

 I'm playing with twitter-api (https://github.com/adamwynne/twitter-api)
 and streaming calls. I've also tried twitter-streaming-client (
 https://github.com/mccraigmccraig/twitter-streaming-client).

 With the examples each of those provide, I'm getting *EOFException: JSON
 error (end-of-file)* errors.

 I can of course post more details, but I'm hoping someone else might have
 come across this and be able to give me a pointer as to what's happening.

 I wonder if perhaps something's changed in the Twitter API recently to
 break things.

 __
 Simon

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


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


Re: how to convert current time to format i need?

2014-05-01 Thread Alex Walker
https://github.com/mbossenbroek/simple-time

(require '[simple-time.core :as t])
(t/format (t/now) dd:MM: HH:mm:ss)
= 01:05:2014 21:16:27


On Tuesday, April 29, 2014 5:03:01 AM UTC-5, sindhu hosamane wrote:

  How to convert  the current date and time to the format i need ? for 
 example i retrieve current time using (l/local-now) which outputs

 #DateTime 2014-04-29T11:16:02.420+02:00

 i want the above output to be converted to format dd:MM: HH:mm:ss

 Should i define my own formatter like below (def custom-formatter 
 (f/formatter dd:MM: HH:mm:ss))

 But then how to convert it ? Any advice or help would be appreciated .!!


 --  Sindhu





-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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.


how can I print the function name as parameter?

2014-05-01 Thread Erlis Vidal
Hi guys,

I want to write a function (show) that will receive a function as
parameter. How can print the original name of that function? I've tried
with meta, resolve, name but none of them give me the result I want.

The goal is that I want to write a function that print the name of the
function that will be executed then the result of that execution. If
there's a better way to achieve this I'll appreciate your suggestions.

Thanks!
Erlis

(defn show [f sol]
  (print (meta f)))


(defn -main []
   (show elementary/nothing-but-the-truth true))

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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: Hosting Providers

2014-05-01 Thread Mike Haney
One thing to keep in mind since he's using Datomic - there is currently no way 
to restrict access to the transactor, so it needs to be run behind a firewall.  
This can be done easily on AWS by creating a VPC where only the peer is exposed 
to the net.

Outside of AWS, you're pretty much on your own.  This can be done on most 
hosting platforms, you just have to figure out the configuration for yourself.  
I'm not sure about Heroku - because of the way they build their dynos, I'm not 
sure how or even if a transactor could be deployed there.

It would probably be a good idea to start collecting info on deploying Datomic 
to different platforms as people try it and find what works (or doesn't).  
Maybe a community wiki or something.

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


Re: Proposing a new Clojure documentation system (in Clojure)

2014-05-01 Thread Sean Corfield
On Apr 30, 2014, at 4:08 PM, Val Waeselynck val.vval...@gmail.com wrote:
   As for what Gregg and Sean objected - that Clojure code is self-sufficient 
 as documenting itself - I have to simply disagree.

That is NOT what I said. Please go back and read my response more carefully.

   Anyway, I think speculating about the necessity of such a documentation 
 system is not the best thing to do - I suggest we give it a try, and then 
 everyone can decide for themselves if it's useful. After all, it's in 
 Clojure, so this should not take too long, right ? ;)

Go ahead and build something and see if people like it. That's probably a 
better approach than trying to discuss it anyway.

Sean Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/

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





signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: What's clojure killer app? I don't see any.

2014-05-01 Thread Paulo Suzart
Really thanks. Great talk.
On 1 May 2014 21:21, Ustun Ozgur ustunoz...@gmail.com wrote:

 Paulo, I understand your concerns, you are basically taking a bet in
 choosing Clojure and you want some confirmation that you will not be
 wasting time/money during the process.

 Please watch Jay Fields' talk on this topic. I think he presents the
 upsides and downsides of his journey very well. One remark is that it was
 very tiring, it has been like having a second job (he remarks that he
 luckily didn't have any children during the process IIRC) but it was worth
 it in the end.


 http://yow.eventer.com/yow-2013-1080/lessons-learned-from-adopting-clojure-by-jey-fields-1397

 Ustun

 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from 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: core.async and Joy of Clojure

2014-05-01 Thread Mars0i
On Monday, April 28, 2014 9:42:06 AM UTC-5, gamma235 wrote:

 I heard that Joy of Clojure would be adding a lot in the 2nd edition, 
 including a section on core.logic; is core.async also on that list? 


I bought the pre-release + final release *Joy of Clojure* 2nd ed. package, 
so I have the v10 prerelease version.  This seems to be the final version 
before the regular release.  I did a search through the v10 pdf, and found 
no instances of core.async, and the string async appeared only in the 
word asynchronous.  By contrast, there are indeed many instances of 
core.logic.

The eBook version is supposed to come out in mid-May, and the print and 
other electronic versions some time after that.  The last email that I got 
says that the book is now in production where it will get a thorough 
polishing before publication.  So it sounds as if the authors and 
publisher are only fixing typos and doing other small changes at this 
point, and that core.async will not be discussed in the book.

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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: Observing the same non-dynamic var in two different states

2014-05-01 Thread Antti Karanta

Thanks, defonce seems to solve the problem. 

As there doesn't seem to be a logical explanation for why the 
vartest.test-data namespace is evaluated twice I filed this as a leiningen 
issue:
https://github.com/technomancy/leiningen/issues/1519


   ::Antti::


-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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.