[ANN] Nubank's aws-api 0.8.692

2024-01-31 Thread Scott Bale
Nubank's aws-api 0.8.692 is now available.

0.8.692 / 2024-01-31
  * upgrade to cognitect http-client 1.0.127
* upgrade to org.eclipse.jetty/jetty-client-9.4.53.v20231009 #249 

  * upgrade to org.clojure/core.async 1.6.681
  * upgrade to org.clojure/data.json 2.5.0

This release updates aws-api's dependency on Jetty to version 9.4.53, the 
latest 9.x release as of this writing.

README: https://github.com/cognitect-labs/aws-api/
API: https://cognitect-labs.github.io/aws-api/
Changelog: https://github.com/cognitect-labs/aws-api/blob/master/CHANGES.md
Upgrade Notes: 
https://github.com/cognitect-labs/aws-api/blob/master/UPGRADE.md
Latest Releases of api, endpoints, and all services: 
https://github.com/cognitect-labs/aws-api/blob/master/latest-releases.edn

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/clojure/c3fc5061-6503-43eb-8720-7831a25bc25an%40googlegroups.com.


[ANN] aws-api 0.8.686 is now available!

2023-07-06 Thread Scott Bale
aws-api 0.8.686 is now available!

0.8.686 / 2023-07-06

* Support list member values in request headers #234 


README: https://github.com/cognitect-labs/aws-api/
API: https://cognitect-labs.github.io/aws-api/
Changelog: https://github.com/cognitect-labs/aws-api/blob/master/CHANGES.md
Upgrade Notes: 
https://github.com/cognitect-labs/aws-api/blob/master/UPGRADE.md
Latest Releases of api, endpoints, and all services: 
https://github.com/cognitect-labs/aws-api/blob/master/latest-releases.edn

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/clojure/de5f9ed3-0e3e-4675-9ede-af129ac2ba90n%40googlegroups.com.


Re: Mexico City Clojureists?

2020-10-22 Thread Scott Klarenbach
Ok great.  If anyone is down for a beer in the sun to chat about tech,
programming etc let me know.

We've also got some contract work for Clojure devs on a pretty regular
basis if anyone is interested.

This is my company:
https://invisiblerobot.io

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/clojure/CACRoD4rcjudvgxMOBp8MeWzNpF8%3DneeYTzMUxBdhYWK7gsvTXw%40mail.gmail.com.


Mexico City Clojureists?

2020-10-20 Thread Scott Klarenbach
Wondering who is living/working in Mexico City?

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/clojure/CACRoD4oktO_g%3DrNU40kc_axVLKF7An_9DWPuHz8jbi6G8F6jqw%40mail.gmail.com.


Re: How to apply multiple values to a function

2018-03-28 Thread Scott Thoman
On Wednesday, March 28, 2018 at 7:52:06 PM UTC-4, Renata Soares wrote:
>
> Good night,
>
> I have this function: 
>
> (defn treat-requests [input key-request collection]
> (let [selecteds (select-keys input key-request)]
> (swap! collection conj selecteds)))
>
> and I want to execute that 3 times with 3 differents arguments
>
> How can I do to apply a list of differents arguments to a function?
>
> Instead of calling 3 times like:
>
> (treat-request x1 y1 z1)
> (treat-request x2 y2 z2)
> (treat-request x3 y3 z3)
>
> I want to call one time. For example... (apply treat-request [x1 y1 z1] 
> [x2 y2 z2] [x3 y3 z3]) 
>
>
> How about something like (map (partial apply treat-request) [[x1 y1 z1] 
[x2 y2 z2] [x3 y3 z3]]) ?

/Scott

-- 
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: If Clojure is to blame for the majority of the startup time, why doesn't ClojureScript proportionally slow down the JavaScript startup time also?

2018-01-31 Thread scott stackelhouse
I was just reading about Docker+CRIU.  

For me, the slow startup isn't much of a bother for normal operations of my 
apps.  They are generally long running services.  But development is where I am 
bothered by it the most.  It can be painful to restart a repl and it's very 
disruptive to my ability to stay focussed.

CRIU seems like it could actually help in this case.  In particular, paired 
with Docker, I can just restart from a known good checkpoint with editor 
loaded, repl up and connected, etc.  That would be very nice.

-- 
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: Code Review -- Testing truthiness twice

2017-10-01 Thread Scott Barrett
Very helpful! Thanks for the swift and response critique. 

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


Code Review -- Testing truthiness twice

2017-10-01 Thread Scott Barrett
Clojure noob, here. I'm very excited to be learning about this language and 
becoming a part of this community :) I'm writing a function that works 
well, but seems just a bit wrong to me, stylistically speaking. I was 
hoping I could get some guidance from you all.

Here's the code:

(defn get-if
  "Gets the value of a map if exactly one key matches a predicate, 
otherwise nil"
  ([m predicate?] (get-if nil m predicate?))
  ([found m predicate?]
   (if-let [e (first m)]
 (let [pred (predicate? (key e))]
   (if (not (and pred found))
 (recur (if pred (val e) found) (rest m) predicate?))
 found

This has gone through a few revisions to get it as concise as possible, but 
here are my questions/remarks:

   1. Is it idiomatic to use if-let to move through a collection the way I 
   have? In my experience with lispy languages, recursion over sequences tend 
   to take the form (if (null item) accumlated-value (recur-over-rest)). 
   This if-let form turns that on its head, which looks a little backwards at 
   first to me, but it saves a level of indentation which is generally 
   preferable in my experience.
   2. The main part of this code that's bugging me is the let form, which 
   is a total hack to keep from testing (predicate? (key e)) twice. Even 
   still, I have to test the truthiness of pred twice; once in the (not 
   (and ...)) form and once again in the if of the recur form. I feel like 
   a clever use of (and ...) or (or ...) would save me here, but I haven't 
   come upon a solution using those forms yet.
   3. In general, when using recursion and multiple arities to get a 
   result, is there an order that is preferred for the extra recursion 
   accumulation values? Here I have [m predicate?] and [found m predicate?] 
   versions of the function, but after looking at it for so long I think it 
   might be more natural to put found as the last argument, as in [m 
   predicate? found], but I'm wondering if there's a standard to follow 
   with things like this.
   4. When passing functions as arguments, as I have here with the 
   predicate? function, is there a standard naming convention? I used a 
   question mark here, but would predicate be preferable, or even simply f?
   5. Is writing this function even necessary? I didn't see a function that 
   serves the same purpose in the standard libraries, but I'm very new and 
   could easily have missed something!
   
I know that's a lot to ask for such a short segment of code. Feel free to 
answer as many/few of these questions as you'd like, as any help would be 
greatly appreciated (though, if you're going to answer one, I think point 
#2 is the most important) :)


Thanks in advance, fellow clojurians!

-- 
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(script) Contractors in Vancouver?

2017-08-25 Thread Scott Klarenbach
Hello all,

I'm wondering how many members of this group are interested in doing 
Clojure(script) based contract work?
We're in Vancouver, BC, and would love to meet with anyone in the area 
looking for gigs and/or fulltime work.

Please email me or phone me if interested.

Apologies if this violates the group etiquette, just figured it would be a 
good place to get the word out.

-- 
Regards,

Scott Klarenbach
Invisible Robot Technologies
invisiblerobot.io

604-537-1856
scott@i <sc...@pointyhat.ca>nvisiblerobot.io

Suite R - 2404 Guelph Street
Vancouver, BC, V5T 3P3

___
To iterate is human; to recur, divine

*The information contained in this message is intended only for the use of 
the individual or entity to which it is addressed. It may contain 
information that is privileged, confidential and protected from 
disclosure. If you have received this communication in error, please notify 
us immediately by replying to this message and deleting it from your 
computer.  *

-- 
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: is s/and different inside an s/fdef?

2017-08-12 Thread scott stackelhouse
Thanks Sean,

I had't realized this was the case.  I was fooled by the fact that conformed 
values often are the same as the unconformed value.  That changed in the fdef 
where the the arg is enclosed in a seq.  My spec setup didn't work as is, but 
the work around (s/cat :arg ::my spec) as the first predicate in the s/and 
worked.

--Scott

-- 
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: is s/and different inside an s/fdef?

2017-08-11 Thread scott stackelhouse
sorry, I edited this a few times and bumbled the words.  That last sentence 
should say:  I can think of different ways to do it, but I don't think any 
of them are better.  However I feel the example used above [...]

On Friday, August 11, 2017 at 1:06:39 PM UTC-7, scott stackelhouse wrote:
>
> I have to say I find this confusing:
>
> "First the :args is a compound spec that describes the function 
> arguments. This spec is invoked with the args in a list, as if they were 
> passed to (apply fn (arg-list)). Because the args are sequential and the 
> args are positional fields, they are almost always described using a regex 
> op, like cat, alt, or *.
>
> The second :args predicate takes as input the conformed result of the 
> first predicate and verifies that start < end. The :ret spec indicates 
> the return is also an integer. Finally, the :fn spec checks that the 
> return value is >= start and < end."
>
> It really didn't click for me that the second (and I presume subsequent?) 
> predicates of the (s/and) don't get the same argument that the first 
> predicate does.  The text does say that, but it runs counter to what a 
> logical AND would mean (commutative property is lost).  It also damages the 
> ability to reuse specs in and out of an (s/fdef).  It seems to behave more 
> like a (comp) or (->) than a boolean operator now.
>
> I can't think of different ways to do it, but I don't think any of them 
> are better.  However I can think the example used above this paragraph in 
> the guide could be changed a little to make the behavior clearer...  I have 
> never checked, but I assume the clojure docs are on github?  If so are pull 
> requests welcomed for updating docs?
>
> --Scott
>
>

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


is s/and different inside an s/fdef?

2017-08-11 Thread scott stackelhouse
I have to say I find this confusing:

"First the :args is a compound spec that describes the function arguments. 
This spec is invoked with the args in a list, as if they were passed to (apply 
fn (arg-list)). Because the args are sequential and the args are positional 
fields, they are almost always described using a regex op, like cat, alt, or
 *.

The second :args predicate takes as input the conformed result of the first 
predicate and verifies that start < end. The :ret spec indicates the return 
is also an integer. Finally, the :fn spec checks that the return value is 
>= start and < end."

It really didn't click for me that the second (and I presume subsequent?) 
predicates of the (s/and) don't get the same argument that the first 
predicate does.  The text does say that, but it runs counter to what a 
logical AND would mean (commutative property is lost).  It also damages the 
ability to reuse specs in and out of an (s/fdef).  It seems to behave more 
like a (comp) or (->) than a boolean operator now.

I can't think of different ways to do it, but I don't think any of them are 
better.  However I can think the example used above this paragraph in the 
guide could be changed a little to make the behavior clearer...  I have 
never checked, but I assume the clojure docs are on github?  If so are pull 
requests welcomed for updating docs?

--Scott

-- 
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] Clojure 1.9.0-alpha16 is now available

2017-04-27 Thread scott stackelhouse
Glad to see this separation.

Also I just wanted to chime in and say that I greatly appreciate the work 
you've done with Spec.  It's been a great help to me.



On Thursday, April 27, 2017 at 8:20:16 AM UTC-7, Alex Miller wrote:
>
> Clojure 1.9.0-alpha16 is now available.
>
> [...snip...]
>

Also see the prior announcement related to these changes:
> https://groups.google.com/d/msg/clojure/10dbF7w2IQo/ec37TzP5AQAJ
>

-- 
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: Application silently shuts down by itself after running for some hours

2017-03-04 Thread Scott Bauer
Out of curiosity, have you tried catching any and all errors as opposed to 
expecting to see an error message logged upon the system dying?

While searching for possible causes, I did come across this similar post 
 
from a few years ago... not sure if it will help, but it may.


On Friday, March 3, 2017 at 10:57:20 AM UTC-5, JokkeB wrote:
>
> I have an application which I run with "lein run". The main looks 
> something like this
>
> (defn -main []
>  (log/info "start")
>  (log/info "channel returned" (async/ ) (websocket-server 9122
>  (log/info "quit"))
>
> start-server returns a channel created with async/reduce which shouldn't 
> ever produce a value. I see the "start" logged, the application runs for a 
> day or two (not sure if the time is always the same) and then it closes 
> without any errors or without logging "channel returned" or "quit". 
>
> If there is an error in my code and the program quits I should see the 
> "quit" message. If there is a memory leak or something I would assume I'd 
> get an error message. Has anyone experienced anything similar?
>
> Could the reason be running it with lein (I haven't tried a jar)? If so, 
> why?
>
>

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


Monads and Middleware

2016-07-01 Thread Scott Klarenbach
I'm looking for some insight into the relationship between Monads and 
Middleware.

It seems to me that middleware (ala Ring, Boot) is really just a subset of 
Monads, where bind and lift are globally agreed upon conventions, rather 
than explicitly defined.  For example, with middleware you need every 
function to accept and return the same signature so as to be composable, 
whereas with monads you explicitly provide the code for binding and lifting 
into and out of the monad world.

My basic questions are:

1.) Is middleware really a monad with a different name?
2.) Is there any compelling reason to use monads in clojure instead of 
middleware?
3.) Are there classes of problems that can be solved with monads that can't 
be solved with middleware?
4.) Is there any benefit (beyond curiosity) to porting/re-implementing 
middleware as monads?

Thanks.

Scott Klarenbach
www.invisiblerobot.io


-- 
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: Joy of Clojure : Backward running lisp ??

2016-06-27 Thread Scott Nielsen


On Wednesday, June 22, 2016 at 8:22:35 PM UTC-6, Ashish Negi wrote:
>
> I am reading joy of clojure. In the "forward to second edition" William E 
> Byrd and Daniel P Firedman says :
>
>
>
> *As with recursion, the art of defining little languages encourages—and 
> rewards—wishful thinking. You might think to yourself, “If only I had a 
> language for expressing the rules for legal passwords for my login system.” 
> A more involved example—a story, really—started several years ago, when we 
> thought to ourselves, “If only we had the right relational language, we 
> could write a Lisp interpreter that runs backward.”[2] 
>  
> What does this mean? *
>
>
> *An interpreter can be thought of as a function that maps an input 
> expression, such as (+ 5 1), onto a value—in this case, 6. We wanted to 
> write an interpreter in the style of a relational database, in which either 
> the expression being interpreted or the value of that expression, or both, 
> can be treated as unknown variables. We can run the interpreter forward 
> using the query (interpret ‘(+ 5 1) x), which associates the query variable 
> x with the value 6. Better yet, we can run the interpreter backward with 
> the query (interpret x 6), which associates x with an infinite stream of 
> expressions that evaluate to 6, including (+ 5 1) and ((lambda (n) (* n 2)) 
> 3). (Brainteaser: determine the behavior of the query (interpret x x).)*
>
> Although the writer gave an example of `*(interpret x 6)*` i could not 
> imagine the use case of `*lisp interpreter running backwards*` ?
> I am not even sure what he meant exactly.
>
> Thinking on it, i could only relate this to *theorem prover*s where you 
> run backwards from the result.
> Can somebody explain this ?
>

One of the authors of the forward (William Byrd) gave a great presentation 
on miniKanren at lambda lounge utah a couple of years ago. Towards the end 
of the presentation we went through the exercise of actually creating a 
simple lisp interpreter that can run backwards. Luckily it was recorded and 
posted online. https://www.youtube.com/watch?v=zHov3fKYqBA

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

2016-05-24 Thread scott stackelhouse
I restructured my data to make this section an optional sub-map, which I 
think is actually better anyway.

On Tuesday, May 24, 2016 at 11:08:27 AM UTC-7, scott stackelhouse wrote:
>
> Ok.  
>
> Thanks all who have worked on this, btw.  It is incredibly timely for me 
> and is already great help for a work project.
>
> --Scott
>
> On Tuesday, May 24, 2016 at 10:57:26 AM UTC-7, Rich Hickey wrote:
>>
>> ‘and' and ‘or’ are not currently supported in :opt 
>>
>>
>> > On May 24, 2016, at 1:45 PM, scott stackelhouse <scott.sta...@gmail.com> 
>> wrote: 
>> > 
>> > I'm having a problem writing a spec for a map with some required 
>> keywords and some optional keywords.  The caveat here is that the optional 
>> keywords are all or none... that is they are optional but if one is present 
>> they must all be present. 
>> > 
>> > What I tried to write was: 
>> > 
>> > (s/keys :req [::a ::b ::c] :opt [(and ::d ::e ::f)])   
>> > 
>> > and that fails an assertion.  It appears that the logicals (and, or) 
>> are not allowed in the optional section? 
>> > 
>> > Am I thinking about this in the wrong way?   
>> > 
>> > --Scott 
>> > 
>> > -- 
>> > 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.


Re: clojure.spec

2016-05-24 Thread scott stackelhouse
Ok.  

Thanks all who have worked on this, btw.  It is incredibly timely for me 
and is already great help for a work project.

--Scott

On Tuesday, May 24, 2016 at 10:57:26 AM UTC-7, Rich Hickey wrote:
>
> ‘and' and ‘or’ are not currently supported in :opt 
>
>
> > On May 24, 2016, at 1:45 PM, scott stackelhouse <scott.sta...@gmail.com 
> > wrote: 
> > 
> > I'm having a problem writing a spec for a map with some required 
> keywords and some optional keywords.  The caveat here is that the optional 
> keywords are all or none... that is they are optional but if one is present 
> they must all be present. 
> > 
> > What I tried to write was: 
> > 
> > (s/keys :req [::a ::b ::c] :opt [(and ::d ::e ::f)])   
> > 
> > and that fails an assertion.  It appears that the logicals (and, or) are 
> not allowed in the optional section? 
> > 
> > Am I thinking about this in the wrong way?   
> > 
> > --Scott 
> > 
> > -- 
> > 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.


Re: clojure.spec

2016-05-24 Thread scott stackelhouse
I'm having a problem writing a spec for a map with some required keywords 
and some optional keywords.  The caveat here is that the optional keywords 
are all or none... that is they are optional but if one is present they 
must all be present.

What I tried to write was:

(s/keys :req [::a ::b ::c] :opt [(and ::d ::e ::f)])  

and that fails an assertion.  It appears that the logicals (and, or) are 
not allowed in the optional section?

Am I thinking about this in the wrong way?  

--Scott

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

2016-05-23 Thread scott stackelhouse
Awesome, thanks!  I had misunderstood where the idea of a sequence was 
created (the sequential context as you put it).

On Monday, May 23, 2016 at 12:28:32 PM UTC-7, Alex Miller wrote:
>
> Yeah, nested regexes are one of the places people are most likely to be 
> tripped up. 
>
> One of those inner lists could be speced as:
>
> (def string-list (s/* string?)) 
>
> ;; or as (s/coll-of string?) - not a strong preference in this particular 
> case but there are tradeoffs
>
> And then the outer list is something like this:
>
> (def outer (s/* (s/spec string-list))
>
> where the s/spec is the key thing - that creates a new "sequential 
> context". Otherwise, the string-list regex ops become part of the outer 
> regex ops.
>
> One difference here will be that the spec above will conform the 
> string-list to a vector (as all sequential things conform to a vector). The 
> coll-of approach would give you control over that though:
>
> (s/conform (s/* (s/coll-of string? ())) ['("a" "b" "c") '("d" "e" "f")])
> => [("a" "b" "c") ("d" "e" "f")]
>
> The benefit of using s/* in string-list is that if you wanted to include 
> string-list inside another regex you could but with coll-of, it would 
> always start a new collection:
>
> (s/conform (s/cat :num integer? :strs string-list) [100 "a" "b"])
> => {:num 100, :strs ["a" "b"]}
>
> So, tradeoffs.
>
> On Monday, May 23, 2016 at 2:08:49 PM UTC-5, scott stackelhouse wrote:
>>
>> Could someone describe what a spec of a seq in a seq would look like? 
>>  i.e. ['("a" "b" "c") '("d" "e" "f")].  I'm not quite "getting it."
>>
>> --Scott
>>
>> On Monday, May 23, 2016 at 7:12:29 AM UTC-7, Rich Hickey wrote:
>>>
>>> Introducing clojure.spec 
>>>
>>> I'm happy to introduce today clojure.spec, a new core library and 
>>> support for data and function specifications in Clojure. 
>>>
>>> Better communication 
>>>
>>> Clojure is a dynamic language, and thus far we have relied on 
>>> documentation or external libraries to explain the use and behavior of 
>>> functions and libraries. But documentation is difficult to produce, is 
>>> frequently not maintained, cannot be automatically checked and varies 
>>> greatly in quality. Specs are expressive and precise. Including spec in 
>>> Clojure creates a lingua franca with which we can state how our programs 
>>> work and how to use them. 
>>>
>>> More leverage and power 
>>>
>>> A key advantage of specifications over documentation is the leverage 
>>> they provide. In particular, specs can be utilized by programs in ways that 
>>> docs cannot. Defining specs takes effort, and spec aims to maximize the 
>>> return you get from making that effort. spec gives you tools for leveraging 
>>> specs in documentation, validation, error reporting, destructuring, 
>>> instrumentation, test-data generation and generative testing. 
>>>
>>> Improved developer experience 
>>>
>>> Error messages from macros are a perennial challenge for new (and 
>>> experienced) users of Clojure. specs can be used to conform data in macros 
>>> instead of using a custom parser. And Clojure's macro expansion will 
>>> automatically use specs, when present, to explain errors to users. This 
>>> should result in a greatly improved experience for users when errors occur. 
>>>
>>> More robust software 
>>>
>>> Clojure has always been about simplifying the development of robust 
>>> software. In all languages, dynamic or not, tests are essential to quality 
>>> - too many critical properties are not captured by common type systems. 
>>> spec has been designed from the ground up to directly support generative 
>>> testing via test.check https://github.com/clojure/test.check. When you 
>>> use spec you get generative tests for free. 
>>>
>>> Taken together, I think the features of spec demonstrate the ongoing 
>>> advantages of a powerful dynamic language like Clojure for building robust 
>>> software - superior expressivity, instrumentation-enhanced REPL-driven 
>>> development, sophisticated testing and more flexible systems. I encourage 
>>> you to read the spec rationale and overview  
>>> http://clojure.org/about/spec. Look for spec's inclusion in the next 

Re: clojure.spec

2016-05-23 Thread scott stackelhouse
Could someone describe what a spec of a seq in a seq would look like?  i.e. 
['("a" "b" "c") '("d" "e" "f")].  I'm not quite "getting it."

--Scott

On Monday, May 23, 2016 at 7:12:29 AM UTC-7, Rich Hickey wrote:
>
> Introducing clojure.spec 
>
> I'm happy to introduce today clojure.spec, a new core library and support 
> for data and function specifications in Clojure. 
>
> Better communication 
>
> Clojure is a dynamic language, and thus far we have relied on 
> documentation or external libraries to explain the use and behavior of 
> functions and libraries. But documentation is difficult to produce, is 
> frequently not maintained, cannot be automatically checked and varies 
> greatly in quality. Specs are expressive and precise. Including spec in 
> Clojure creates a lingua franca with which we can state how our programs 
> work and how to use them. 
>
> More leverage and power 
>
> A key advantage of specifications over documentation is the leverage they 
> provide. In particular, specs can be utilized by programs in ways that docs 
> cannot. Defining specs takes effort, and spec aims to maximize the return 
> you get from making that effort. spec gives you tools for leveraging specs 
> in documentation, validation, error reporting, destructuring, 
> instrumentation, test-data generation and generative testing. 
>
> Improved developer experience 
>
> Error messages from macros are a perennial challenge for new (and 
> experienced) users of Clojure. specs can be used to conform data in macros 
> instead of using a custom parser. And Clojure's macro expansion will 
> automatically use specs, when present, to explain errors to users. This 
> should result in a greatly improved experience for users when errors occur. 
>
> More robust software 
>
> Clojure has always been about simplifying the development of robust 
> software. In all languages, dynamic or not, tests are essential to quality 
> - too many critical properties are not captured by common type systems. 
> spec has been designed from the ground up to directly support generative 
> testing via test.check https://github.com/clojure/test.check. When you 
> use spec you get generative tests for free. 
>
> Taken together, I think the features of spec demonstrate the ongoing 
> advantages of a powerful dynamic language like Clojure for building robust 
> software - superior expressivity, instrumentation-enhanced REPL-driven 
> development, sophisticated testing and more flexible systems. I encourage 
> you to read the spec rationale and overview  http://clojure.org/about/spec. 
> Look for spec's inclusion in the next alpha release of Clojure, within a 
> day or so. 
>
> Note that spec is still alpha, and some details are likely to change. 
> Feedback welcome. 
>
> I hope you find spec useful and powerful! 
>
> Rich 
>
>

-- 
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: Lein :provided profile and uberjar not working

2015-06-03 Thread Scott Klarenbach
The issue was that I hadn't removed the dependencies from the toplevel 
vector.  Thanks to Jeremy Heiler for pointing that out.

On Wednesday, June 3, 2015 at 12:35:30 PM UTC-7, Scott Klarenbach wrote:

 I'm unable to post a new topic to the leinigen group so I thought I'd try 
 my luck here.

 I'd like to exclude certain dependencies from my uberjar, by using the 
 :provided profile, but the jars are always included.

 I've added the following to my project.clj, but the edu.stanford.nlp jars 
 end up in the uberjar no matter what.  I've also tried with a simple 
 project just to exclude a few jars and that doesn't seem to work either. 
  Am I missing something simple?  Or is there a better way to exclude large 
 dependencies from uberjar if the deployment environment will already have 
 them on the classpath?  Thanks.

 :profiles {:uberjar {:aot :all}
  :provided {:dependencies
 [[edu.stanford.nlp/stanford-corenlp 3.4.1]
  [edu.stanford.nlp/stanford-corenlp 3.4.1
   :classifier models]]}
  :dev {:resource-paths [test-data]}}



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


Lein :provided profile and uberjar not working

2015-06-03 Thread Scott Klarenbach


I'm unable to post a new topic to the leinigen group so I thought I'd try 
my luck here.

I'd like to exclude certain dependencies from my uberjar, by using the 
:provided profile, but the jars are always included.

I've added the following to my project.clj, but the edu.stanford.nlp jars 
end up in the uberjar no matter what.  I've also tried with a simple 
project just to exclude a few jars and that doesn't seem to work either. 
 Am I missing something simple?  Or is there a better way to exclude large 
dependencies from uberjar if the deployment environment will already have 
them on the classpath?  Thanks.

:profiles {:uberjar {:aot :all}
 :provided {:dependencies
[[edu.stanford.nlp/stanford-corenlp 3.4.1]
 [edu.stanford.nlp/stanford-corenlp 3.4.1
  :classifier models]]}
 :dev {:resource-paths [test-data]}}

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


Silence WARNING: Long already refers to: class java.lang.Long in namespace: ... in aot compile compatible way

2015-04-27 Thread Scott Nielsen
I have a simplified scenario here: https://github.com/scizo/unmap-failure

The problem is I am using ns-unmap to prevent a WARNING from being printed 
when shadowing java.lang.Long in a namespace.
When this code is aot compiled, the namespace var referenced by 'Long is 
being created before the ns-unmap is being executed causing the ns-unmap to 
unmap the desired 'Long and not java.lang.Long. Is there a way to silence 
the warning in a way that will work with both aot and non-aot compiled code?

Thanks for any help in advance,

Scott

-- 
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: Testing macros that throw errors at compile time?

2015-01-24 Thread Scott Rabin
Thanks Ben  Michael, that works!

On Thursday, January 22, 2015 at 5:08:31 PM UTC-8, Michael Blume wrote:

 macroexpand-1 is a good start, I'd also recommend using the (is (thrown? 
 ...)) special form, so

 (is (thrown? IllegalArgumentException (macroexpend-1 '(my-macro 
 (ill-formed-arguments ...)

 On Thu Jan 22 2015 at 5:05:36 PM Ben Wolfson wol...@gmail.com 
 javascript: wrote:

 (try (macroexpand-1 '(my-macro (ill-formed-arguments ...)))
   false ;; shouldn't get here
   (catch Exception _ true)) ;; whole expression should be true

 As long as you know that the *right* exception is being thrown.

 On Thu, Jan 22, 2015 at 4:41 PM, Scott Rabin scott...@gmail.com 
 javascript: wrote:

 We have a few macros in my employer's codebase that throw compile-time 
 errors when you've given them invalid configurations, and have generally 
 simply tested the result of these macros and not necessarily the direct 
 expansion of said macros. What we would like to do is *test* that the 
 macro blows up; but unfortunately, since this happens before tests are run, 
 the result is that the compiler just complains at you instead of telling 
 you that a specific test failed.

 Is there a decent way to test for thrown exceptions from macros other 
 than writing a few cases and saying well, if the tests didn't even run, 
 it's not right!?

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




 -- 
 Ben Wolfson
 Human kind has used its intelligence to vary the flavour of drinks, 
 which may be sweet, aromatic, fermented or spirit-based. ... Family and 
 social life also offer numerous other occasions to consume drinks for 
 pleasure. [Larousse, Drink entry]

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


Testing macros that throw errors at compile time?

2015-01-22 Thread Scott Rabin
We have a few macros in my employer's codebase that throw compile-time 
errors when you've given them invalid configurations, and have generally 
simply tested the result of these macros and not necessarily the direct 
expansion of said macros. What we would like to do is *test* that the macro 
blows up; but unfortunately, since this happens before tests are run, the 
result is that the compiler just complains at you instead of telling you 
that a specific test failed.

Is there a decent way to test for thrown exceptions from macros other than 
writing a few cases and saying well, if the tests didn't even run, it's 
not right!?

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


Re: Transducers are Coming

2014-08-07 Thread Scott Thoman
I doubt I can answer this as clearly as Rich or others but...

I think the answer to this lies in the fact that composing transducers is 
composing reducer-transformers not reducer functions themselves.

When composing reducer-transformers, the result is another transformer. 
 When this new transformer is actually applied to a reducer function that 
reducer function is augmented with the composed transformer's functionality 
from the outside in so to speak.  So if a,b, and c are transducers and we 
can create a new one abc via (comp a b c).  In order to do something useful 
with that we must apply it to a reducer function so we could do (abc 
identity), which, would yield a reducer function that, during a reduce, 
would do a then b then c then identity to each value - outside in.

So, the transducers are composed just like any other functions but when 
they're actually used, their logic seems to work left to right.

It reminds me somewhat of the way monad transformers work in Haskell (my 
not-totally-fluent-knowledge) where each monad transformer augments the 
existing monad with new monad functionality.  The original monad becomes 
the inner monad and the transformer's logic gets wrapped on top of the 
inner monad.

/stt

On Thursday, August 7, 2014 8:24:52 PM UTC-4, puzzler wrote:

 I'm also curious to understand how the underlying implementation of 
 transducers leads function composition to behave in the reverse order of 
 ordinary function composition.


 On Thu, Aug 7, 2014 at 8:07 AM, vve...@gmail.com javascript: wrote:

 Hello, what is the reason for comp to produce two different orderings 
 depending on whether it composes partials or transducers?

 (comp (partial filter even?) (partial map (partial + 1)))
 (comp (filter even?) (map (partial + 1)))

 Wouldn't it be more intuitive for upcoming clojurians to have both 
 cases exhibit the same execution order?


 On Wednesday, August 6, 2014 8:01:24 PM UTC+2, Rich Hickey wrote:

 I pushed today the initial work on transducers. I describe transducers 
 briefly in this blog post: 

 http://blog.cognitect.com/blog/2014/8/6/transducers-are-coming 

 This work builds on the work done for reducers, bringing 
 context-independent mapping, filtering etc to other areas, such as 
 core.async. 

 This is work in progress. We will be cutting alpha releases to help make 
 it easier to start using core's transducers together with core.async's new 
 support for them. 

 I am very excited about this powerful technique and how we all might use 
 it. 

 Please have a look. 

 Feedback welcome, 

 Rich 

  -- 
 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 
 javascript:
 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: Sequential processing of the data

2014-08-02 Thread Scott Nielsen
Hi Alexander,

The partition function is the tool you're looking for to help create the 
windows in your example.

http://grimoire.arrdem.com/1.6.0/clojure.core/partition/

I made a comment on your gist that shows how it would be used in your example.

Scott Nielsen

On Aug 2, 2014, at 12:03 PM, Alexandr M. alexandr.v.mas...@gmail.com wrote:

 Hello everyone,
 
 I have started learning Clojure recently. 
 
 Could you please point me out what is the best way to replicate the next 
 Python script in Clojure:
 https://gist.github.com/alexvmblog/a3e3bfffa732ca3d3738#file-seqprocess-py
 
 Quite frequently I have this kind of tasks when it's needed to process the 
 data in a sequential manner 
 when we have two or more sliding windows within which various statistics are 
 calculated and further decision are taken.
 
 ---
 Alexander
 
 
 -- 
 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: Is Korma still a good current choice for DB backend?

2014-07-25 Thread Scott Nielsen

On Jul 24, 2014, at 7:23 PM, Tony Tam ttasteri...@gmail.com wrote:

 I've been using korma in a side-project for a while and it behaves well.
 There sure are a bunch of PRs on their github that could be merged, not sure 
 what's up with that.
 
 One problem I ran into last week was that I got some conflicts when trying to 
 upgrade the versions of some dependencies.
 
 One benefit of using korma is that it uses a connection/statement pooling 
 library underneath (in this case c3p0), something that I don't think 
 yesql/honeysql do.

Yesql is connection agnostic, so it will work with any connection that 
clojure.java.jdbc can work with, including a connection pool.

Scott Nielsen
 
 
 -- 
 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: Instaparse - thank you!

2014-06-11 Thread Scott Thoman
+1 !

I'm about to use it in a production deployment.  It has been a pleasure to 
use!

-- 
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] Instaparse 1.3.0

2014-03-12 Thread Scott Thoman
Excellent!

I've actually been using instaparse on a small filter expression
compiler that looks headed for production now.  It has worked *very*
well and has been a pleasure to use!

Thanks for a great tool.

/stt

On Wed, Mar 12, 2014 at 8:53 PM, Mark Engelberg
mark.engelb...@gmail.com wrote:
 Instaparse is a lightweight tool for generating parsers from context-free
 grammars.

 https://github.com/engelberg/instaparse

 The 1.3.0 release is compatible with Clojure 1.6 (and backwards-compatible
 with 1.5.1).

 Feature-wise, this release is identical to 1.2.16, so if you're still on
 Clojure 1.5.1, you don't need to upgrade to 1.3.0.

 I'll be giving a talk about Instaparse and its implementation at
 Clojure/West on March 24.  Hope to meet some of you there!

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



-- 
Very well, then, Mr. Knox, sir.
Let's have a little talk about tweetle beetles
- Dr. S.

key: 4096R/0x2ED7F7450603
fingerprint: F720 335B 622A 3A93 F292 43BF 2ED7 F666 6745 0603

-- 
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 pub/sub

2014-03-05 Thread Scott Johnson
not sure when then added this but it looks like 
pubhttp://clojure.github.io/core.async/#clojure.core.async/pub
 and sub http://clojure.github.io/core.async/#clojure.core.async/sub are 
in the async lib now. 

any differences between what they have now and what you need?

looking for some example code, but could not find any so i tried 
this and it seems to work:

(def t-fn
(fn 
[ele]
all))
(def pub-chan (chan))
(def a-pub (pub pub-chan t-fn))
(def sub-one (chan))
(def sub-two (chan))
(defn p-s-test
[]
(sub a-pub all sub-one)
(sub a-pub all sub-two)
(go (while true
(let [v (! sub-one)]
(println sub one read:  v
(go (while true
(let [v (! sub-two)]
(println sub two read:  v
(go (! pub-chan shine)
(! (timeout 2000))
(! pub-chan on)
(! (timeout 2000))
(! pub-chan you crazy)
(! (timeout 2000))
(! pub-chan diamond)))


-Scott

On Thursday, July 11, 2013 2:15:28 AM UTC-7, Thomas Heller wrote:

 Hey,

 the lab stuff looks very interesting, I however couldn't quite figure out 
 how to unsubscribe one channel from the broadcast since I cannot exchange 
 the topic for every subscriber when one subscriber decides to leave. Its 
 also a lot lower level than I'm currently comfortable with since I haven't 
 checked out any of the core.async internals yet.

 However I wrote my own little pubsub utilities which (almost) only use the 
 public API.

 (def my-topic (pubsub/topic 100))
  
 (pubsub/subscribe-go
  [subscription my-topic (sliding-buffer 100)]
  (loop []
(when-let [ev (! subscription)]
  (prn [:sub-got ev])
  (recur
  
 ;; without go
 (let [sub (pubsub/subscribe my-topic (sliding-buffer 100))]
   (prn [:msg (!! sub)])
   (close! sub))


 Complete code at: https://gist.github.com/thheller/5973825

 subscribe-go is a convenience macro which allows to subscribe to multiple 
 topics and is a normal go block, so same rules apply and you may take! from 
 any other channel as well. When the block ends the subscription is 
 automatically removed, otherwise a subscription is removed by closing it.

 Could be optimized but it seems to work fine for me.

 Will follow the lab.clj when I'm ready to get dirty with the internals. ;) 

 Cheers,
 /thomas

 On Wednesday, July 10, 2013 12:27:59 PM UTC+2, Alex Miller wrote:

 There is a broadcast fn in the lab namespace (
 https://github.com/clojure/core.async/blob/master/src/main/clojure/clojure/core/async/lab.clj)
  
 that does this and I believe David Nolen has created a different variant in 
 some of his stuff. The lab one is experimental and would welcome feedback 
 on it.

 Alex

 On Tuesday, July 9, 2013 6:46:21 PM UTC-5, Thomas Heller wrote:

 Hey,

 I'm doing some core.async tests and want to create a basic pub/sub 
 model. Messages are ! on one channel and ! to many others.

 (deftest ^:wip async-test2
  
   (let [subscribers (atom [])
 events (chan 100)]
  
 (go (loop []
   (when-let [ev (! events)]
 (doseq [c @subscribers]
   (alt!
[[c ev]] :sent
:default nil ;; could force unsubscribe c?
))
 (recur
  
 (let [s1 (chan 1)
   s2 (chan 100)
 r1 (atom [])
   r2 (atom [])]
 (swap! subscribers conj s1 s2)
 ;; simulated slow reader
   (go (loop []
 (when-let [ev (! s1)]
   (swap! r1 conj ev)
   (! (timeout 10))
   (recur 
 ;; good reader
   (go (loop []
 (when-let [ev (! s2)]
   (swap! r2 conj ev)
   (recur
 (!! (go (loop [i 0]
  (when ( i 100)
(! events i)
(recur (inc i))
  
   (close! events)
 (Thread/sleep 25)
 (pprint @r1)
   (pprint @r2))
 ))


 In this example the s1 subscriber will loose almost all messages since 
 he cannot keep up (and buffer is too small). I choose to alt!/:default to 
 drop messages, since I don't want any subscriber to block others. How do 
 you guys deal with slow-readers?

 I don't really have a specific problem but I wonder if there are any 
 plans for some built-in pub/sub mechanisms for core.async. Seems like a 
 very common pattern.

 Anyways, core.async is nice!

 Cheers,
 /thomas




-- 
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: Big Excel (xlsx) file parsing (docjure, incanter...)

2013-12-10 Thread scott tudd
orthogonal, perhaps helpful:

I wrote a clojure (wrapper) library that streams data in-and-out of Excel 
quite easily (and other applications, mostly finance, that use DDE).
especially useful if you need to monitor or updates changes to cells.

https://github.com/tuddman/clj-dde

feedback welcome.

On Saturday, September 7, 2013 10:28:57 AM UTC-4, Stanislav Sobolev wrote:

 Allright, but if use SXSSF how can i stream excel file to that? 
 https://github.com/ktsujister/clj-tsv2xls/blob/master/src/tsv2xls/core.clj 
 Like 
 in this example
 can anybody provide me code example of using that streaming please?
 with-open [out-stream (io/output-stream outfile) and further?


 суббота, 7 сентября 2013 г., 12:30:43 UTC+6 пользователь Vijay Kiran 
 написал:

 Hi,

 I don't think docjure supports streaming options yet  - but you can try 
 using Apache POI streaming API - 
 http://poi.apache.org/spreadsheet/index.html - that should help in 
 reading large files.

 HTH,
 @vijaykiran
  

 On Saturday, September 7, 2013 3:22:27 AM UTC+2, Stanislav Sobolev wrote:

 Hello guys. I have excel file with huge columns in there.
 When i used some plugin(docjure, or anything else) it shows 
 me CompilerException java.lang.OutOfMemoryError: Java heap space, compiling
 How can i handle that big file without converting it to csv? 
 Primary problem in xlsx structure, it doesnt have lines or something, 
 unlike csv.



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


Dynamically push / pull / read Data Into and Out of Excel

2013-12-10 Thread scott tudd
built a clojure (wrapper) library:

https://github.com/tuddman/clj-dde

basically it can 'monitor' defined Excel cells for changes... which can 
'trigger' your clojure app to do stuff.
conversely, can add / modify data in Excel cells programmaticaly from 
clojure ;-), as well.

useful for 'real-time' applications. mostly finance or monitoring related. 
or anything else that utilizes Excel.  Or a 'DDE enabled' application.

feedback welcome.

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


Re: Any interest in Compojure/Ring screencasts?

2013-10-31 Thread Scott Thoman


On Thursday, October 31, 2013 7:28:39 PM UTC-4, Amr Malik wrote:

 Yes please, I'd be interested :)

 -A

 On Tuesday, 29 October 2013 18:39:05 UTC-4, James Reeves wrote:

 I'm considering putting together a screencast, or a series of 
 screencasts, based on my Functional Web 
 Architecturehttp://skillsmatter.com/podcast/home/functional-web talk. 
 The base presentation would be improved, and I'd probably wind up going 
 into more detail on certain topics. I'll probably charge a small fee 
 (perhaps $10 or so) to cover costs.

 Would there be any interest in this?

 - James


I'd be interested as well (especially topics that I can apply to exposing 
RESTful services over http).

/stt

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


FileNotFoundException when running lein droid new

2013-03-25 Thread Scott Thoman
All,

I figured I'd give the leiningen droid plugin a shot now that I've got a 
few spare moments to mess around with clojure for an android app.  However, 
when I attempt to bootstrap a new project, I get the following:
-
$ lein --version
Leiningen 2.1.1 on Java 1.7.0_15 OpenJDK 64-Bit Server VM

$ cat .lein/profiles.clj 
{:user {:plugins [[lein-pprint 1.1.1]
  [org.clojure/tools.logging 0.2.6]
  [lein-droid 0.1.0-preview2]]
:android {:sdk-path /opt/android-sdk}}}

$ jar tvf 
.m2/repository/lein-droid/lein-droid/0.1.0-preview2/lein-droid-0.1.0-preview2.jar
 
| grep xml
  2436 Sat Mar 09 21:55:52 EST 2013 
META-INF/maven/lein-droid/lein-droid/pom.xml
   673 Sat Aug 04 00:06:46 EDT 2012 templates/AndroidManifest.xml
   114 Sat Aug 04 00:06:46 EDT 2012 templates/strings.xml

$ lein droid new blah org.something.blah
java.io.FileNotFoundException: templates/AndroidManifest.xml (No such file 
or directory)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.init(FileInputStream.java:138)
at clojure.java.io$fn__8638.invoke(io.clj:233)
at clojure.java.io$fn__8577$G__8542__8584.invoke(io.clj:73)
at clojure.java.io$fn__8650.invoke(io.clj:262)
at clojure.java.io$fn__8577$G__8542__8584.invoke(io.clj:73)
at clojure.java.io$fn__8612.invoke(io.clj:169)
at clojure.java.io$fn__8551$G__8546__8558.invoke(io.clj:73)
at clojure.java.io$reader.doInvoke(io.clj:106)
at clojure.lang.RestFn.invoke(RestFn.java:410)
at leiningen.new.templates$slurp_resource.invoke(templates.clj:29)
at leiningen.droid.new$renderer$fn__921.doInvoke(new.clj:22)
at clojure.lang.RestFn.invoke(RestFn.java:423)
at leiningen.droid.new$new.doInvoke(new.clj:81)
at clojure.lang.RestFn.invoke(RestFn.java:425)
at clojure.lang.AFn.applyToHelper(AFn.java:163)
at clojure.lang.RestFn.applyTo(RestFn.java:132)
at clojure.core$apply.invoke(core.clj:617)
at leiningen.droid$execute_subtask.invoke(droid.clj:85)
at leiningen.droid$droid.doInvoke(droid.clj:74)
...
-

It looks like a simple classpath issue and I'm wondering if something has 
changed with newer versions of lein and its plugin interaction or 
something.  I've also verified that the same behavior is present with the 
two prior droid plugin versions (preview1 and beta2).

I'd like to know if anyone has seen this kind of thing and whether it's 
just something silly on my end?  If it's not on my end, I'd be glad to poke 
around and fix something if something does, indeed, need a little fixing - 
just wanted to see what other knew before I'd dig into that.

Thanks,
/stt

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




Re: FileNotFoundException when running lein droid new

2013-03-25 Thread Scott Thoman
Perfect!  I'll grab master for now.


Thanks!
/stt

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




Re: How to ensure consistency when accessing database?

2013-03-07 Thread Scott Reynolds
Use mongo findandmodify command. Only way I know
On Mar 6, 2013 8:36 AM, bruce li leilmy...@gmail.com wrote:

 Hello,
 I'm working on a piece of code that uses congomongo to access mongodb.
 What I want to implement is to use one collection of the DB as a
 queue(let's say, it's called task).

 Using congomongo, it's easy to fetch a task that is of status :queue :
 (def t (fetch-one :task :where {:status :queue})),
 and also it's simple to update it: (update! :task t (assoc t :status
 :running))

 But how to make a safe and consistent dequeue operation in concurrent
 context? A naive dequeue should look like this:

 (let [t (fetch-one:task :where {:status :queue})]
   (update! :task t (assoc t :status :running))
   t)

 But taking concurrency into consideration, this implementation is
 error-prone, at least from my point of view. Consider this:

 When 2 threads are fetching the task, it's very likely that the task is
 fetched twice using the previous piece of code and they would be executed
 twice.

 Do we have something like transaction? Something that will enforce the
 fetch-one and update! statement are both executed before another
 “fetch-one operation is adopted?

 What I can think of is to use an agent. And my code looks like this:

 (def db-agent (agent nil))
 (defn dequeue []
   (letfn [(do-dequeue [da]
 (let [task (mongo/fetch-one :task :where {:status :queue})]
   (when task
 (mongo/update! :task feed (assoc task :status :running)))
   task))]
 (send db-agent do-dequeue)
 @db-agent)))

 However, I still doubt the correctness of this solution. Right before the
 @db-agent is called, won't another thread call dequeue, which will
 involve another send” and change the value of db-agent?

 I'm wondering if anyone can help. Thanks.



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




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




Heroku Boot Times

2013-01-23 Thread Scott Parker
Anyone else running a production website with Clojure in Heroku and
struggling with boot time problems? After digging through our logs
from the past month, I've noticed it's not uncommon to have a dyno
crashed for awhile because of boot time problems. It seems especially
likely when dynos are cycling once/day - I'm guessing because of
additional delays in picking up latest snapshot dependencies.

Has anyone else run into this problem and has a bright idea? I have
already verified we're using lein compile :all at deploy (by virtue of
being on lein2), running in the production profile, and I am working
on removing those snapshot dependencies. I've checked the app for
obvious bottlenecks like web/DB/IO requests during initialization with
no luck. We don't have a ton of code or dependencies right now, so I'm
a bit skeptical that we can remain on Heroku as we grow. As a last
resort, I suppose we could try a proxy bound to a Unix socket as in
https://github.com/dblock/heroku-forward but I'd rather avoid that if
possible.

If not advice specifically in the context of pleasing Heroku, advice
on troubleshooting slow app init times generally would also be
welcome. I've done some minimal code benchmarking in Clojure
previously, but never specifically towards resolving time-to-init.

Thanks,
-SP

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




Re: Heroku Boot Times

2013-01-23 Thread Scott Parker
Jeroen - thanks for the advice. Yeah, SNAPSHOTS in prod is a poor practice
anyway, this gives me a good incentive to find them and kill them.

Static files on boot... dang. When I was first investigating our slow boot
time I swear I checked Enlive, but another quick glance at the source
indicates it's almost certainly a contributor. Expletive! I will start
capturing some metrics on how much time we're spending loading HTML
templates at init. We're not loading a godawful number of separate HTML
files, so I'd like to avoid a bunch of delays throughout my views if
possible.

Thanks a bunch Jeroen.
-SP


On Wed, Jan 23, 2013 at 11:19 AM, Jeroen van Dijk 
jeroentjevand...@gmail.com wrote:

 Hi Scott,

 We had some issues as well. SNAPSHOTS are likely to be an issue because
 they are re-checked at least once a day. So if your app needs a restart
 this will be re-checked and might slow down boot time. We also had problems
 due to this in combination with failing maven mirrors. It is probably best
 to just not use SNAPSHOT versions in production.

 Another thing that can have impact on boot time is the reading of static
 files on booting. We solved this by using '(def resource (delay
 (expensive-task ))) and @resource to post-pone this execution for after
 booting.

 We also use this feature
 https://devcenter.heroku.com/articles/labs-preboot/ to minimize possible
 downtime between deploys (not sure if this works for restarts as well)

 On top of that, we always have a minimum of two dynos for redundancy if
 one is down.

 HTH,
 Jeroen



 On Wed, Jan 23, 2013 at 5:00 PM, Scott Parker scott.p.par...@gmail.comwrote:

 Anyone else running a production website with Clojure in Heroku and
 struggling with boot time problems? After digging through our logs
 from the past month, I've noticed it's not uncommon to have a dyno
 crashed for awhile because of boot time problems. It seems especially
 likely when dynos are cycling once/day - I'm guessing because of
 additional delays in picking up latest snapshot dependencies.

 Has anyone else run into this problem and has a bright idea? I have
 already verified we're using lein compile :all at deploy (by virtue of
 being on lein2), running in the production profile, and I am working
 on removing those snapshot dependencies. I've checked the app for
 obvious bottlenecks like web/DB/IO requests during initialization with
 no luck. We don't have a ton of code or dependencies right now, so I'm
 a bit skeptical that we can remain on Heroku as we grow. As a last
 resort, I suppose we could try a proxy bound to a Unix socket as in
 https://github.com/dblock/heroku-forward but I'd rather avoid that if
 possible.

 If not advice specifically in the context of pleasing Heroku, advice
 on troubleshooting slow app init times generally would also be
 welcome. I've done some minimal code benchmarking in Clojure
 previously, but never specifically towards resolving time-to-init.

 Thanks,
 -SP

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



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




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




Re: [ANN] Tower, simple i18n library for Clojure

2013-01-05 Thread Scott Thoman
On Saturday, January 5, 2013 3:12:43 PM UTC-5, Peter Taoussanis wrote:

  

 I will update and give the code a try.  Thanks for the fast turnaround!


 No problem.
  

 As far as your first and last questions, they both sort of came from the 
 same scenario I was pondering.  I was thinking about an application made 
 with many small dependencies and maybe several of them all were using tower 
 to handle translations and such.  But they don't about each other and, 
 therefor, expect to work the same regardless of whether or not there are 
 other libraries that also use tower.  Each library might want a different 
 default locale, or different mode (:dev/other), etc.  I was just thinking 
 about what happens in that case since there is but one config state in 
 the tower namespace.  Again, this isn't an issue for me I was just 
 pondering the scenario.


 Hmm, let me think about this a little more. There's a number of options, 
 the simplest of which is probably just to offer a dynamic binding for the 
 config atom. That way each library can bind over the atom and get its own 
 config.

 Regarding the separate dictionary thing, I was still talking about the 
 centralized dictionary where the arbitrary keys allow easy separation of 
 the dictionary parts.  I was heading down the path where multiple sections 
 of the dictionary were created by different libraries merging in different 
 dictionaries from different resources in their own code bases (using 
 something like load-dictionary-from-map-resource!).  If one of those 
 resources changes (in dev mode) then I think we might want to just re-merge 
 that resource's contents into the dictionary, replacing just the parts 
 merged from that resource while leaving the rest of the dictionary 
 unscathed.  I was wondering if a merging version of 
 load-dictionary-from-map-resource might be useful for that situation.


 I'm sort of half-following what you mean here... I think between the 1.2.0 
 update and the dynamically-bindable config, you'll probably have what you 
 need. Could I ask you to create an issue for this on the GitHub page, then 
 I can come back to you when I've got something implemented?


Sure, I'll create an issue.  I was thinking about the dynamic scoping of 
the config (and anything else driven by that as needed) right after I 
clicked submit... 

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

Re: [ANN] Tower, simple i18n library for Clojure

2013-01-04 Thread Scott Thoman


On Friday, January 4, 2013 3:37:49 AM UTC-5, Peter Taoussanis wrote:

 Just pushed 1.2.0 with `merge-config!` and dictionary merging (rather than 
 resetting) on dev-mode changes.


I will update and give the code a try.  Thanks for the fast turnaround!

As far as your first and last questions, they both sort of came from the 
same scenario I was pondering.  I was thinking about an application made 
with many small dependencies and maybe several of them all were using tower 
to handle translations and such.  But they don't about each other and, 
therefor, expect to work the same regardless of whether or not there are 
other libraries that also use tower.  Each library might want a different 
default locale, or different mode (:dev/other), etc.  I was just thinking 
about what happens in that case since there is but one config state in 
the tower namespace.  Again, this isn't an issue for me I was just 
pondering the scenario.

Regarding the separate dictionary thing, I was still talking about the 
centralized dictionary where the arbitrary keys allow easy separation of 
the dictionary parts.  I was heading down the path where multiple sections 
of the dictionary were created by different libraries merging in different 
dictionaries from different resources in their own code bases (using 
something like load-dictionary-from-map-resource!).  If one of those 
resources changes (in dev mode) then I think we might want to just re-merge 
that resource's contents into the dictionary, replacing just the parts 
merged from that resource while leaving the rest of the dictionary 
unscathed.  I was wondering if a merging version of 
load-dictionary-from-map-resource might be useful for that situation.

Off to play with some more code...

/stt

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

Re: [ANN] Tower, simple i18n library for Clojure

2013-01-03 Thread Scott Thoman


On Thursday, June 14, 2012 8:23:43 AM UTC-4, Peter Taoussanis wrote:

 Hi all,

 Just put up an early release of a little i18n library that some of you 
 might find useful.

 It's on Github (https://github.com/ptaoussanis/tower) and Clojars (
 https://clojars.org/tower).

 Features (taken from the readme):
 * Consistent, lightweight wrappers for standard Java localization 
 functions.
 * Rails-like, all-Clojure translation function.
 * Simple, map-based translation dictionary format. No XML or resource 
 files!
 * Seamless markdown support for translators.
 * TODO: export/import to allow use with industry-standard tools for 
 translators.
 * TODO: Ring middleware for rapidly internationalizing web apps.

 As always, any and all feedback very welcome!

 Cheers!

 - Peter Taoussanis (@ptaoussanis)


All,

I've come up with a few questions for anyone who might be using this 
library including, but not limited to, its author :)

I have a prototype on which I'm working where I'm enjoying using tower for 
i18n, in particular, for its easy wiring up to ring and clojuresque nature. 
 Since this project happens to be factored into several smaller libraries, 
I've run into a couple of use cases that seem to be problematic:

1.  It seems useful to have the possibility for multiple 
libraries/namespaces to manage their own i18n complete with unique 
configurations (tower/config).  I'm not in this situation right now but it 
seems like it could come up.

2.  It also seems like a godd idea to be able to have code merge in a chunk 
of translations into the existing translation dictionary without replacing 
the existing contents.

I'm in situation 2 right now.  I have a core library that drives the 
system, deals with core compojure setup, and manages the tower i18n config. 
 This library then loads other namespaces (like plugins) and part of that 
process is to allow those plugins to do some initialization - in this case, 
part of that is merging their own dictionaries into (:dictionary 
@tower/config).  I have this working now by merging in the dictionaries 
with the assumption that the second-level keys are unique to each 
namespace/library so things don't setup on entries from other namespaces. 
 I've also not been using :dev mode since that can replace the dictionary 
with only the primary and I loose all plugins' dictionaries.

My questions are basically:

- Is there a better way that hasn't jumped out at me?
- If it's not there, is the merge idea valid and does it sound useful? 
 (I'd image it would also change :dev mode to allow a collection of 
watched dictionary resources and merge them when they change or something 
like that)

Thanks,
/stt

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

Re: ClojureCLR Build Error

2012-11-12 Thread Scott Thoman
On Wednesday, April 18, 2012 9:59:34 PM UTC-4, dmiller wrote:

 We discovered this was due to building on the beta of .Net 4.5. 
  ClojureCLR has not been updated to 4.5 yet.

 In this case, a new method was introduced in an interface, causing the 
 proxy to have a missing method.

 4.5 support coming 'real soon now'.

 -David


 On Tuesday, April 17, 2012 10:04:14 AM UTC-5, RobertLJ wrote:


 Just wondering has anyone seen this build error from ClojureCLR (The 
 Clojure.Compile Project): 

  

  Error 3 The command C:\Users\Robert\bob-dev\bob-src\clojureCLR- 
 Builds\clojure-clojure-clr-nodlr-vs11\bin\4.0\Debug 
 \Clojure.Compile.exe clojure.core clojure.core.protocols clojure.main 
 clojure.set clojure.zip  clojure.walk clojure.stacktrace 
 clojure.template clojure.test clojure.test.tap clojure.test.junit 
 clojure.pprint clojure.clr.io clojure.repl clojure.clr.shell 
 clojure.string clojure.data clojure.reflect exited with code 1. 
 Clojure.Compile 

  





 It appears that the build (Clojure.Compile.exe clojure.repl) is 
 failing with the error: 

  

 System.TypeLoadException: Method 'ReadAsyncInternal' on type 
 'clojure.repl.proxy$PushbackTextReader$0$_COMP_clojure.repl.clj' from 
 assembly 'clojure.repl.clj, Version=0.0.0.0, Culture=neutral, 
 PublicKeyToken=null' is overriding a method that is not visible from 
 that assembly. 
at System.Reflection.Emit.TypeBuilder.TermCreateClass(RuntimeModule 
 module, Int32 tk, ObjectHandleOnStack type) 
at System.Reflection.Emit.TypeBuilder.CreateTypeNoLock() 
at System.Reflection.Emit.TypeBuilder.CreateType() 
at clojure.lang.GenProxy.Generate(Type superclass, ISeq interfaces, 
 String className) in c:\Users\Robert\bob-dev\bob-src\clojureCLR-Builds 
 \clojure-clojure-clr-nodlr-vs11\Clojure\Clojure\CljCompiler 
 \GenProxy.cs:line 113 
at clojure.lang.GenProxy.GenerateProxyClass(Type superclass, ISeq 
 interfaces, String className) in c:\Users\Robert\bob-dev\bob-src 
 \clojureCLR-Builds\clojure-clojure-clr-nodlr-vs11\Clojure\Clojure 
 \CljCompiler\GenProxy.cs:line 82 
at clojure/core$generate_proxy__14614.invoke(Object , Object ) in 
 core_proxy.clj:line 55 
at clojure/core$get_proxy_class__14625.doInvoke(Object ) in 
 core_proxy.clj:line 272 
at clojure.lang.RestFn.applyTo(ISeq arglist) in c:\Users\Robert\bob- 
 dev\bob-src\clojureCLR-Builds\clojure-clojure-clr-nodlr-vs11\Clojure 
 \Clojure\Lib\RestFn.cs:line 194 
at clojure/core$apply__10331.invoke(Object , Object ) in 
 core.clj:line 601 
at clojure/core$proxy__14675.doInvoke(Object , Object , Object , 
 Object , Object ) in core_proxy.clj:line 346 
at clojure.lang.RestFn.invoke(Object arg1, Object arg2, Object 
 arg3, Object arg4, Object arg5) in c:\Users\Robert\bob-dev\bob-src 
 \clojureCLR-Builds\clojure-clojure-clr-nodlr-vs11\Clojure\Clojure\Lib 
 \RestFn.cs:line 618 
at clojure.lang.Var.invoke(Object arg1, Object arg2, Object arg3, 
 Object arg4, Object arg5) in c:\Users\Robert\bob-dev\bob-src 
 \clojureCLR-Builds\clojure-clojure-clr-nodlr-vs11\Clojure\Clojure\Lib 
 \Var.cs:line 761 
at clojure.lang.AFn.ApplyToHelper(IFn fn, ISeq argList) in c:\Users 
 \Robert\bob-dev\bob-src\clojureCLR-Builds\clojure-clojure-clr-nodlr- 
 vs11\Clojure\Clojure\Lib\AFn.cs:line 208 
at clojure.lang.Var.applyTo(ISeq arglist) in c:\Users\Robert\bob-dev 
 \bob-src\clojureCLR-Builds\clojure-clojure-clr-nodlr-vs11\Clojure 
 \Clojure\Lib\Var.cs:line 874 
at clojure.lang.Compiler.MacroexpandSeq1(ISeq form) in c:\Users 
 \Robert\bob-dev\bob-src\clojureCLR-Builds\clojure-clojure-clr-nodlr- 
 vs11\Clojure\Clojure\CljCompiler\Compiler.cs:line 893 
at clojure.lang.Compiler.AnalyzeSeq(ParserContext pcon, ISeq form, 
 String name) in c:\Users\Robert\bob-dev\bob-src\clojureCLR-Builds 
 \clojure-clojure-clr-nodlr-vs11\Clojure\Clojure\CljCompiler 
 \Compiler.cs:line 1501, compiling: (clojure/repl.clj:149) 

  

 Any Info would be apreciated 

 Robert 


David,

Has there been any progress on this one?  I'm looking to use clojure on 
.Net 4.5 / Windows server 2012 for some prototyping and am also running 
into this issue.

I've got the source forked and project tweaked and loaded in VS2012.  I'm 
willing to fix it if it still needs fixing and, if so, any pointers toward 
the right spot in the code would be welcome.

/stt

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

Re: Alternate set literal syntax?

2012-03-24 Thread Scott Jaderholm
On Sat, Mar 24, 2012 at 1:44 AM, Cedric Greevey cgree...@gmail.com wrote:
 On Sat, Mar 24, 2012 at 1:28 AM, Sean Corfield seancorfi...@gmail.com wrote:
 On Fri, Mar 23, 2012 at 8:44 PM, Cedric Greevey cgree...@gmail.com wrote:
 #{foo bar baz} is somewhat ugly. It occurs to me that one could modify
 the reader to additionally accept

 {{foo bar baz}}

 My concern is that {{1 2 3 4}5} is currently legal - a map with a map
 as a key and 5 as the value. That means that the reader couldn't tell
 if {{ introduced your set notation or the start of a nested map
 without looking arbitrarily far ahead. And that problem gets worse if
 you encounter {{{ or  or... {{{ could introduce a nested map, a
 map of your sets or one of your sets containing a map...

 The other objections are fair enough -- matters of taste. But the
 above is a technical problem with a simple fix: make one pass over the
 source, converting it into a rudimentary AST whose nodes just look

I think the word reader above applies both to the human and computer
kinds. You've only addressed the problem for the computer. A user
would still have to look at the end of the collection to know if it is
a set or map (or use editor).

 As for the aesthetics, what I like about {{...}} is that the
 delimiters are symmetrical, unlike #{...}, and it would allow one to
 reserve use of the # mark to, mostly, closures, so # would stand out
 more as typically indicating a lambda.

Sorry to break it to you, but # is used in many places other than
lambdas, so even if you remove it from #{} you still have foo#, #^foo,
#^{foo bar}, #'foo, #foo, #_foo, #foo{1 2}, #foo[1 2], and others
I've probably forgotten.

One option you have is to use Emacs to replace #{} and #() with
something distinctive looking.

(dolist (mode '(clojure-mode slime-repl-mode))
  (eval-after-load mode `(font-lock-add-keywords
  ',mode
  (mapcar
   (lambda (pair)
 `(,(car pair)
   (0 (progn (compose-region (match-beginning 1)
 (match-end 1)
,(cadr pair))
 nil
   `((\\(#\\){ ∈)
 (\\(#\\)(ƒ)
 ((\\(fn\\)[\[[:space:]] λ)
 ((\\(comp\\)[\[[:space:]] ∘)
 ((\\(range\\)[\[[:space:]] ℝ)
 ((\\(apply \+\\)[\[[:space:]] ∑)
 ((\\(Math/pi\\)[\[[:space:]] π)
 ((\\(-\\)[\[[:space:]] →)
 ((\\(partial\\)[\[[:space:]] þ)
 ((\\(complement\\)[\[[:space:]] ¬)
 ;; not working
 ;; (Math/pi[:space:] π)
 ;; ((\\(apply \+\\)[\[[:space:]] ∑)
 )

Cheers,
Scott

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


Re: Which emacs packages?

2012-03-12 Thread Scott Jaderholm
- Auto-complete  Ac-slime http://www.youtube.com/watch?v=kH0gOE7rj7g and
http://www.youtube.com/watch?v=dio__Qylp-s
- yasnippets
- clojure-refactoring
- align-cljlet http://www.youtube.com/watch?v=m_5Dldykckg
- define-function http://www.youtube.com/watch?v=D2s_d9gvNVI

Scott


On Thu, Mar 8, 2012 at 9:10 AM, AndyK andy.kri...@gmail.com wrote:

 Curious about which emacs packages folks use for increased Clojure
 productivity (beyond the obvious, like slime/swank-clojure)...

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

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

Re: [ANN] analyze 0.1

2012-01-02 Thread Scott Jaderholm
Very cool. If you think of other potential example errors this would be
capable of detecting it might be nice to include them in a TODO list in the
README. This might motivate someone to implement them or develop a nice
emacs UI for displaying these errors.

Scott


On Mon, Jan 2, 2012 at 4:14 AM, Ambrose Bonnaire-Sergeant 
abonnaireserge...@gmail.com wrote:

 Inspired by the ClojureScript compiler, analyze is an interface to the
 Clojure analysis phase.

 Check the README for some cool things you can do.

 https://clojars.org/analyze
 https://github.com/frenchy64/analyze

 I've barely tested the library but it manages to analyze a good part of
 the core Clojure library.
 This is work in progress.

 If you heard Rich Hickey talking about leveraging the analysis phase at
 the Conj, this is a step in that direction.

 Have fun :)
 Ambrose

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

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

Re: Clojure list syntax sugar: f(x) notation

2011-12-27 Thread Scott Jaderholm
Do you support this?

classic: ((foo bar) baz)
your syntax: foo(bar)(baz)

Scott


On Mon, Dec 26, 2011 at 1:09 PM, Louis Yu Lu louisy...@gmail.com wrote:

 Recently, I found freedom of coding playing with Clojure with over 20
 years’ experience on other program languages, Previously, I had
 several trials of learning Lisp, but never got traction.

 However there are two syntax notations always bother me, it feels
 unnatural with my experience on other programming languages and math:

 1)  Prefix operator for math formula. Jeffrey Bester’s math library
 https://github.com/jbester/cljext/blob/master/cljext/math.clj has
 brought in the infix notation and solved the problem;
 2)  The leading item of a list follows the parenthesis when it serves
 as a function name, (f x) instead of f(x). I am fully aware of many
 discussions on alternative syntax for Clojure and Lisp in the past,
 one stream is here
 http://groups.google.com/group/clojure/browse_thread/thread/319a1c77ed718ba/3e4be7484b7cbe38
 My proposition is enhance Clojure to accept both (f x) and f(x), the
 leading item can appear either after ‘(‘ as usual with classic Lisp
 notion:
 (println Hello, world!)
 or with conventional function call notation:
println(Hello, world!)
 The f(x) notation is just a syntax sugar, the only restriction is no
 space between the leading item and '('.  If one or more spaces in
 between, the item will be treated as a separate symbol. Either notion
 or a mix of them can be used in the same program. Here are some
 examples:

 ; classic Lisp syntax notation
 (defn pig-latin [word]
  (let [first-letter (first word)]
(if (.contains aeiou (str first-letter))
  (str word ay)
  (str (subs word 1) first-letter ay
 (println (pig-latin red))
 (println (pig-latin orange))

 ; f(x) syntax notation
 defn(pig-latin [word]
  let( [first-letter first(word)]
if(.contains(aeiou, str(first-letter))
  str(word, ay)
  str(subs(word, 1), first-letter, ay
 println(pig-latin(red))
 println(pig-latin(orange))

 ; classic Lisp syntax notation
 (defn fib [n]
   (if  ( n 2)
   1
  (+  (fib (dec n) )  (fib (- n 2)
 (fib 36)

 ; mix of two notations
 defn(fib [n]
   if(( n 2)
   1
   (+ fib(dec(n))  fib((- n 2)))
   )
 )
 fib(36)

 I have made minor changes (dozen lines) in one file (LispReader.java)
 from Clojure source repository to implement this syntax sugar(code
 posted at https://github.com/louisyulu/clojure-fx). It works with well-
 formed classic Clojure code and the proposed notation.
 Running the test suite from Clojure distribution results two error:
 One in the file compilation.clj line 90:
 (recur y ^Long(rem x y)]
 The problem is ^Long(… becomes function call, the fix is adding a
 space in between
 (recur y ^Long  (rem x y)]

 The second is in the file sequences.clj line 1131:
(is (=(partition-by #{\a \e \i \o \u} abcdefghijklm)
 The problem is (=(… , ‘=’ is associated with following ‘(‘, the
 intention was the previous ‘(‘, the fix is also adding a space in
 between
(is (=  (partition-by #{\a \e \i \o \u} abcdefghijklm)

 These two cases are caused by the not well-formed Clojure code
 (strictly speaking, each item in the list should be separated by a
 space).

 The proposed syntax sugar apparently pleases my eyes and fingers from
 conventional languages. With some experiments, I found the code is
 more readable for me to use f(x) notation for function call, and (op
 x) for operator.

 I like to hear from the community what kind of dark corner the
 proposed syntax sugar may run into.

 Thanks,
 Louis









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

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

Re: on lisp and scheme macros

2011-12-03 Thread Scott Jaderholm
Scheme style macros in Clojure: https://github.com/qbg/syntax-rules

Scott


On Sat, Dec 3, 2011 at 1:20 PM, Razvan Rotaru razvan.rot...@gmail.comwrote:

 Hi everyone,

 I was searching the web these days trying to find out more about these
 two macro systems and understand their differences, and why one is
 preferable over the other (or not). I'd like to share with you some
 ideas, and hopefully get some opinions back as well. Coming from the
 lisp side, and without much knowledge on scheme macros, I'm also
 trying to decide for myself whether scheme macros can have a
 (practical) advantage.

 One good point (found here http://lambdagrok.wikidot.com/forum/t-194636)
 I think explains it pretty well: lisp macros merely transform a list
 into another, while scheme macros use a pattern matching sub-
 language to apply transformations on the input syntax, and produce
 new syntax. I think this puts the finger on the spot.

 It seems to me that with macros, scheme breaks out of the
 homoiconicity of lisp, and opens up a new array of possibilities:
 define new languages with bdifferent/b syntax (while lisp allows
 new languages but with the same syntax). I'm saying this by looking at
 Racket and the direction it has chosen to go (have a look at Typed
 Scheme and Datalog). This looks like the world turned upside down: the
 pattern matching macro system is the essence of the system, and scheme
 is just another language defined with it. The list is not that
 important anymore, since it's not so essential for the macro system.

 Now, I have read some opinions which say that most who choose the
 scheme macros, make it for the pattern matching abilities and not for
 the hygienic part. This seems like a reasonable thing to do, since I
 don't hear lispers complain about unhygienicity. If there are people
 out there who had some practical experience with scheme macros, I hope
 they read this post and share some thoughts.

 I have a feeling that there's an additional gain with scheme macros:
 debugging information given by the system when something goes wrong.
 But it's only a feeling, I know too little of this subject to be sure.
 Macros are hard to debug. The stacktrace displayed by clojure does not
 contain information related to macro code. It's probably hard to do.
 My feeling relates to the fact that in scheme macro processing is not
 arbitrary, but rather strictly defined and under control. So I'm
 thinking that this gives scheme more control over what's going on in a
 macro and also enables scheme to give me more information in a
 stacktrace. I'd love to hear other opinions on this.

 Another point I find peculiar is the small attention that scheme
 macros got during all these years. I wonder why it's like that. It
 could be scheme's low score for practical stuff, but then again I
 don't know of another language that borrows these kind of macros. Does
 anybody know?

 And lastly, a question to Rich Hickey, should he read this post: what
 is the reasoning behind the choice of lisp macros over scheme's?

 Cheers,
 Razvan

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

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

Re: problems of a newbie

2011-11-07 Thread Scott Jaderholm
On Mon, Nov 7, 2011 at 4:27 AM, Dennis Haupt d.haup...@googlemail.comwrote:

 Am 07.11.2011 10:18, schrieb Dennis Haupt:
 
 
 
  In his code I did notice he doesn't use destructing very much.
 
 
  where would that have been useful?

 defn x [{:keys [foo bar]} param]

 instead of

 defn x [param]
 (let [foo (:foo param)...])

 This

(defn advance-movement [game-element]
  (let [stats (:stats game-element)
position-change (:movement stats)
x-change (:x position-change)
y-change (:y position-change)
with-new-movement
(update-in game-element [:stats :position ] #(translated % x-change
y-change))]
with-new-movement))

can be this

(defn advance-movement [{{{:keys [x y]} :movement} :stats}]
  (update-in game-element [:stats :position ] translated x y))

or if you want the docstring to be short

(defn advance-movement [game-element]
  (let [{{{:keys [x y]} :movement} :stats} game-element]
   (update-in game-element [:stats :position ] translated x y)))

Note how you don't need the extra function #().

I've also noticed that you name your last result in a let and then return
it. I think it's more common to just return it and not name the final
thing.

Also sometimes you create a separate let under a let divided maybe only by
side effects, such as in split-up-asteroid. You could use one let and use _
bindings for side effects.

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

Re: problems of a newbie

2011-11-07 Thread Scott Jaderholm
On Mon, Nov 7, 2011 at 8:33 AM, Dennis Haupt d.haup...@googlemail.comwrote:

 Am 07.11.2011 14:02, schrieb Scott Jaderholm:
  On Mon, Nov 7, 2011 at 4:27 AM, Dennis Haupt d.haup...@googlemail.com
  mailto:d.haup...@googlemail.com wrote:
 
  Am 07.11.2011 10:18, schrieb Dennis Haupt:
  
  
  
   In his code I did notice he doesn't use destructing very much.
  
  
   where would that have been useful?
 
  defn x [{:keys [foo bar]} param]
 
  instead of
 
  defn x [param]
  (let [foo (:foo param)...])
 
  This
 
  (defn advance-movement [game-element]
(let [stats (:stats game-element)
  position-change (:movement stats)
  x-change (:x position-change)
  y-change (:y position-change)
  with-new-movement
  (update-in game-element [:stats :position ] #(translated %
  x-change y-change))]
  with-new-movement))
 
  can be this
 
  (defn advance-movement [{{{:keys [x y]} :movement} :stats}]



(update-in game-element [:stats :position ] translated x y))
 
  or if you want the docstring to be short
 
  (defn advance-movement [game-element]
(let [{{{:keys [x y]} :movement} :stats} game-element]
 (update-in game-element [:stats :position ] translated x y)))
 
  Note how you don't need the extra function #().
 
  I've also noticed that you name your last result in a let and then
  return it. I think it's more common to just return it and not name the
  final thing.

 that's because there once was some code which i deleted. i was too lazy
 to remove the part in the let :)

 
  Also sometimes you create a separate let under a let divided maybe only
  by side effects, such as in split-up-asteroid. You could use one let and
  use _ bindings for side effects.

 let [_ (println like this?)]


(let [a (b)
  c (d)
  _ (e)
  _ (f)
  g (h)
  ...] ...)

instead of

(let [a (b)
  c (d)]
  (e)
  (f)
  (let [g (h)
...]) ...)

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

Re: problems of a newbie

2011-11-06 Thread Scott Jaderholm
On Sun, Nov 6, 2011 at 11:33 AM, Milton Silva milton...@gmail.com wrote:

 On Nov 5, 12:16 pm, Dennis Haupt d.haup...@googlemail.com wrote:
  -BEGIN PGP SIGNED MESSAGE-
  Hash: SHA1
 
  hi,
 
  i'm half done with my asteroids clone. i stumbled over a few problems
  and wanted to know how others already solved them :)
 
  i am used to less concrete programming. i ask my tools to do the
  actual analysis and coding for me:
  * where is that used?

 Your editor does have a search fn right?

 A normal search function does not distinguish between matches in comments,
docstrings, strings, variables, and function calls. A where called function
in an IDE does. Slime has slime-who-calls. I don't know how good it is.
There are various other slime-who functions that are just waiting for
volunteers to implement in swank-clojure.


  * rename that

 again, all editors have this.


Again, they don't distinguish between the various contexts in which a
matching identifier can appear (e.g. as a substring of a different
identifier, or identical but in a distinct context). There are two renaming
refactorings in clojure-refactoring. How good they are at renaming only the
right things I do not know.


  * show me all errors

 what do you mean? for example when I compile a file in emacs I
 (normally) get the line where the error is. or do you mean runtime
 errors?


IDEs for Java will show you multiple errors all at once, whereas I think
environments like Slime will stop compiling once they hit an error.


  * add a parameter here

 not sure I understand this one. if you mean (defn [a]..) to (defn [a
 b] ...) how do you do that without manual intervention in any language/
 editor? (just adding more args to something doesn't mean they will be
 properly handled... that is our job)


IDEs have refactorings for things like this. See Eclipse and IntelliJ. You
give a default value and it changes all calls to use that.

  * autocomplete this for me, i am too lazy to even remember the exact
  method name

 emacs has this(possible not out of the box) and I suspect other too.


ac-slime is pretty limited compared to intellisense systems in static
languages, it doesn't know about context such as what methods can be called
on what objects, other than I think it knows about static methods. Granted
I'm not sure what the limits are in a dynamic language (probably whatever
Smalltalk environments do).



  * show me a list of all methods and fields starting with an e that
  fit in here. i know the one i want is in that list.

 emacs also has this(possible not out of the box) and again I suspect
 other too.

 Nope, ac-slime doesn't know what identifiers are field names let alone
where they are appropriate. Ditto with methods.

 
  as elegant as clojure may be as a language, it's dragging me down to
  almost native text editing which i did more than 10 years ago when i
  wrote a game in turbo pascal.
 
  how did you solve these problem and get some tool-support? or don't
  you miss it because of something i am not aware of?

 I know IDE support isn't as good as in java but, after looking at your


There's lots of reasonable goals for Clojure environments. Being as good as
Java, at least in terms of refactorings, probably isn't one, since in terms
of refactoring there are probably very few languages today that are where
Java was 10 years ago. That said I'm a long time user of
clojure-refactoring and try to encourage people to use it every change I
get.


 code, yes, there is something your not aware of and that is why
 clojure is giving you a hard time.


In his code I did notice he doesn't use destructing very much.

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

Re: Is there a reader setting support BigDecimal by default?

2011-10-20 Thread Scott Hickey
Thank for the replies and I appreciate the suggestions, however they some of 
the rationale behind them doesn't match well my experience.

First, BigDecimal is plenty fast the large business systems I've worked on. 
Actually, it has been plenty fast for every large business system I've 
worked on. This includes a group insurance rate engine that generated 
hundreds of thousands of calculations in each web request.

Second, storing values with implied decimal points is a nightmare. In the 
insurance application for example, some of the rate tables have precision to 
three decimal places, others to five. Picking some arbitrary value imposes 
code complexity throughout the whole in app in a very nasty way. Of course, 
what happens when you need to change that value two years from now?

Unless there's a really good performance issue for a given application, I 
would never pick implied decimal representation over BigDecimals.

Finally, for the business applications I've worked with, I haven't had to 
worry about representing all rationals, just base 10 numbers. In my 
experience, using BigDecimal by default for any number with a decimal point 
has worked out very well for balancing the needs of accuracy, speed and code 
complexity.

It appears that the answer to the original question is no, there is no way 
to configure the reader to default numbers with a decimal point to be 
BigDecimal instead of Double.

Scott Hickey

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

Re: Will clojurescript get in-ns and load?

2011-10-20 Thread Scott Jaderholm
There is a load-file function in clojurescript, I'm guessing that doesn't do
what you want?
Scott


On Thu, Oct 20, 2011 at 1:07 PM, Dave Sann daves...@gmail.com wrote:

 Thinking further, the capability would not be of use (to me) if it were not
 consistent/indistinguishable across clojure and clojurescript.

 I have seen in-ns and load used to effectively split a namespace across
 files

 If 'in-ns' and 'load' were implemented for clojurescript, could 'load' be
 managed as a compile time operation to merge the namespaces.

 Perhaps there are better ways of achieving this that I am not aware of.

 Cheers

 D

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


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

Re: Is there a reader setting support BigDecimal by default?

2011-10-18 Thread Scott Hickey
I'm looking to avoid qualifying every number that has a decimal point with 
an M. For the business applications I've built over the last 25 years 
(credit card processing, healthcare claims, loans,etc.), there's never been 
a situation where inexact numbers were appropriate. 

That's why I was hoping for a global default for reading decimal numbers as 
BigDecimal instead of IEEE floats or doubles.

Scott Hickey

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

Is there a reader setting support BigDecimal by default?

2011-10-17 Thread Scott Hickey
In some versions of Scheme or Lisp, there is a flag that you can set so that 
the reader will create exact numbers by default (BigDecimal) instead of 
inexact doubles.

Is there a way to do this in Clojure?

Scott Hickey

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

Re: Is there a reader setting support BigDecimal by default?

2011-10-17 Thread Scott Hickey
I've been using 1.2 but I would be OK with a solution in any version.

Scott Hickey

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

Re: strangeloop presentations

2011-09-30 Thread Scott Jaderholm
In the past they've been posted on infoq.com several months later.
Scott


On Fri, Sep 30, 2011 at 1:24 PM, Felix Filozov ffilo...@gmail.com wrote:

 Do you know if videos will be available?


 On Friday, September 30, 2011, faenvie fanny.aen...@gmx.de wrote:
  hi clojure-users,
 
  i ploughed through this year's strangeloop presentations
  today ...
 
  3 presentations that i can recommend for clojure-users:
 
  - Jim Duey EasyMonads (advanced level)
 
 
 https://github.com/strangeloop/2011-slides/blob/master/Duey-MonadsEasy.pdf
 
  - David Nolen The Mapping Dilemma (advanced level)
 
 
 https://github.com/strangeloop/2011-slides/blob/master/Nolen-MappingDilemma.pdf
 
  - Stuart Sierra Introduction to Clojure (intro level)
 
 
 https://github.com/strangeloop/2011-slides/blob/master/Sierra-ClojureIntro.pdf
 
  well there may be more for you ... take a look !
 
  gruesse
 
  --
  You received this message because you are subscribed to the Google
  Groups Clojure group.
  To post to this group, send email to clojure@googlegroups.com
  Note that posts from new members are moderated - please be patient with
 your first post.
  To unsubscribe from this group, send email to
  clojure+unsubscr...@googlegroups.com
  For more options, visit this group at
  http://groups.google.com/group/clojure?hl=en
 

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


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

Re: How to attach debugger on clojure's repl ?

2011-09-23 Thread Scott Jaderholm
I don't think it looks for tools.jar specifically, it probably just uses the
classes in there so as long as they're on the classpath you should be fine.
I wouldn't worry about it unless you see an error saying it can't find some
classes that googling reveals are in tools.jar.

The README doesn't mention any cake plugins, that's why cake ritz isn't
working. If cake supports lein plugins then maybe you didn't do lein plugin
install ritz 0.1.7.

Perhaps use lein or the maven plugin instead.

Scott

On Fri, Sep 23, 2011 at 8:00 AM, Sam Aaron samaa...@gmail.com wrote:


 On 23 Sep 2011, at 06:14, Glen Stampoultzis wrote:
 
 
  Ritz looks really nice the setup seems complicated.  I haven't had much
 luck setting it up unfortunately.

 Me neither. Here's the steps I took so far:

 * Cloned https://github.com/pallet/ritz to a tmp dir
 * Copied the slime dir inside ritz into my .emacs.d dir
 * Modified my global cake project.clj file to look as follows:

 (defproject global 0.0.0
  :description Don't rename this project, but you can change the version if
 you want.
  :dependencies [[clojure 1.3.0-RC0]]
  :dev-dependencies [[ritz 0.1.8-SNAPSHOT]])

 * Ran `cake deps --global`
 * My .cake dir now looks as follows:

 /Users/sam/.cake
 ├── build
 ├── classes
 ├── lib
 │   ├── clojure-1.3.0-RC0.jar
 │   ├── deps.clj
 │   └── dev
 │   ├── ritz-0.1.8-20110809.143608-3.jar
 │   └── useful-0.4.0.jar
 ├── pom.xml
 ├── project.clj
 ├── run
 └── templates
└── default
├── LICENSE
├── project.clj
├── src
│   └── +project+
│   └── core.clj
└── test

 10 directories, 9 files

 * The ritz README talks about making sure tools.clj is in the classpath.
 However, it appears on OS X there is no tools.jar:

 tools.jar does not exist. Classes usually located here are instead
 included in classes.jar. Scripts that rely on the existence of tools.jar
 need to be rewritten accordingly. (see
 http://developer.apple.com/library/mac/#documentation/Java/Conceptual/Java14Development/02-JavaDevTools/JavaDevTools.html
 )

 * I created a blank project with `cake new foo`
 * cd into foo
 * Ran `cake ritz` to get the error unknown task: ritz.

 I'm unsure where to go from here. How do I teach cake about the ritz task?
 Am I missing any specific steps? Is not having tools.jar available on OS X
 an issue?

 I'd be very happy to write up a Getting Started tutorial on the ritz wiki
 if I can get things working.

 Sam

 ---
 http://sam.aaron.name


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


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

Re: How to attach debugger on clojure's repl ?

2011-09-21 Thread Scott Jaderholm
While that still works, ritz is really where it's at for awesome debugging
clojure in emacs. It allows stepping and stuff with a nice UI.

https://github.com/pallet/ritz

Video (only for overview, follow instructions at url above)
http://www.youtube.com/watch?v=d_L51ID36w4

One of my favorite things with it is using it with OpenJDK w/ source so I
can go down the rabbit hole of stepping into my code, Clojure, and the JVM
itself (just for fun, not had a need for this yet).

Scott


On Wed, Sep 21, 2011 at 6:01 PM, Timothy Washington twash...@gmail.comwrote:

 This guy's put together a good video on how to use debugging to swank /
 slime.

- http://www.youtube.com/watch?v=galfpq969Hg


 Tim Washington
 twash...@gmail.com
 416.843.9060



 On Tue, Sep 20, 2011 at 10:37 AM, cran1988 rmanolis1...@hotmail.comwrote:

 I am trying to figure out how abcl does it

 On Sep 20, 12:41 pm, Herwig Hochleitner hhochleit...@gmail.com
 wrote:
  You can debug clojure code with a normal Java Debugger.
  When using Emacs, you can tryhttp://
 georgejahad.com/clojure/swank-cdt.html
 
  --
  __
  Herwig Hochleitner

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


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


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

ClojureScript: defn alert fails in browser repl

2011-09-20 Thread Scott Jaderholm
(defn alert [ xs] (js/alert (apply str xs)))

works in cljsc compiled code but not in the browser repl. There I get

ClojureScript:cljs.user (defn alert [ xs] (js/alert (apply str xs)))
#function (var_args){
var xs = null;
if (goog.isDef(var_args)) {
  xs = cljs.core.array_seq(Array.prototype.slice.call(arguments, 0),0);
}
return alert__delegate.call(this, xs);
}
ClojureScript:cljs.user (alert 1 2 3)
Error evaluating: (cljs.core.pr-str (alert 1 2 3)) :as
cljs.core.pr_str.call(null,cljs.user.alert.call(null,1,2,3));\n
#RangeError: Maximum call stack size exceeded
nil

Can anyone reproduce/explain?

Thanks,
Scott

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

Re: Example of a real-world ClojureScript web application

2011-08-10 Thread Scott Jaderholm
I haven't read the code yet but I have a few questions:
Do you miss backbone.js? Are you going to use it with cljs?
Have you shared any code between the frontend and backend? As in run the
same functions on both sides. If so, are you duplicating the code in both
.clj and .cljs or doing something else?
How has the debugging/error notification experience been?

Scott


On Tue, Aug 9, 2011 at 8:53 PM, Filip de Waard f...@vix.io wrote:

 I'm working on Vix, which is a document repository and content
 management system written in Clojure with a CouchDB backend. After the
 announcement on July 23 I immediately got excited about ClojureScript
 and the Google Closure toolkit, so I dropped the existing Backbone.js
 and jQuery code and rewrote all client-side functionality in
 ClojureScript. Despite (or maybe because of) the fact that the
 functionality is still very minimal I wanted to share this code as an
 example of ClojureScript in the wild.

 Be warned that:
 - this is not perfect, clean example code written by a ClojureScript
 expert (in several places I've used hacks and shortcuts to make things
 work), but hopefully at least a starting point for others working on
 similar functionality,
 - you should read the installation instructions carefully (e.g. there
 is still a hardcoded path in src/vix/db.clj at the time of this
 writing, which I hope to correct in the near future),
 - I'm actively developing this application, so things will change and
 new features will be added frequently,
 - the application isn't done yet, although it has a working prototype.

 I'm concentrating on adding features that will allow users to manage
 feeds (currently blog is the default feed), add media files like
 images and to manage users. I had trouble getting unit testing to work
 properly for the ClojureScript part of the application, so I
 grudgingly wrote it using a non-TDD approach. Retrofitting unit tests
 into the ClojureScript part is a priority. The user interface is also
 lacking some bells and whistles that I had previously implemented in
 jQuery, but still have to rewrite using Google Closure. Eventually, I
 want to turn Vix into a commercial SaaS offering, with a focus on
 performance (e.g. Amazon CloudFront support), scalability and webshop
 functionality. The application itself, however, will be perpetually
 available as open source software, because I'm committed to sharing my
 code.

 Here is the GitHub page for Vix: https://github.com/fmw/vix

 This is not a launch post for Vix, because we're not ready for
 supporting typical end-users yet, but I hope that the code will be
 useful to other developers in the meantime. I'm also happy to receive
 any feedback (positive as well as negative) and answer questions. You
 can reply to this post, but if you prefer to contact me privately you
 can also find my contact information on Github (https://github.com/
 fmw).

 Sincerely,

 F.M. (Filip) de Waard / fmw

 P.S. I'd like to thank the ClojureScript developers. There are
 surprisingly few glitches considering that the project has only just
 been released. The language is incredibly well designed and a pleasure
 to use. Thanks for making client-side development more enjoyable!

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

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

Re: clojurescript development workflow

2011-07-25 Thread Scott Jaderholm
On Mon, Jul 25, 2011 at 4:02 AM, Sam Aaron samaa...@gmail.com wrote:

 Also, with respect to the lack of ability to interact with the browser
 directly through the REPL or editor like with emacs-swank-slime, is it fair
 to assume that this is just due to the current implementation being
 Rhino-based?


Perhaps ClojureScript repl could be hooked up to swank-js (similar to
mozrepl) to send the code to your browser (a specific page even) for
evaluation.
https://github.com/ivan4th/swank-js

Scott

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

Leiningen on OpenBSD

2011-07-23 Thread Scott Scites
While walking through the Clojure/Heroku/Database tutorial the Leiningen REPL 
fails to display a prompt.  When I control-c out, the final output before 
closing shows a connection being made and the prompt.  If I change out of the 
project directory and lein repl I get the connection and the prompt as I would 
expect.

Is there a solution to this problem?  How might I debug the issue?  Should I 
file a bug with the Leiningen project?

Thank you.

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


Re: Clojure for large programs

2011-07-07 Thread Scott Jaderholm
On Thu, Jul 7, 2011 at 2:45 AM, Feng Shen shen...@gmail.com wrote:
 But lacking debuging and
 refactoring support is a pain.

In case you're not familiar with these (not saying they're full-featured):

https://github.com/pallet/ritz
http://www.youtube.com/watch?v=d_L51ID36w4

https://github.com/tcrayford/clojure-refactoring

Scott

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


Re: ANN: Hafni

2011-06-30 Thread Scott Jaderholm
In arrow.clj:

What is iarr an abbreviation for?

Perhaps a docstring on ||| would help, I'm having trouble understanding it.

Maybe add these examples, I found them helpful

((arr inc) 1)
;; 2

(( (arr inc) (arr dec)) 1)
;; 1

((flow (arr inc)  (arr inc)  (arr inc)) 1)
;; 4

((*** (arr inc)
  (arr dec))
 [1 1])
;; [2 0]

(( (arr inc)
  (arr dec))
 1)
;; [2 0]

((fst (arr inc)) [1 1])
;; [2 1]

Scott



On Mon, Jun 20, 2011 at 7:57 AM, Jonathan Fischer Friberg
odysso...@gmail.com wrote:
 Hi,

 I figured that I would announce a library that I have been working on for a
 while now.

 It's called Hafni, and it's a swing wrapper. Why another swing wrapper?
 I wanted to solve the following problems:

 1. There are a lot of boilerplate code needed.

 2. Changes made to content is not very functional.

 3. Changing content is (sometimes) annoyingly hard.

 To solve these problems, I looked into the very functional world of Haskell
 and found something called Functional reactive programming (FRP)[1][2] which
 has been used to solve problem 2 in gui programming for Haskell. To be able
 to program FRP, the datatype arrow was created (or maybe the other way
 around), and this is what Hafni uses. I wont go into detail here since it is
 not very easy to explain in a short mail, and there are a lot of resources
 out there on the subject (see the links).

 To be honest, when I first started programming on Hafni, I didn't know that
 there existed other swing wrappers for java (I guess I also wanted to try
 this myself, which meant that I didn't really search it out), but since they
 do exist, lets compare Hafni to the two I have seen on this mailing list:
 seesaw [3] and GUIFTW [4].

 1. Hafni is strictly a swing wrapper and does not claim to be anything else.
    Seesaw - aims to provide a ui library, It happens to be built on Swing.
    GUIFTW - It's not tied to any GUI toolkit but instead front-ends for
 each can be written easily.

 2. Hafni has facilities, but is not really interested in exactly how
 components look.
    Seesaw - Doesn't really express an opinion about this, but seems to have
 a lot of facilities for making components look a certain way.
    GUIFTW - Style it in a CSS fashion

 3. When events happen, Hafni uses the Event and arrow datatypes to make
 things happen while both
    seesaw and GUIFTW uses something that looks like
    the standard java event function(s). It should be noted that Hafni
 event/arrows
    behaves exactly like corresponding for seesaw and GUIFTW if no changes is
 made to content.

 The reason of 2 (which, in a way, leads to 3) is that when I wrote swing
 code manually, the parts
 that I were most annoyed with weren't to make things look as I wanted them,
 it was changing them.

 I haven't really looked into it exactly (or tried it), but it looks like
 seesaw and Hafni can be combined
 since seesaw deals directly with java objects (the config! function is
 especially interesting) [5].

 I would like to end this mail with an example of Hafni. This example is the
 same as in the Hafni readme.

 (frame :content (comp-and-events (button :text *)
   :act (flow (output-arr this :text) 
  (arr #(str % *)) 
 (input-arr this :text)))
 :size 200 200 :dont_exit_on_close)

 As it's already explained in the readme, let's look at the most interesting
 part:

 (flow (output-arr this :text)  (arr #(str % *))  (input-arr this
 :text))

 This code snippet says that the current text of the button created with
 (button :text *) should flow to
 the function #(str % *) which adds a * to the text, which should flow to
 the text of that same button.
 The result of this is that when the button is pressed, the text of that
 button is changed as follows:
 *
 **
 ***
 
 etc ...

 And finally, the link to Hafni: https://github.com/odyssomay/Hafni

 ___

 I really hope that someone finds this project interesting, and at best even
 useful. ;)

 Questions, comments, ideas, critique?

 Jonathan

 1. http://en.wikipedia.org/wiki/Functional_reactive_programming
 2. http://www.haskell.org/haskellwiki/Functional_Reactive_Programming
 3. https://github.com/daveray/seesaw
 4. https://github.com/santamon/GUIFTW
 5. http://daveray.github.com/seesaw/seesaw.core-api.html#seesaw.core/config!

 Additional links:
 http://www.haskell.org/haskellwiki/Arrow
 http://en.wikibooks.org/wiki/Haskell/Understanding_arrows
 http://www.haskell.org/arrows/


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

Re: Other way to express (((m2) 2) 1)?

2011-06-29 Thread Scott Jaderholm
(defmacro -f
  like - but f is threaded at pos 0 instead of 1
  ([f] f)
  ([f x] `(~f ~x))
  ([f x  more]
 `(-f (~f ~x) ~@more)))


(-f m 2 2 1)

Scott



On Wed, Jun 29, 2011 at 7:00 PM, Antonio Recio amdx6...@gmail.com wrote:
 Is there other way to express (((m2) 2) 1)?
 (def m [1 2 [21 22 [221 222 223] 23] 3])
 (((m 2) 2) 1)
 ;- 222

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

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


Re: Other way to express (((m2) 2) 1)?

2011-06-29 Thread Scott Jaderholm
Here's another, perhaps very controversial, solution:

(in m.2.2.1)

;; in
(defn flexible-get
  ([map key]
 (or (let [k (read-string key)]
   (and (number? k)
(get map k)))
 (get map (keyword key))
 (get map (name key
  ([map key  more]
 (apply flexible-get (flexible-get map key) more)))

(defn lookup-symbol? [x]
  (and (symbol? x)
   (.contains (name x) .)
   (not (.endsWith (name x) .))
   (not (.startsWith (name x) .

(defmacro in
  allows dot map key access. ex: (in (let [a {:b 1 \c\ 2}] (+ a.b
a.c))) = 3 
  [ forms]
  `(do ~@(postwalk (fn [x]
 (if (lookup-symbol? x)
   (let [[map  keys] (.split (str x) \\.)]
 `(flexible-get ~(read-string map) ~@keys))
   x))
   forms)))


Scott



On Wed, Jun 29, 2011 at 9:41 PM, Scott Jaderholm jaderh...@gmail.com wrote:
 (defmacro -f
  like - but f is threaded at pos 0 instead of 1
  ([f] f)
  ([f x] `(~f ~x))
  ([f x  more]
     `(-f (~f ~x) ~@more)))


 (-f m 2 2 1)

 Scott



 On Wed, Jun 29, 2011 at 7:00 PM, Antonio Recio amdx6...@gmail.com wrote:
 Is there other way to express (((m2) 2) 1)?
 (def m [1 2 [21 22 [221 222 223] 23] 3])
 (((m 2) 2) 1)
 ;- 222

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


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


Re: Aw: Re: Aw: Which Clojure environments support arglist-on-space?

2011-06-06 Thread Scott Jaderholm
You mean in addition to Emacs right? Of course emacs with slime does this.
If you use autodoc then you don't even have to press space, the arglists
will update in the echo area as you move the cursor around source.

See http://www.youtube.com/watch?v=lf_xI3fZdIg

As for showing args of functions in arg position, if you're in an apply form
it will show the args for the function being applied.

Cheers,
Scott


On Mon, Jun 6, 2011 at 1:35 PM, Lee Spector lspec...@hampshire.edu wrote:


 On Jun 6, 2011, at 12:04 PM, Meikel Brandmeyer wrote:
  Am Montag, 6. Juni 2011 17:53:37 UTC+2 schrieb Lee:
  I don't think automatic insertion would be a good thing, BTW.
  There are for example several snippet plugins for Vim in the wild, which
 do exactly that. And things like textmate also advertise such functionality
 (inserting snippets), AFAIK. That said, I'm not sure it's a good idea
 either. There are a tick too many edge-cases for my taste. If at all, it
 would be possible to turn this off.

 Granted, snippet pasting tools may be useful, but I guess my response
 should just have been to clarify that this isn't what I meant by
 artlist-on-space. The beauty of the arglist-on-space functionality that I
 know and love is that it is unobtrusive in its automatic helpfulness.

 Aside from the near miss with VimClojure (and its presence in MCLIDE) does
 this exist in other Clojure environments?

 Thanks,

  -Lee

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


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

Re: Aw: Re: Aw: Which Clojure environments support arglist-on-space?

2011-06-06 Thread Scott Jaderholm
I don't know of a step by step guide that includes autodoc. You need an
older version of slime that includes the contrib autodoc (i.e. not
package.el version which lacks that contrib). I use 10-15-2009.

Scott


On Mon, Jun 6, 2011 at 4:38 PM, Lee Spector lspec...@hampshire.edu wrote:


 On Jun 6, 2011, at 4:24 PM, Scott Jaderholm wrote:

  You mean in addition to Emacs right? Of course emacs with slime does
 this. If you use autodoc then you don't even have to press space, the
 arglists will update in the echo area as you move the cursor around source.
 
  See http://www.youtube.com/watch?v=lf_xI3fZdIg
 
  As for showing args of functions in arg position, if you're in an apply
 form it will show the args for the function being applied.

 Wonderful. I didn't know for sure if this worked in Emacs with Clojure
 because I didn't get this in my own installation but I knew that my
 installation was at least half botched (on multiple occasions... so
 cumulatively it may have been more than half botched :-). Will one of the
 emacs/slime installation recipes that have been posted here reliably get me
 this functionality (including the autodoc part -- I don't know how to get
 that but it looks great)? Is there one you'd point to in particular?

 Thanks so much!

  -Lee

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


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

Re: Aw: Re: Aw: Which Clojure environments support arglist-on-space?

2011-06-06 Thread Scott Jaderholm
if you follow the instructions on swank-clojure readme then yes I think you
get that.
Scott


On Mon, Jun 6, 2011 at 5:08 PM, Lee Spector lspec...@hampshire.edu wrote:


 On Jun 6, 2011, at 4:58 PM, Scott Jaderholm wrote:

  I don't know of a step by step guide that includes autodoc. You need an
 older version of slime that includes the contrib autodoc (i.e. not
 package.el version which lacks that contrib). I use 10-15-2009.

 Thanks for the pointers, although winging an installation process using old
 versions of things is not something that I want to deal with... However, if
 I ignore the autodoc part and go with one (any?) of the emacs/slime
 installation recipes that have been posted here (and if all goes well this
 time) then I should end up with arglist-on-space?

  -Lee

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


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

Re: Clojurebox/emacs setup

2011-06-04 Thread Scott Sutherland
I'm far from an expert, but clojurebox uses slime for the REPL. I believe
that what you are going to want is to use:

lein swank

to start a local swank server, then start emacs and M-x slime-connect

typically, the default connection params (localhost, port 4005) should work
to get you connected to your project.

Please correct me if I'm wrong.

-s

On Fri, Jun 3, 2011 at 8:10 PM, Bhinderwala, Shoeb 
sabhinderw...@wellington.com wrote:

  No I am using Windows.

 I guess the most pressing problem for me is how to synchronize clojurebox
 with an existing leiningen project. I want the clojurebox REPL to behave
 just like the lein REPL in terms of classpath and jars loaded, etc. How do I
 configure the clojrurebox REPL for this?

 Thanks
 Shoeb

  --
  *From:* clojure@googlegroups.com [mailto:clojure@googlegroups.com] *On
 Behalf Of *Vijay Kiran
 *Sent:* Friday, June 03, 2011 4:43 PM
 *To:* clojure@googlegroups.com
 *Subject:* Re: Clojurebox/emacs setup

 Hi Shoeb,

 I'm not sure if you use mac, but here's the setup I've been using
 successfully:

 1. Installed emacs
 2. Installed the emacs-starter-kit  (
 https://github.com/technomancy/emacs-starter-kit)
 3. And then followed the http://technomancy.us/149

 The clojure-jack-in mode does all the necessary actions and even starts the
 repl in another window of Emacs.

 For color modes I use a Mac, so on the Terminal I use the Solarized Dark
 theme, so it is used for Emacs as well.

 Make sure that you either change to the directory in which you have the
 lein project before you call clojure-jack-in.

 ./Vijay

  On Jun 3, 2011, at 9:26 PM, Bhinderwala, Shoeb wrote:

  I am extremely new to Emacs. Been a long time Vim user.

 I have installed Clojurebox and am able to get it running easily. Can
 someone help me with the following:

 1. I have a leningen project that I am working with. I usually do a lein
 repl in the project directory and all the jars in the lib path are
 automatically added to the classpath of the REPL. How can I do the same with
 clojurebox? Everytime I load a clojure file, I get exceptions saying classes
 not found on classpath. Basically, I want the REPL in clojurebox have the
 exact load behaviour of the lein repl.

 2. How do I load a clojure file, compile it and then launch a REPL that has
 the file loaded? So that I can exercise my functions in the REPL?

 3. How do I change color scheme to a dark color scheme? I googled and found
 the website ColorTheme 
 (*http://www.nongnu.org/color-theme/*http://www.nongnu.org/color-theme/)
 but the download link is broken: *
 http://download.savannah.nongnu.org/releases/color-theme/*http://download.savannah.nongnu.org/releases/color-theme/

 In short I am looking for very straightforward clear instructions for
 someone who is brand new to emacs with clojurebox running
 swank-clojure/slime/paredit.


 *-- Shoeb*

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


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

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


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

Re: ClojureCLR startup times...

2011-03-19 Thread Scott Thoman
On Fri, Mar 18, 2011 at 3:57 PM, dmiller dmiller2...@gmail.com wrote:
 No signed assemblies.

 What got you below the reported JIT activity into the real problem?

 On Mar 18, 11:37 am, Scott Thoman scott.tho...@gmail.com wrote:

 I've had a similar issue unrelated to clojure.  In my case we had some
 signed assemblies and the CLR was taking a long time, in certain
 environments, to go out and check for certificate revocations when
 verifying signatures.  IIRC, the initial profiling I did made it look
 like the time was spent JIT-ing though it wasn't.

 I've not played at all with clojure-CLR at this point so I don't know
 if my experience helps or is related to this issue.

 -stt

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


Unfortunately, it was by speculation and experimentation.  The other
part of our team, which is in Tokyo, was having the problem more than
we were here in the US.  They ultimately found that by disabling those
checks, their processes would load acceptably.

I was on the same path that you probably are, that is, finding
tools/approaches to drill down into what the CLR is actually doing
during that mysterious time period.

-stt

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


Re: Monad Lessons

2011-03-09 Thread Scott Jaderholm
I'd be interested. This doesn't really scale though in the way a recording
does. Are you thinking this would give you a chance to practice teaching it
before making a recording?

Maybe post the slides so people can get an idea of what will be covered.

Also, maybe clarify whether this is free (http://xkcd.com/870/).

Scott


On Wed, Mar 9, 2011 at 2:15 PM, jim jim.d...@gmail.com wrote:

 I gave a talk at CodePaLOUsa on monads and got some favorable
 feedback. So I thought I'd offer to do a live training session on
 monads using pretty much the same material, but at a shared REPL
 rather than with slides.

 How it would work is I would start a Skype conference for 5 to 10
 people. We would also all log in to a tmux session where I would show
 the examples and their results.

 So, my question is how many would be interested in such a session?
 This would be a basic introduction to monads. Future session could be
 about more advanced monad topics, if there was a demand for that.

 Jim

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

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

Re: ANN: Clojure Toolbox (Early Beta)

2011-02-24 Thread Scott Jaderholm
On Wed, Feb 23, 2011 at 6:17 PM, James Reeves jree...@weavejester.comwrote:

 I'm sure I've covered only a very small proportion of Clojure
 libraries out there, so if you'd like to suggest a project that's not
 on there, please do so in this thread, or in an email to me. I'll try
 and update the site as quickly as possible.


Some that I like:
slice
scriptjure
clojurejs
cssgen
gaka

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

Re: [ANN] emacs-nexus (Emacs client for Nexus Maven repository servers)

2011-02-14 Thread Scott Jaderholm
On Mon, Feb 14, 2011 at 7:21 PM, Jürgen Hötzel juer...@hoetzel.info wrote:

 Hi,

 Although Emacs is a great environment for writing Clojure code and
 Leiningen/Cake makes Maven builds less painful, you still had to
 switch from your Emacs environment to your web browser to search for
 Maven artifacts.

 emacs-nexus is a minimal (elisp-only) Nexus client to search for
 artifacts and display Leiningen/Maven dependencies:

 https://github.com/juergenhoetzel/emacs-nexus

 Any feedback/contribution  is appreciated.


Cool, maybe search clojars by default also?

Scott

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

Re: Emacs `align' function customization for Clojure

2011-01-05 Thread Scott Jaderholm
On Tue, Jan 4, 2011 at 9:10 PM, Eric Schulte schulte.e...@gmail.com wrote:
 I wonder if anyone else has written any similar Emacs alignment rules
 for Clojure which they would be interested in sharing?

Alignment rules for let and defroutes are at the top of my most wanted list.

(let [n(count content-divs)
  width500
  widthpx  (str width px)
  scrollable-id(or scrollable-id (str scrollable (rand-int 100)))
  scrollable-fname (symbol scrollable-id)]


(defroutes app
  (GET /  _   (main-page))
  (GET /subscribe _   (slices site-header subscribe-button))
  (GET /test  request (slices jquery
  (dom (alert ~(:remote-addr request)))
  (html [:h1 Hi])
  (css [:h1 :color blue]

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

Re: Clojure Conj 2011?

2010-12-28 Thread scott
fwiw - there was a number of lucky folks who I met at Strange Loop in
St. Louis the week before Conj 2010 who were able to go to both. It
seemed like there was quite a bit of overlap in interest of those two
events. I could have probably gone to both if there was at least a few
weeks time between the two.

Scott Hickey (no relation)

On Dec 27, 8:07 pm, Alan Dipert a...@dipert.org wrote:
 Hi,

 On Mon, Dec 27, 2010 at 7:41 PM, Sean Corfield seancorfi...@gmail.com wrote:
  Now that videos are being posted for the 2010 conj, I figured it might
  be worth asking if there has been any discussion about when/where the
  2011 conj might happen?

 Conj 2011 will most likely be in either Raleigh or Durham, North
 Carolina, and probably will happen around the same time of year as the
 last Conj.  We've reviewed all the feedback we've gotten, and are
 looking for a venue.  Our hope is to announce the time and place as
 soon as possible.

 Sorry you couldn't make it to the last one, but looking forward to
 seeing you at the next one!
 Alan





  I had a schedule conflict last year (actually a double conflict) so
  I'd like to get this year's event on my calendar as early as possible
  so I don't miss it again :)
  --
  Sean A Corfield -- (904) 302-SEAN
  Railo Technologies, Inc. --http://getrailo.com/
  An Architect's View --http://corfield.org/

  If you're not annoying somebody, you're not really alive.
  -- Margaret Atwood

  --
  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- Hide quoted text -

 - Show quoted text -

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


ANN: Programothesis screencast series on Clojure, Emacs, etc

2010-11-12 Thread Scott Jaderholm
Hey Clojurians,

I don't think there are any great new movies in the theater this weekend so
if you're looking to kick back and relax and watch the tube a bit you might
checkout the first few episodes of my new screencast series on Clojure,
Emacs, Slime, etc.

http://youtube.com/emailataskcom

The episodes were recorded several months ago but just posted today. I
expect to post a ton more real soon so subscribe if you want to be notified.

Also I just launched a webapp written entirely in Clojure (and slice
http://github.com/scottjad/slice). It's http://emailatask.com and is for
sending tasks (and reminders) to people through email without an account and
for free.

Cheers,
Scott

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

Re: macro debugger

2010-11-09 Thread Scott Jaderholm
It's not specialized like your link, but I think you can use normal
debugging tools on macros:

(defmacro foo [a]
  (swank.core/break)
  `(list ~a))

And CDT for stepping.

Scott


On Tue, Nov 9, 2010 at 8:50 AM, Sunil S Nandihalli 
sunil.nandiha...@gmail.com wrote:

 Hello everybody,
  Today I just googled for macro-debugger and found the following ...
 http://docs.racket-lang.org/macro-debugger/index.html

 I have not completely explored it yet .. however, I was wondering if there
 is something similar for clojure.. is it possible to develop one?

 Thanks,
 Sunil.

 --
 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.comclojure%2bunsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To 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

ANN: slice (a web library for writing and composing snippets of html, css, and js that are written in Clojure)

2010-11-08 Thread Scott Jaderholm
Slice is an experimental not-production-ready web library for writing and
composing snippets of html, css, and js that are written in Clojure.

The motivation is that I wanted the html, css, and js for a slice of a
webpage to be next to each other in the source, not in three separate files,
and that I wanted these slices to be functions that could be composed. The
hope is that this will lead to higher-level widgetish code.

See https://github.com/scottjad/slice for an overview and
https://github.com/scottjad/slice/blob/master/src/slice/example.clj for an
example.

And yes, I realize designers would hate this. Target is solo developers.

Feedback welcome.

Some of you may have seen an old version (https://gist.github.com/518689)
several months ago that used it's own scoping rules and lots of macros. This
is a complete rewrite.

Cheers,
Scott

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

Re: Clojure Box Windows XP

2010-11-05 Thread Scott Jaderholm
This sounds like a problem with emacs server/client that might be unrelated
to Clojure or Slime. Some configurations of emacs will start a server mode
so that you can run emacsclient and have a new frame pop up instantaneously.
If you don't need emacsclient then you might look in the clojure box configs
for a line (server-start) and remove that.

On Fri, Nov 5, 2010 at 4:50 PM, Jferg johngfergu...@gmail.com wrote:

 I have installed twice, restarted my machine to make sure all is
 well.   However, the Emacs Client window shows: Waiting for Emacs
 server to start and yet the SLIME REPL buffer appears to be
 functional and various messages like: Connected Your hacking starts
 now! show up in the status.  Eventually the Emacs Client window
 shows: ERROR Timeout waiting for server.

 What can I look at to debug this?  I tried guessing at ports and
 processes using netstat -ao | grep'ing for process ids... nothing real
 popped up.
  I am using Clojure box 1.2.0 on Windows XP Service Pack 3.


 --
 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.comclojure%2bunsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en

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

Re: Clojure on Javascript

2010-10-30 Thread Scott Jaderholm
On Sat, Oct 30, 2010 at 12:09 AM, David Nolen dnolen.li...@gmail.comwrote:

 More interesting would be something along the lines of CoffeeScript (like
 ClojureScript) that takes a reasonable subset Clojure and compiles into
 efficient JS, allowing Clojure programmers to send Clojure code to clients.


That already exists in Allen Rohner's Scriptjure.
http://github.com/arohner/scriptjure

Scriptjure is very much equivalent to CoffeeScript, though not
Underscore.coffee. Most of my patches to scriptjure originated when I was
porting a CoffeeScript codebase to Scriptjure. The only major features of
CoffeeScript that it doesn't have that I notice are implicit returns and
well indented js output.

Of course Scriptjure is not Clojure on JS. It's just JS with Clojure syntax
and a few nice compiler tricks.

Being able to jump out to real Clojure inside your Clojure-looking JS with a
simple (clj (some real clojure code)) comes in really handy when the backend
is also Clojure and you have some data that both the client and server need.

You can also configure Emacs+mozrepl so that if you eval some scriptjure
code in emacs it gets compiled to js and evaled in your web browser.

Cheers,
Scott

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

Re: ANN: Emacs auto-complete plugin for slime users

2010-10-15 Thread Scott Jaderholm
Works for me in repl. I have too much slime/clojure customization code, not
really sure what does what :)

Maybe this:

(defun slime-clojure-repl-setup ()
  (when (string-equal clojure (slime-connection-name))
(message Setting up repl for clojure)
(when (slime-inferior-process)
  (slime-redirect-inferior-output))

(set-syntax-table clojure-mode-syntax-table)
(clojure-mode-font-lock-setup)

(setq lisp-indent-function 'clojure-indent-function)

(when (and (featurep 'paredit) paredit-mode (= paredit-version 21))
  (define-key slime-repl-mode-map { 'paredit-open-curly)
  (define-key slime-repl-mode-map } 'paredit-close-curly))
(slime-setup '(slime-fancy

(add-hook 'slime-repl-mode-hook 'slime-clojure-repl-setup)

Scott


On Sat, Oct 16, 2010 at 12:27 AM, Jarl Haggerty fictivela...@gmail.comwrote:

 Should autocomplete work in the swank repl?  It works perfectly in a
 clj buffer but nothing happens in the repl.

 On Aug 19, 7:46 am, Phil Hagelberg p...@hagelb.org wrote:
  On Thu, Aug 19, 2010 at 6:21 AM, Steve Purcell st...@sanityinc.com
 wrote:
   I guess Phil's very busy, but if he can apply this patch, then the
 regular swank-clojure 1.3.0-SNAPSHOT on clojars should end up containing the
 fix.
 
  Just applied this patch and pushed to github and clojars. Thanks!
 
  -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.comclojure%2bunsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en


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

Re: ANN: funkyweb 0.1.0 - The clojure webframework with route inference

2010-10-06 Thread Scott Jaderholm
Very nice. I really love the docs. Covers how to use almost everything with
plenty of example code and short descriptions.

I like variadic args, type hints.

Doesn't cover how to test a handler (from code) and see response.

Maybe move query-string request docs up to where query-string params
introduced.

I like integer and vector returns.

I'd like cookies-set to take :expires :never so user doesn't have to write a
far future date out in that special format.

Wondering about lack of compojure style request destructuring in route. Does
(request-get) return the request that you then destructure in a let in your
action?

Cheers,
Scott


On Wed, Oct 6, 2010 at 3:30 AM, Patrik Hedman patrik.hed...@gmail.comwrote:

 I'm pleased to announce the 0.1.0 release of funkyweb, my ring based
 clojure webframework.

 It provides the following main abstractions:

 Controller: Controllers work somewhat like namespaces in that they define
 the base of the route so any actions defined under a controller will have
 routes generated that starts with the controller name.

 Action: Actions looks like functions in that they take a name an argument
 list and a body and they generates routes and url helper functions based on
 their name and arguments.

 More information can be found in the readme included with the source code
 at http://github.com/pmh/funkyweb

 I would love to hear what you think about it.


 - Patrik

 --
 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.comclojure%2bunsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en

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

Re: lispy ways of handling dev mode

2010-10-02 Thread Scott Jaderholm
On Sat, Oct 2, 2010 at 6:36 PM, Michael Ossareh ossa...@gmail.com wrote:

 What is the recommended manner in which to let your application know its on
 a dev machine?


I use an environment variable that determines which config (dev, production,
test) gets loaded.

APPNAME_CONFIG=development lein swank

I don't know if it has issues in war deployments or such, I haven't done
them. If someone knows of problems with this approach I'd be curious to hear
them.

Scott

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

Re: Find file from namespace symbol

2010-09-29 Thread Scott Jaderholm
swank.commands.basic (find-ns-definition 'clojure.set)
((clojure.set (:location (:zip
/home/scott/project/lib/clojure-1.2.0-master-20100813.160144-94.jar
clojure/set.clj) (:line 1) nil)))

Scott


On Wed, Sep 29, 2010 at 6:34 PM, Jeff Valk jv-li...@tx.rr.com wrote:

 On Wed, 29 Sep 2010 at 15:18, David Jagoe wrote:

  Anyone know of a utility that returns a absolute filename given a
  namespace symbol?

 If you're using Emacs/SLIME, you could use swank-clojure's classpath
 browsing information. The var available-classes in namespace
 swank.util.class-browse holds clojure namespaces and java classes on the
 classpath as a list of maps.

 For example to see where the clojure.set namespace comes from:

 user (clojure.pprint/pprint
   (filter #(= (:name %) clojure.set)
   swank.util.class-browse/available-classes))

 ({:loc /home/jeff/.clojure/clojure-1.3.0-alpha1.jar,
  :file clojure/set__init.class,
  :name clojure.set})

 The same applies to java classes:

 user (clojure.pprint/pprint
   (filter #(= (:name %) java.net.Socket)
   swank.util.class-browse/available-classes))

 ({:loc /usr/lib/jvm/java-6-openjdk/jre/lib/rt.jar,
  :file java/net/Socket.class,
  :name java.net.Socket})

 The map keys are as follows:
  :name  Java class or Clojure namespace name
  :loc   Classpath entry (directory or jar) on which the class is located
  :file  Path of the class file, relative to :loc

 Also see: (doc swank.util.class-browse)

 Hope this helps!

 - Jeff

 --
 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.comclojure%2bunsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en


-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To 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

Looking for more affordable sleeping options for clojure-conj

2010-09-28 Thread Scott Jaderholm
Hey guys,

I'm looking for one of the following more affordable sleeping options at
clojure-conj (Thu, Fri, and Sat nights):

1) Someone willing to gift or rent space for an air mattress in their room.

2) Someone with a king w/ sofa bed room willing to rent out the sofa bed.

3) Someone interested in splitting one of the rooms with two double beds.

4) Someone who lives close by willing to let me {sofa, air mattress}

Thanks,
Scott

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

Re: ANN: Clojure Cookbook

2010-09-27 Thread Scott Jaderholm
Daniel,

If you install lein-search (http://clojars.org/lein-search or
http://github.com/Licenser/lein-search) you can do searches like that.

lein search mail

If you put it in ~/.lein/plugins it will work for all your lein projects and
you can even use it to add what you find to your project.clj and to go
through all your dependencies and prompt whether your want to update.


Scott


On Mon, Sep 27, 2010 at 10:01 AM, Daniel Pittman dan...@rimspace.netwrote:

 Tim Daly d...@axiom-developer.org writes:

  There is a movement afoot in the common lisp community to implement
  quicklisp which is similar to the perl cpan site or debian. It would be
  useful if there was a quicklisp (or asdf) for Clojure. Thus you could
  apt-get a library for clojure.

 FWIW, having just started out playing with Clojure with a view to building
 a
 Google App Engine web service — and from a Perl and Debian background:

 The single biggest thing that I have missed has been 'lein search' or so,
 which would allow me to search an index of the modules it can access and
 tell
 me what is available for meeting my current need.

 The second biggest is the lack of a CPAN-alike central service on the web
 that
 would allow me to do the same, plus review the documentation for candidate
 libraries.

 So, um, that would be nice. :)

Daniel
 --
 ✣ Daniel Pittman✉ dan...@rimspace.net☎ +61 401 155
 707
   ♽ made with 100 percent post-consumer electrons

 --
 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.comclojure%2bunsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en


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

Re: clojure.contrib.trace not working on 1.2?

2010-09-08 Thread Scott Jaderholm
On Wed, Sep 8, 2010 at 7:30 AM, Mark Nutter manutte...@gmail.com wrote:
 I seem to recall that 1.2 is using chunked lazy sequences for
 performance reasons, and fib is a lazy sequence. I wonder if you'd
 start seeing intermediate steps using (fib 20) instead of (fib 3)?

This fib doesn't look lazy to me so I don't think that's it.

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


clojure.contrib.trace not working on 1.2?

2010-09-07 Thread Scott Jaderholm
Why does c.c.trace give different output on 1.2 than it did on 1.1?

From 
http://learnclojure.blogspot.com/2010/02/slime-2009-10-31-user-defn-fib-n-if-n-2.html

On 1.1

user (dotrace (fib) (fib 3))

TRACE t1880: (fib 3)
TRACE t1881: |(fib 2)
TRACE t1882: ||(fib 1)
TRACE t1882: ||= 1
TRACE t1883: ||(fib 0)
TRACE t1883: ||= 0
TRACE t1881: |= 1
TRACE t1884: |(fib 1)
TRACE t1884: |= 1
TRACE t1880: = 2
2
user

On 1.2

user dotrace (fib) (fib 3))

TRACE t11624: (fib 3)
TRACE t11624: = 2

Thanks,
Scott

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


Elisp for highlighting java method names in slime inspector

2010-08-17 Thread Scott Jaderholm
It's always bothered me that when inspecting a class in Slime the
method names are highlighted in the same color as public static int
etc. I think it makes it hard to see what methods are available.

I wrote this elisp that highlights the method names in a different color:

(add-hook 'slime-inspector-mode-hook
  (lambda ()
    (font-lock-add-keywords nil '((\\(\\w+\\)( 1
   font-lock-function-name-face)

Unfortunately it causes the other highlighting to stop working. If you
know why or have a better regex feel free to respond.

Scott

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


Eclipse and Compojure

2010-08-09 Thread scott
I was going to try out a compojure tutorial in Eclipse. It appears
that only .clj files and not the .class files are included in the
compojure jar file.

I'm seeing the following error:
java.io.FileNotFoundException: Could not locate compojure/
core__init.class or compojure/core.clj on classpath:core.clj/web-
app-adder/src/adder line 1  Clojure Compilation Problem

I assume the problem is that there are no .class files in the jar. I
tried to rebuild the compojure jar using lein jar but still didn't
get .class files, even though:

lein help jar
Create a $PROJECT.jar file containing the compiled .class files as
well as the source .clj files.

Any suggestions would be appreciated - thanks.

Scott Hickey

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


Re: Eclipse and Compojure

2010-08-09 Thread scott
I have the tutorial described below working, using Emacs and
Leiningen.

http://mmcgrana.github.com/2010/07/develop-deploy-clojure-web-applications.html

I created a new Clojure project in Eclipse. I created a lib
directory, imported the dependent jar files that Leiningen pulled from
a repo into the lib directory, and added all of the jars to the
project build path.

When I imported the core.clj into the Eclipse project src folder, I
got:
java.io.FileNotFoundException: Could not locate compojure/
core__init.class or compojure/core.clj on classpath:
core.clj/web-
app-adder/src/adder line 1  Clojure Compilation Problem

It just occurred to me to start the REPL and see if the error still
shows up in the error console; it doesn't - the error disappears.

I shut down Eclipse and restarted, and I don't see the error in the
error console anymore - irregardless of the REPL running.

I assumed the problem had to do with the JDT finding no .class files
in the compojure jar file, but there is no error in the error console
now.

Thanks for offering to help - it seems to work now.

Scott Hickey



On Aug 9, 1:41 pm, Laurent PETIT laurent.pe...@gmail.com wrote:
 Hi,

 How could I help you from the Eclipse side ? I don't totally understand the
 steps you're following in Eclipse / counterclockwise (but maybe it's not an
 eclipse / counterclockwise problem ?)

 2010/8/9 scott jscotthic...@gmail.com

  I was going to try out a compojure tutorial in Eclipse. It appears
  that only .clj files and not the .class files are included in the
  compojure jar file.

  I'm seeing the following error:
  java.io.FileNotFoundException: Could not locate compojure/
  core__init.class or compojure/core.clj on classpath:    core.clj
   /web-
  app-adder/src/adder     line 1  Clojure Compilation Problem

  I assume the problem is that there are no .class files in the jar. I
  tried to rebuild the compojure jar using lein jar but still didn't
  get .class files, even though:

  lein help jar
  Create a $PROJECT.jar file containing the compiled .class files as
  well as the source .clj files.

  Any suggestions would be appreciated - thanks.

  Scott Hickey

  --
  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.comclojure%2bunsubscr...@googlegroups.com
  For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en

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


Re: Any Clojure2js Libraries?

2010-07-08 Thread Scott Jaderholm
Clojurescript is the only thing I know of like scheme2js. There are a
couple parenscript like programs, the best being
http://github.com/arohner/scriptjure

Scott



On Thu, Jul 8, 2010 at 1:17 PM, Tim Robinson tim.blacks...@gmail.com wrote:
 All I got from google was Clojurescript, but I'm wondering what
 options are out there.

 I was looking for something like scheme2js[1] only in Clojure.

 Thanks,
 Tim

 [1] http://www-sop.inria.fr/mimosa/scheme2js/



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

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


Re: -- macro proposal

2010-07-06 Thread Scott Jaderholm
On Tue, Jul 6, 2010 at 3:24 PM, Greg g...@kinostudios.com wrote:

  This would be most likely java interop, ie. -.
  There the main arguments are 99% of the times the first or the last ones.
 So - or - will work

 OK, so what happens when one of the functions takes it in the front, and
 the other in the back?

 Or what happens when you're using a piece of code that doesn't follow
 either convention? Are you saying such code doesn't exist?

 In both those cases, - and - become useless.


You can use - and - together to handle changing argument orders.

(- foo
(str 1)
(- (conj #{})))

Scott

(I would like -- or let- in contrib though)

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

Re: -- macro proposal

2010-07-06 Thread Scott Jaderholm
On Tue, Jul 6, 2010 at 3:37 PM, Scott Jaderholm jaderh...@gmail.com wrote:


 On Tue, Jul 6, 2010 at 3:24 PM, Greg g...@kinostudios.com wrote:

  This would be most likely java interop, ie. -.
  There the main arguments are 99% of the times the first or the last
 ones. So - or - will work

 OK, so what happens when one of the functions takes it in the front, and
 the other in the back?

 Or what happens when you're using a piece of code that doesn't follow
 either convention? Are you saying such code doesn't exist?

 In both those cases, - and - become useless.


 You can use - and - together to handle changing argument orders.

 (- foo
 (str 1)
 (- (conj #{})))

 Scott

 (I would like -- or let- in contrib though)


Sorry, this was just in response to what happens when one of the functions
takes it in the front, and the other in the back? not what happens when
you're using a piece of code that doesn't follow either convention?, which
would have to use #().

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

Re: binary structures/bitstrings

2010-04-20 Thread Scott T
After looking through the code and tests, it looks like *exactly* what
I'll need and I doubt I'll need/want to change anything.  Thanks for
the docs as well - it's nice to see code that looks like it was
written like you meant it :).

I'll probably use clojure to build my prototype (with all 8.5 seconds
of free time I have), and if I come up with any feedback or
contributions, I'll let you know.

-Scott

On Apr 19, 8:52 pm, Scott T scott.tho...@gmail.com wrote:
 Thanks a lot for pulling that out.  I'll let you know how it goes.

 -Scott

 On Apr 19, 1:40 am, Geoff geoff.sal...@gmail.com wrote:



  I've pushed the bytebuffer stuff into it's own repo and project and
  cleaned up the documentation a bit.
  Seehttp://github.com/geoffsalmon/bytebuffer

  I'd appreciate any feedback you have after trying it out.

  - Geoff

  --
  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 
  athttp://groups.google.com/group/clojure?hl=en

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

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


Re: binary structures/bitstrings

2010-04-19 Thread Scott T
Thanks a lot for pulling that out.  I'll let you know how it goes.

-Scott

On Apr 19, 1:40 am, Geoff geoff.sal...@gmail.com wrote:
 I've pushed the bytebuffer stuff into it's own repo and project and
 cleaned up the documentation a bit.
 Seehttp://github.com/geoffsalmon/bytebuffer

 I'd appreciate any feedback you have after trying it out.

 - Geoff

 --
 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 
 athttp://groups.google.com/group/clojure?hl=en

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


Re: binary structures/bitstrings

2010-04-18 Thread Scott T
Well, network packets would also be a good use of what I was looking
for and it looks *very* much like something useful for what I want.
I'll clone it and try it in the next few days.  My intention is to use
it for some low-level structures inside virtual disk files...

I haven't done anything with clojars either.

On Apr 18, 9:17 am, Geoff geoff.sal...@gmail.com wrote:
 I've implemented something similar for working with
 java.nio.ByteBuffer objects to pull apart and build network packets,
 but it's not packaged as a separate library right now. Look 
 athttp://github.com/geoffsalmon/bonjure/blob/master/src/bonjure/bytebuf...
 specifically the pack, unpack, pack-bits, unpack-bits functions. Does
 that do what you need? There's examples in the 
 testshttp://github.com/geoffsalmon/bonjure/blob/master/test/bonjure/bytebu...
 I've only used it for one particular task, but I'd like to separate it
 and push it to clojars. It's about time I learn how to do that.

 - Geoff

 On Apr 16, 9:28 pm, Scott T scott.tho...@gmail.com wrote:



  Does anyone know of a clojure library for handling (un)packing of
  binary structures?  I'm looking for something similar to perl/ruby/
  python's pack(...) function or something like OCaml's bitstring
  module.  My initial google and clojure-contrib perusing hasn't turned
  up anything obvious though I've found at least one interesting blog
  post on a related subject.

  If there is such a thing in existence I'd like to know about it
  otherwise I'll probably want to create it - to scratch my own itch -
  and maybe someone else will have an interest in such a thing.

  -stt

  --
  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 
  athttp://groups.google.com/group/clojure?hl=en

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

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


  1   2   >