Re: [emacs over ssh limitations]

2012-08-29 Thread Tim Cross
I've just got my first mac and will investigate a bit and let you know what I find out. I know that emacs can work over ssh with all key combos and am fairly certain it will be an issue with the terminal emulator, so I should be able to find the right setup with a bit of time.. Tim On Tuesday

Building School Seating Charts in Clojure and ClojureScript: Part 1

2012-08-29 Thread Evan Mezeske
I finally got around to writing the first installment in what is going to be a series of articles about my experiences with building a commercial web app in Clojure and ClojureScript: http://blog.mezeske.com/?p=552 Sorry if the first article doesn't have enough meaty technical details (or code

Re: Building School Seating Charts in Clojure and ClojureScript: Part 1

2012-08-29 Thread Shantanu Kumar
Thanks for sharing the blog post - I enjoyed reading it. Looking forward to the rest of the series. Shantanu On Aug 29, 1:38 pm, Evan Mezeske wrote: > I finally got around to writing the first installment in what is going to > be a series of articles about my experiences with building a commerci

Re: `format` behavior on Clojure vs CLJS

2012-08-29 Thread Moritz Ulrich
Shantanu Kumar writes: > Hi, > > I noticed that on the Clojure REPL, `format` works fine: > > user=> (format "foo%s" :s) > "foo:s" > user=> (format "foo%s" 's) > "foos" > > However, on the CLJS REPL (Rhino), I get this: > > ClojureScript:cljs.user> (format "foo%s" :s) > "foo���'s" > ClojureScript

Re: Building School Seating Charts in Clojure and ClojureScript: Part 1

2012-08-29 Thread Marco Dalla Stella
2012/8/29 Evan Mezeske : > I finally got around to writing the first installment in what is going to be > a series of articles about my experiences with building a commercial web app > in Clojure and ClojureScript: > > http://blog.mezeske.com/?p=552 > > Sorry if the first article doesn't have enoug

Talks! Dojos! Roll up! Roll up!

2012-08-29 Thread Bruce Durling
My Fellow Clojurians! Roll up! Roll up! As a part of our ongoing regular schedule of dojos and talks I'd like to invite you all to our events happening in the first half of September in London Come to Skills Matter on Tuesday 4 September to hear lightning talks from Neale Swinnerton on the cloju

ANN: Friend 0.1.0 released (web authentication/authorization library)

2012-08-29 Thread Chas Emerick
I released [com.cemerick/friend "0.1.0"] to Clojars last night. Friend is an extensible authentication and authorization library for Clojure Ring web applications and services: https://github.com/cemerick/friend This release does make some breaking changes, though all unfortunately necessary.

Re: Building School Seating Charts in Clojure and ClojureScript: Part 1

2012-08-29 Thread Stathis Sideris
Nice post, thanks. Did you write the the geometry utilities yourself? On Wednesday, 29 August 2012 09:38:06 UTC+1, Evan Mezeske wrote: > > I finally got around to writing the first installment in what is going to > be a series of articles about my experiences with building a commercial web > app

Re: `format` behavior on Clojure vs CLJS

2012-08-29 Thread David Nolen
On Wed, Aug 29, 2012 at 7:07 AM, Moritz Ulrich wrote: > > Shantanu Kumar writes: > >> Hi, >> >> I noticed that on the Clojure REPL, `format` works fine: >> >> user=> (format "foo%s" :s) >> "foo:s" >> user=> (format "foo%s" 's) >> "foos" >> >> However, on the CLJS REPL (Rhino), I get this: >> >> Cl

Re: Building School Seating Charts in Clojure and ClojureScript: Part 1

2012-08-29 Thread David Nolen
On Wed, Aug 29, 2012 at 4:38 AM, Evan Mezeske wrote: > I finally got around to writing the first installment in what is going to be > a series of articles about my experiences with building a commercial web app > in Clojure and ClojureScript: > > http://blog.mezeske.com/?p=552 > > Sorry if the fir

Re: `format` behavior on Clojure vs CLJS

2012-08-29 Thread Shantanu Kumar
On Aug 29, 7:04 pm, David Nolen wrote: > On Wed, Aug 29, 2012 at 7:07 AM, Moritz Ulrich wrote: > > > Shantanu Kumar writes: > > >> Hi, > > >> I noticed that on the Clojure REPL, `format` works fine: > > >> user=> (format "foo%s" :s) > >> "foo:s" > >> user=> (format "foo%s" 's) > >> "foos" > > >

Re: Can CLJS functions have metadata?

2012-08-29 Thread David Nolen
On Sat, Aug 25, 2012 at 6:18 PM, Timothy Baldridge wrote: > >>> It's not currently supported. Ticket welcome. If you have ideas about >>> a good approach that's even better. Part of the problem is that >>> Clojure fns are just JS fns. >> >> > > Can't we just set the attribute on the function? This

Re: Destructuring can create structure..?

2012-08-29 Thread Douglas Orr
Cheers, Justin - I'd forgotten that (and just thought that vector-as-map destructuring was broken - but this would explain why it is different from other seqables.) Doug On Tuesday, August 28, 2012 3:12:43 PM UTC+1, Justin Kramer wrote: > > Vector-as-map destructuring makes sense when you cons

ANN Monger 1.2.0

2012-08-29 Thread Michael Klishin
Monger is an idiomatic Clojure MongoDB driver for a more civilized age. It has batteries included, offers powerful expressive query DSL, strives to support every MongoDB 2.0+ feature and has sane defaults. Monger 1.2 focus is on a number of small improvements and making

Re: [emacs over ssh limitations]

2012-08-29 Thread Phil Hagelberg
Alan Busby writes: > To support what Tim said, after killing an afternoon I got iTerm2 from > OSX to play nice with an Emacs in gnu screen on a remote Linux host. > > All keys and combos were working by the end. I don't have my laptop > near me to check now, but I think making *EVERY* setting alo

(merge) => nil

2012-08-29 Thread Brian Marick
Why does `(merge)` return nil? I would have expected it to return the unit ({}) by analogy with things like this: (+) => 0 (*) => 1 - Brian Marick, Artisanal Labrador Contract programming in Ruby and Clojure Occasional consulting on Agile -- You received this message because you are subsc

Re: (merge) => nil

2012-08-29 Thread Ulises
Don't know why nil is returned instead of {}, but > (+) => 0 > (*) => 1 following that line of reasoning: > (merge nil {:a 1}) {:a 1} > (merge {} {:a 1}) {:a 1} -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to cl

Re: (merge) => nil

2012-08-29 Thread Ambrose Bonnaire-Sergeant
My guess is that `merge` has an invariant "if all args are nil, return nil", making calls to `seq` "contagious" from args to return value. => (merge (seq {}) (seq {})) nil Just a guess though. Thanks, Ambrose On Thu, Aug 30, 2012 at 12:18 AM, Brian Marick wrote: > Why does `(merge)` return ni

Re: (merge) => nil

2012-08-29 Thread Joop Kiefte
An empty sequence is equal to nil. 2012/8/29 Ambrose Bonnaire-Sergeant : > My guess is that `merge` has an invariant "if all args are nil, return nil", > making calls to `seq` "contagious" from args to return value. > > => (merge (seq {}) (seq {})) > nil > > Just a guess though. > > Thanks, > Ambr

Re: (merge) => nil

2012-08-29 Thread Ambrose Bonnaire-Sergeant
On Thu, Aug 30, 2012 at 12:41 AM, Joop Kiefte wrote: > An empty sequence is equal to nil. > What do you mean? => (seq? ()) true => (= nil ()) false > > 2012/8/29 Ambrose Bonnaire-Sergeant : > > My guess is that `merge` has an invariant "if all args are nil, return > nil", > > making calls to

Re: Clojure group in DFW area

2012-08-29 Thread Alex Robbins
Ok, the meetup group is setup and the meetup location is confirmed. http://www.meetup.com/DFW-Clojure/ I look forward to seeing everyone in person. Alex On Tue, Aug 28, 2012 at 1:00 PM, Alex Robbins wrote: > Hey guys, sorry about the radio silence. Unofficially, it looks like > the meetup will

Re: Building School Seating Charts in Clojure and ClojureScript: Part 1

2012-08-29 Thread Evan Mezeske
On Wednesday, August 29, 2012 6:10:59 AM UTC-7, Stathis Sideris wrote: > > Nice post, thanks. Did you write the the geometry utilities yourself? Yeah, I did. That code is pretty application-specific. It covers things like "if a lab-bench desk with two chairs is rotated, where do the seats end

Re: (merge) => nil

2012-08-29 Thread Moritz Ulrich
This isn't true in Clojure: http://clojure.org/lisps However, most functions treat an empty seq as nil because they call `seq' on their arguments. On Wed, Aug 29, 2012 at 6:41 PM, Joop Kiefte wrote: > An empty sequence is equal to nil. > > 2012/8/29 Ambrose Bonnaire-Sergeant : > > My guess is t

Re: (merge) => nil

2012-08-29 Thread Ben Wolfson
On Wed, Aug 29, 2012 at 9:41 AM, Joop Kiefte wrote: > An empty sequence is equal to nil. How so? user> (some #(= % nil) ['() [] {}]) nil -- 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 s

European conferences in 2012?

2012-08-29 Thread Jonathan Lange
Hello everyone, Just wondering if there are any conferences in Europe coming up in the remainder of the year that would be of interest to someone interested in Clojure? If there's a web page I should have looked before posting, would very much appreciate the pointer. Thanks, jml -- You receive

assoc with uneven arguments

2012-08-29 Thread Ambrose Bonnaire-Sergeant
I think assoc should throw an error when applied with uneven arguments. Currently, the "missing" value is just replaced with nil. (assoc {} :a 1 :b) ;=> {:a 1, :b nil} Thoughts? Thanks, Ambrose -- You received this message because you are subscribed to the Google Groups "Clojure" group. To po

Re: European conferences in 2012?

2012-08-29 Thread Gustavo Brunoro
Hi Jonathan, There's this page for listing events: http://dev.clojure.org/display/community/Clojure+Events Cheers, Gustavo 2012/8/29 Jonathan Lange > Hello everyone, > > Just wondering if there are any conferences in Europe coming up in the > remainder of the year that would be of interest to

Where can I find Selenium, Meets clojure talk?

2012-08-29 Thread Mayank Jain
Hi, I am looking for the video for this talk : Selenium, Meets clojure. By Andy Kriger Clojure is a general-purpose LISP dialect that targets the Java Virtual Machine (JVM), the Common Language Runtime (CLR), and JavaScript (via ClojureScript) . Using the clj-webdriver library and the Read-Eval

Re: Building School Seating Charts in Clojure and ClojureScript: Part 1

2012-08-29 Thread Jonas
On Wednesday, August 29, 2012 8:29:05 PM UTC+3, Evan Mezeske wrote: > > On Wednesday, August 29, 2012 6:10:59 AM UTC-7, Stathis Sideris wrote: >> >> Nice post, thanks. Did you write the the geometry utilities yourself? > > > Yeah, I did. That code is pretty application-specific. It covers thing

Re: Building School Seating Charts in Clojure and ClojureScript: Part 1

2012-08-29 Thread Jerry
very good article for beginners like me. thanks for sharing. On Aug 29, 2012 4:38 PM, "Evan Mezeske" wrote: > I finally got around to writing the first installment in what is going to > be a series of articles about my experiences with building a commercial web > app in Clojure and ClojureScript

Re: (merge) => nil

2012-08-29 Thread dmirylenka
I would say, they treat nil as an empty sequence, which makes nil, effectively, a unit: (assoc nil :a :b) ; => {:a :b} (merge nil {:a :b}) ; => {:a :b} etc. On Wednesday, August 29, 2012 7:36:26 PM UTC+2, Moritz Ulrich wrote: > > This isn't true in Clojure: http://clojure.org/lisps > > However,

Re: assoc with uneven arguments

2012-08-29 Thread Chas Emerick
On Aug 29, 2012, at 2:20 PM, Ambrose Bonnaire-Sergeant wrote: > I think assoc should throw an error when applied with uneven arguments. > > Currently, the "missing" value is just replaced with nil. > > (assoc {} :a 1 :b) > ;=> {:a 1, :b nil} > > Thoughts? Yes, please. That's just wrong. - Ch

another why: (flatten #{:a :b}) => () ???

2012-08-29 Thread dmirylenka
Calling flatten on anything that is not 'sequential?' returns an empty sequence: (flatten 1); => () (flatten "Hi"); => () With sets if feels somewhat strange: (flatten #{#{:a} #{:b :c}}); => () For some reason I expected #{#{:a} #{:b :c}} to equal #{:a :b :c}. Ok, the docstring says: "Takes

Re: [emacs over ssh limitations]

2012-08-29 Thread Denis Labaye
On Tue, Aug 28, 2012 at 2:44 AM, Stuart Sierra wrote: > It's easy enough to test: fire up a small EC2 instance and use Emacs over > an SSH+tmux session. You could also try using your own local Emacs that way > by SSH'ing to localhost. > In my experience, commands don't work in a terminal if they

Re: (merge) => nil

2012-08-29 Thread Steve Miner
On Aug 29, 2012, at 12:18 PM, Brian Marick wrote: > Why does `(merge)` return nil? I would have expected it to return the unit > ({}) I agree with your intuition -- I expected an empty map. However, the doc says "Returns a map that consists of the rest of the maps conj-ed onto the first" wh

ANN: Clip-test (testing) and Quiddity (custom eval) for Clojure and ClojureScript

2012-08-29 Thread Shantanu Kumar
Hi, I am happy to announce about two (early-stage yet functional) libraries: 1. Clip-test v0.1.0: https://github.com/kumarshantanu/clip-test 2. Quiddity v0.1.0: https://github.com/kumarshantanu/quiddity Clip-test is a tiny subset of `clojure.test` that works for both Clojure and ClojureScript.

Re: European conferences in 2012?

2012-08-29 Thread Denis Labaye
On Wed, Aug 29, 2012 at 3:08 PM, Jonathan Lange wrote: > Hello everyone, > > Just wondering if there are any conferences in Europe coming up in the > remainder of the year that would be of interest to someone interested > in Clojure? > I don't know, but I am interested... We will probably have

Will this cause stack overflow?

2012-08-29 Thread Erlis Vidal
Hi group, Will this recursion cause stack overflow? (defn my-flatten [x] (if (coll? x) (mapcat my-flatten x) [x])) If yes, how can I do a recursive call when passing the function as a parameter to another function, like in this case with mapcat? Thanks, Erlis -- You received this message be

Re: Will this cause stack overflow?

2012-08-29 Thread Ben Wolfson
Yes: user> (defn my-flatten [x] (if (coll? x) (mapcat my-flatten x) [x])) #'user/my-flatten user> (my-flatten (take 4000 (iterate vector []))) (stack overflow) On Wed, Aug 29, 2012 at 2:03 PM, Erlis Vidal wrote: > Hi group, > > Will this recursion cause stack overflow? > > (defn my-flatten [x

Re: European conferences in 2012?

2012-08-29 Thread Marco Abis
> We will probably have another EuroClojure next year I guess, given the > success of the first one ... that's the plan (and in a different country) -- Marco Abis -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to

Re: European conferences in 2012?

2012-08-29 Thread David Nolen
On Wed, Aug 29, 2012 at 9:08 AM, Jonathan Lange wrote: > Hello everyone, > > Just wondering if there are any conferences in Europe coming up in the > remainder of the year that would be of interest to someone interested > in Clojure? > > If there's a web page I should have looked before posting, w

Re: Will this cause stack overflow?

2012-08-29 Thread Nate Young
On Wed, Aug 29, 2012 at 4:03 PM, Erlis Vidal wrote: > If yes, how can I do a recursive call when passing the function as a > parameter to another function, like in this case with mapcat? You could use `lazy-seq`. Something like this: (defn my-flatten [x] (lazy-seq (if (coll? x) (mapca

Re: another why: (flatten #{:a :b}) => () ???

2012-08-29 Thread Steve Miner
flatten has been discussed before: https://groups.google.com/forum/?fromgroups=#!topic/clojure/ye70iNJ73zc See also CLJ-400, but it looks like no patch was submitted. http://dev.clojure.org/jira/browse/CLJ-400 I think the general policy for Clojure is that the core functions of course should w

Re: (merge) => nil

2012-08-29 Thread dmirylenka
Hm.. There seem to be cases when nil is not equivalent to {} when working with maps: (conj {} [:a :b]); => {:a :b} (conj nil [:a :b]); => ([:a :b]) Although, code working with maps shouldn't use conj anyway. Any other examples? On Wednesday, August 29, 2012 9:08:07 PM UTC+2, dmirylenka wrote:

Re: European conferences in 2012?

2012-08-29 Thread Martin Dow
A 1 day event in Amsterdam on 27th Oct was announced here recently: https://groups.google.com/forum/?fromgroups=#!topic/clojure/rEBJK4KkdNo Martin. On Wednesday, 29 August 2012 14:08:37 UTC+1, Jonathan Lange wrote: > > Hello everyone, > > Just wondering if there are any conferences in Europe

Re: assoc with uneven arguments

2012-08-29 Thread Andy Fingerhut
On Aug 29, 2012, at 12:17 PM, Chas Emerick wrote: > On Aug 29, 2012, at 2:20 PM, Ambrose Bonnaire-Sergeant wrote: > >> I think assoc should throw an error when applied with uneven arguments. >> >> Currently, the "missing" value is just replaced with nil. >> >> (assoc {} :a 1 :b) >> ;=> {:a 1, :

Re: European conferences in 2012?

2012-08-29 Thread Bruce Durling
There is the Clojure eXchange at Skills Matter in London on 6 December. http://skillsmatter.com/event/scala/clojure-exchange-2012 cheers, Bruce On Wed, Aug 29, 2012 at 2:08 PM, Jonathan Lange wrote: > Hello everyone, > > Just wondering if there are any conferences in Europe coming up in the > r

Re: 6 December 2012 - London - Clojure eXchange - Call for Presentations

2012-08-29 Thread Bruce Durling
Fellow Clojurians! I'm thinking that almost 2 months might be enough time for everyone to submit their talk ides for the 2012 Clojure eXchange at Skills Matter in December. I'd like to close the call for papers at the end of this weekend. So if you have any ideas submit them here: https://docs.go

Re: another why: (flatten #{:a :b}) => () ???

2012-08-29 Thread dmirylenka
Thanks for the elaborate answer! It also clears some other doubts I had regarding the core functions. On Wednesday, August 29, 2012 11:34:56 PM UTC+2, miner wrote: > > flatten has been discussed before: > > https://groups.google.com/forum/?fromgroups=#!topic/clojure/ye70iNJ73zc > > See also CLJ-

Re: (merge) => nil

2012-08-29 Thread Meikel Brandmeyer
Hi, Am 29.08.2012 um 23:38 schrieb dmirylenka: > Although, code working with maps shouldn't use conj anyway. Why? Kind regards Meikel signature.asc Description: Message signed with OpenPGP using GPGMail

Re: (merge) => nil

2012-08-29 Thread Brian Marick
On Aug 29, 2012, at 2:08 PM, dmirylenka wrote: > I would say, they treat nil as an empty sequence, which makes nil, > effectively, a unit: > > (assoc nil :a :b) ; => {:a :b} > (merge nil {:a :b}) ; => {:a :b} It's not a unit if you're using `if-let` and expect nil to represent failure and {}

Re: (merge) => nil

2012-08-29 Thread dmirylenka
I sort of remember Rich Hickey say this, but I am not sure :). As far as I see it, it is generally better to use more specific functions, as they make the assumptions about the types of the arguments more explicit. Sometimes they are also more efficient (but probably not in this case). So, for

Re: (merge) => nil

2012-08-29 Thread dmirylenka
> It's not a unit if you're using `if-let` and expect nil to represent failure and {} to represent a success that establishes no bindings. You mean, something like this, right? : (if-let [{:keys [a]} {}] "Hi"); => "Hi" (if-let [{:keys [a]} nil] "Hi"); => nil Interesting example! In my own co

how to translate this snippet from Scheme to Clojure

2012-08-29 Thread Andy Coolware
> (define (A) 1) # > A # > (A) 1 > (define ((A)) 1) # > A # > (A) # > ((A)) 1 Just wondering ... Andy -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are

Re: how to translate this snippet from Scheme to Clojure

2012-08-29 Thread Baishampayan Ghose
Something like this? (defn A [] 1) (defn A [] (fn [] 1)) Regards, BG On Thu, Aug 30, 2012 at 10:41 AM, Andy Coolware wrote: >> (define (A) 1) > # >> A > # >> (A) > 1 >> (define ((A)) 1) > # >> A > # >> (A) > # >> ((A)) > 1 > > Just wondering ... > > Andy > > -- > You received this message

Re: [emacs over ssh limitations]

2012-08-29 Thread Alan Busby
On Thu, Aug 30, 2012 at 1:13 AM, Phil Hagelberg wrote: > Alan Busby writes: >> To support what Tim said, after killing an afternoon I got iTerm2 from >> OSX to play nice with an Emacs in gnu screen on a remote Linux host. >> >> All keys and combos were working by the end. I don't have my laptop >