Sonian is hiring for remote Clojure positions!

2015-03-19 Thread Dan Dillinger
about this or any of the other positions on our site, send an email to j...@sonian.net with your resumé. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new

Clojure Positions in NYC at ActionX

2013-11-05 Thread Edwin Watkeys
Hey guys, I'm the CTO of ActionX, where we've built much of our infrastructure in Clojure*. We're hiring. If you're in the NYC area and would like to work as part of an interestingly-eclectic group of programmers, please take a look at the position description below and get in touch if you're i

Re: Thread Macro For Inserting In Arbitrary Positions

2011-07-05 Thread Sean Corfield
On Tue, Jul 5, 2011 at 4:14 PM, Asim Jalis wrote: > Here is an example of using this: > > (--> "hello world" (.toUpperCase _) (.toLowerCase _) (.indexOf _ "w")) BTW, that's not a very compelling example since you can already do: (-> "hello world!" .toUpperCase .toLowerCase (.indexOf "w")) -- Se

Re: Thread Macro For Inserting In Arbitrary Positions

2011-07-05 Thread Mark Rathwell
gt; > (--> "hello world" (.toUpperCase _) (.toLowerCase _) (.indexOf _ "w")) > > On Tue, Jul 5, 2011 at 3:50 PM, Asim Jalis wrote: > > Frequently I want to use the thread macros (-> or ->>) except I need > > to thread the arguments into positions oth

Re: Thread Macro For Inserting In Arbitrary Positions

2011-07-05 Thread Asim Jalis
Here is an example of using this: (--> "hello world" (.toUpperCase _) (.toLowerCase _) (.indexOf _ "w")) On Tue, Jul 5, 2011 at 3:50 PM, Asim Jalis wrote: > Frequently I want to use the thread macros (-> or ->>) except I need > to thread the arguments into

Thread Macro For Inserting In Arbitrary Positions

2011-07-05 Thread Asim Jalis
Frequently I want to use the thread macros (-> or ->>) except I need to thread the arguments into positions other than the first and the last. Or sometimes I have to go back and forth between first and last positions. Instead of alternating between -> and ->> and creating nestin

Re: Programming Clojure: Snake: update-positions: What does the "do" do here?

2010-08-05 Thread Stuart Halloway
Adding to what Meikel said: A warning sign that the latter version is incorrect is the double open parens: "((ref-set ..." Double open parens are fairly rare in Clojure code. Stu > Hi, > > On Aug 5, 4:18 pm, michele wrote: >> ORIGINAL >> >> (defn update

Re: Programming Clojure: Snake: update-positions: What does the "do" do here?

2010-08-05 Thread Laurent PETIT
2010/8/5 michele > > ORIGINAL > > (defn update-positions [snake apple] > (dosync >(if (eats? @snake @apple) > (do (ref-set apple (create-apple)) >(alter snake move :grow)) > (alter snake move))) > nil) > > > WITHOUT do > > (d

Re: Programming Clojure: Snake: update-positions: What does the "do" do here?

2010-08-05 Thread Peter Schuller
> ORIGINAL > > (defn update-positions [snake apple] >  (dosync >    (if (eats? @snake @apple) >      (do (ref-set apple (create-apple)) >        (alter snake move :grow)) >     (alter snake move))) > nil) > > > WITHOUT do > > (defn update-positions [snak

Re: Programming Clojure: Snake: update-positions: What does the "do" do here?

2010-08-05 Thread Meikel Brandmeyer
Hi, On Aug 5, 4:18 pm, michele wrote: > ORIGINAL > > (defn update-positions [snake apple] >   (dosync >     (if (eats? @snake @apple) >       (do (ref-set apple (create-apple)) >         (alter snake move :grow)) >      (alter snake move))) > nil) > > WITHOUT do

Programming Clojure: Snake: update-positions: What does the "do" do here?

2010-08-05 Thread michele
ORIGINAL (defn update-positions [snake apple] (dosync (if (eats? @snake @apple) (do (ref-set apple (create-apple)) (alter snake move :grow)) (alter snake move))) nil) WITHOUT do (defn update-positions [snake apple] (dosync (if (eats? @snake @apple) ((ref

clojure positions available

2009-12-30 Thread Stuart Halloway
More specifically "Developer positions with a major Clojure focus at our Durham, NC, USA office." Relevance is also doing a lot of Ruby, plus some C, Java, and a smattering of other things. Learn more about Relevance at http://howwework.thinkrelevance.com/. If you are interest

Re: positions

2009-11-22 Thread nchubrich
Thanks Emeka, I took a look at it. I still say it would be nice to organize the sequence functions (somehow). -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new membe

Re: positions

2009-11-22 Thread John Harrop
On Sun, Nov 22, 2009 at 7:54 AM, Emeka wrote: > John, > > You should have added that you code came from Programming Clojure. > It didn't. If it's the same as, or closely similar to, code from there, it's entirely coincidental. In Clojure there's usually several ways to do something, but often o

Re: positions

2009-11-22 Thread Emeka
;d recommend re-writing it to be lazy. Your >> version is eager because it uses loop. In order to make it lazy, >> you'd want to construct a lazy-seq. See the macro w/ the same name. >> >> Another choice is to use built-in functions, like this: >> >> (def

Re: positions

2009-11-22 Thread Emeka
Nick, Remember to re-visit indexed and index-filter functions of programming Clojure. Regard, Emeka On Thu, Nov 19, 2009 at 7:13 PM, nchubrich wrote: > Thanks Sean, I'll do the exercise. I don't know how I missed it in > seq-utils. > After months of programming Clojure, I realize how much I

Re: positions

2009-11-20 Thread nchubrich
If you think about it, the tower of sequence types is like this: seq | gathered seq /\ multiset permutation \ / set The way to do the various options I pointed out is to mix types: the k

Re: positions

2009-11-20 Thread nchubrich
My 'requirements' were not so much for any particular need, but to try to think up a logical and complete API for dealing with multisets. I agree that there should be an actual collection type for multisets (implemented as an underlying map of values to frequencies I presume); but you might as wel

Re: positions

2009-11-19 Thread Alex Burka
t; >>> >>> I think he also wants the original order of the first input coll to >>> be >>> preserved, though. Sort wouldn't do that. >> >> Hmmm.. that's a pretty weird set of requirements. Usually a >> multiset/bag is unordered. What ha

Re: positions

2009-11-19 Thread John Harrop
dn't do that. > > Hmmm.. that's a pretty weird set of requirements. Usually a > multiset/bag is unordered. What happens if same elements aren't grouped > together in the first input coll it, it just arbitrarily picks one of > their positions and moves them all togethe

Re: positions

2009-11-19 Thread Alex Osborne
sually a multiset/bag is unordered. What happens if same elements aren't grouped together in the first input coll it, it just arbitrarily picks one of their positions and moves them all together there? :-) If you're going to go to the trouble of making special multiset functions you may as we

Re: positions

2009-11-19 Thread John Harrop
On Thu, Nov 19, 2009 at 7:15 PM, Alex Osborne wrote: > John Harrop wrote: > > On Thu, Nov 19, 2009 at 7:00 PM, Sean Devlin > > wrote: > > > > That's why there are two separate functions do do what you suggest > > > > user=>(interleave [1 2 3 4] [1 2 3 4])

Re: positions

2009-11-19 Thread Alex Osborne
John Harrop wrote: > On Thu, Nov 19, 2009 at 7:00 PM, Sean Devlin > wrote: > > That's why there are two separate functions do do what you suggest > > user=>(interleave [1 2 3 4] [1 2 3 4]) > (1 1 2 2 3 3 4 4) > > user=> (concat [1 2 3 4] [1 2 3 4

Re: positions

2009-11-19 Thread John Harrop
On Thu, Nov 19, 2009 at 7:00 PM, Sean Devlin wrote: > That's why there are two separate functions do do what you suggest > > user=>(interleave [1 2 3 4] [1 2 3 4]) > (1 1 2 2 3 3 4 4) > > user=> (concat [1 2 3 4] [1 2 3 4]) > (1 2 3 4 1 2 3 4) > Poor choice of example. I think he meant even if he

Re: positions

2009-11-19 Thread Sean Devlin
h, remove will work for one kind of 'multiset' operator I am > thinking of.  The others might as well preserve as much order as > possible.  For instance, (add [1 2 3 4] [1 2 3 4]) could have two > interpretations; you just append, or you add like elements to > positions of l

Re: positions

2009-11-19 Thread nchubrich
Yeah, remove will work for one kind of 'multiset' operator I am thinking of. The others might as well preserve as much order as possible. For instance, (add [1 2 3 4] [1 2 3 4]) could have two interpretations; you just append, or you add like elements to positions of like elements, so

Re: positions

2009-11-19 Thread Alex Osborne
ajuc wrote: > On 20 Lis, 01:49, nchubrich wrote: >> While we're on the topic, where is something like (subtract [1 2 3 3 4 >> 4 5 6] evens) -> (1 3 3 5)? Doesn't seem to be in seq-utils or API. >> Seems like there should be a parallel "multiset" library for colls, to >> clojure.set. (I guess the

Re: positions

2009-11-19 Thread ajuc
On 20 Lis, 01:49, nchubrich wrote: > While we're on the topic, where is something like (subtract [1 2 3 3 4 > 4 5 6] evens) -> (1 3 3 5)? Doesn't seem to be in seq-utils or API. > Seems like there should be a parallel "multiset" library for colls, to > clojure.set. (I guess there could be two ve

Re: positions

2009-11-19 Thread nchubrich
While we're on the topic, where is something like (subtract [1 2 3 3 4 4 5 6] evens) -> (1 3 3 5)? Doesn't seem to be in seq-utils or API. Seems like there should be a parallel "multiset" library for colls, to clojure.set. (I guess there could be two versions of subtract, one that removes \all, a

Re: positions

2009-11-19 Thread John Harrop
See the macro w/ the same name. > > Another choice is to use built-in functions, like this: > > (defn positions [pred coll] > (map second >(filter (comp pred first) > (map vector coll (iterate inc 0) (defn indexed [coll] (map vector (iterate inc 0) coll)) (def

Re: positions

2009-11-19 Thread nchubrich
Thanks Sean, I'll do the exercise. I don't know how I missed it in seq-utils. After months of programming Clojure, I realize how much I still have to learn. (Knowledge is power; knowledge of lack of knowledge is power to power.) Nick. -- You received this message because you are subscribe

Re: positions

2009-11-19 Thread Sean Devlin
like this: (defn positions [pred coll] (map second (filter (comp pred first) (map vector coll (iterate inc 0) Hope this helps, Sean On Nov 19, 1:07 pm, nchubrich wrote: > Is this function part of the API or any contrib?  I couldn't find it: > > (defn positions [pred co

positions

2009-11-19 Thread nchubrich
Is this function part of the API or any contrib? I couldn't find it: (defn positions [pred coll] (loop [coll coll i 0 accum []] (if (empty? coll) accum (if (pred (first coll)) (recur (rest coll) (inc i) (conj accum i)) (recur (rest coll) (inc i) accum) --