Re: what do you think about this code?

2014-12-14 Thread Philip Schwarz
t; > (let [top-right (create-top-right-quadrant-for letter) >right (stack top-right > (flip top-right)) >diamond (beside (map reverse (drop-first-col right)) right)] > (display diamond)) > > The broad takeaway is: if I write a function

Re: what do you think about this code?

2014-12-14 Thread Philip Schwarz
thanks On Tuesday, 9 December 2014 08:01:58 UTC, Colin Yates wrote: > > I forgot to mention but https://github.com/bbatsov/clojure-style-guide is > a pretty good resource. > On 9 Dec 2014 00:24, "Philip Schwarz" > wrote: > >> Hello David, >> >> I h

Re: what do you think about this code?

2014-12-14 Thread Philip Schwarz
unction I only use once, I usually > just inline it. Unless of course I believe deep in my heart I'll have need > of it somewhere else soon :). > This is somewhat a matter of taste, and again, the requirements history > usually determines what gets abstracted into functions, an

Re: what do you think about this code?

2014-12-14 Thread Philip Schwarz
ain - the structural shape of the code imparts knowledge sometimes. > > As David says, if you haven't looked at Prismatic Schema then have a look. > I find the definition of the schema is also an excellent place to capture > this extra layer of info in the names of those structur

Re: what do you think about this code?

2014-12-14 Thread Philip Schwarz
, I fully > appreciate). > > - I don't know if I've ever once used a main function, and you don't see > them in libraries, certainly. But that is minor--there's no reason *not* > to use it, just that I wouldn't expect to see it. > > I hope this is u

Re: what do you think about this code?

2014-12-14 Thread Philip Schwarz
to how other developers > familiar with Clojure (or functional programming in general) may approach > it--not that I'm claiming it's the best approach. I do think it is more > concise without sacrificing readability (which is subjective, I fully > appreciate). > > - I

Re: what do you think about this code?

2014-12-14 Thread Philip Schwarz
ach. I do think it is more > concise without sacrificing readability (which is subjective, I fully > appreciate). > > - I don't know if I've ever once used a main function, and you don't see > them in libraries, certainly. But that is minor--there's no reason *not*

Re: what do you think about this code?

2014-12-13 Thread Philip Schwarz
e, I usually > just inline it. Unless of course I believe deep in my heart I'll have need > of it somewhere else soon :). > This is somewhat a matter of taste, and again, the requirements history > usually determines what gets abstracted into functions, and history can be > mes

Re: what do you think about this code?

2014-12-13 Thread Philip Schwarz
Hi Leif, > you just need to consolidate the more concrete steps. Something like: > flip-bottom-up -> flip (or vertical- and horizontal-flip) > join-together-side-by-side -> beside > put-one-on-top-of-the-other -> stack (or ontop, or ...) > reverse-every-row -> (map reverse rows) ; very readabl

Re: what do you think about this code?

2014-12-13 Thread Philip Schwarz
y > just inline it. Unless of course I believe deep in my heart I'll have need > of it somewhere else soon :). > This is somewhat a matter of taste, and again, the requirements history > usually determines what gets abstracted into functions, and history can be > messy. :

Re: what do you think about this code?

2014-12-13 Thread Philip Schwarz
t. Unless of course I believe deep in my heart I'll have need > of it somewhere else soon :). > This is somewhat a matter of taste, and again, the requirements history > usually determines what gets abstracted into functions, and history can be > messy. :) > > Hope that

Re: what do you think about this code?

2014-12-13 Thread Philip Schwarz
y solution may be closer to how other developers > familiar with Clojure (or functional programming in general) may approach > it--not that I'm claiming it's the best approach. I do think it is more > concise without sacrificing readability (which is subjective, I fully &

Re: what do you think about this code?

2014-12-13 Thread Philip Schwarz
in - the structural shape of the code imparts knowledge sometimes. > > As David says, if you haven't looked at Prismatic Schema then have a look. > I find the definition of the schema is also an excellent place to capture > this extra layer of info in the names of those stru

Re: what do you think about this code?

2014-12-12 Thread Philip Schwarz
elopers > familiar with Clojure (or functional programming in general) may approach > it--not that I'm claiming it's the best approach. I do think it is more > concise without sacrificing readability (which is subjective, I fully > appreciate). > > - I don't

Re: what do you think about this code?

2014-12-12 Thread Philip Schwarz
h is subjective, I fully > appreciate). > > - I don't know if I've ever once used a main function, and you don't see > them in libraries, certainly. But that is minor--there's no reason *not* > to use it, just that I wouldn't expect to see it. > > I

Re: what do you think about this code?

2014-12-12 Thread Philip Schwarz
;s the best approach. I do think it is more > concise without sacrificing readability (which is subjective, I fully > appreciate). > > - I don't know if I've ever once used a main function, and you don't see > them in libraries, certainly. But that is minor--the

Re: what do you think about this code?

2014-12-12 Thread Philip Schwarz
; concise without sacrificing readability (which is subjective, I fully > appreciate). > > - I don't know if I've ever once used a main function, and you don't see > them in libraries, certainly. But that is minor--there's no reason *not* > to use it, just th

Re: what do you think about this code?

2014-12-09 Thread Philip Schwarz
? The separation of WHAT from HOW seems to have a parallel in the [design by] *wishful thinking* approach described in the following section of the LISP bible, Structure and Interpretation of Computer Programs: http://mitpress.mit.edu/sicp/full-text/book/book-Z-H-14.html#%_idx_1306 Philip O

Re: what do you think about this code?

2014-12-08 Thread Philip Schwarz
(or functional programming in general) may approach > it--not that I'm claiming it's the best approach. I do think it is more > concise without sacrificing readability (which is subjective, I fully > appreciate). > > - I don't know if I've ever once used a main f

Re: what do you think about this code?

2014-12-08 Thread Philip Schwarz
x27;m claiming it's the best approach. I do think it is more > concise without sacrificing readability (which is subjective, I fully > appreciate). > > - I don't know if I've ever once used a main function, and you don't see > them in libraries, certainly. Bu

Re: what do you think about this code?

2014-12-08 Thread Philip Schwarz
oncise without sacrificing readability (which is subjective, I fully > appreciate). > > - I don't know if I've ever once used a main function, and you don't see > them in libraries, certainly. But that is minor--there's no reason *not* > to use it, just that

Re: what do you think about this code?

2014-12-07 Thread Philip Schwarz
t; of functions come up time and > time again - the structural shape of the code imparts knowledge sometimes. > > As David says, if you haven't looked at Prismatic Schema then have a look. > I find the definition of the schema is also an excellent place to capture > this extra l

Re: what do you think about this code?

2014-12-07 Thread Philip Schwarz
ojure (or functional programming in general) may approach > it--not that I'm claiming it's the best approach. I do think it is more > concise without sacrificing readability (which is subjective, I fully > appreciate). > > - I don't know if I've ever once used a ma

what do you think about this code?

2014-12-06 Thread Philip Schwarz
Hello, can you please review my first solution to the diamond kata [1] and tear it to bits: let me know all the ways in which YOU would improve the code. I am not so interested in a better algorithm for solving the kata. I am learning Clojure and what I want to know is what YOU would do to make

Re: map versus pmap

2010-11-07 Thread philip schwarz
v 7, 3:25 am, André Thieme wrote: > Am 06.11.2010 12:57, schrieb philip schwarz: > > > > > > > > > > > Hi all, > > > be gentle please: I have only just started using clojure. > > > I run the following on an Intel Core 2 Duo CPU (starting clojure w

Re: map versus pmap

2010-11-06 Thread philip schwarz
ed to the total computation time required. > > Andy > > Sent from my iPhone > > On Nov 6, 2010, at 4:57 AM, philip schwarz > wrote: > > > > > > > > > Hi all, > > > be gentle please: I have only just started using clojure. > > > I run

map versus pmap

2010-11-06 Thread philip schwarz
Hi all, be gentle please: I have only just started using clojure. I run the following on an Intel Core 2 Duo CPU (starting clojure with "java -Xms1000m -Xmx1000m -jar clojure.jar"): user=> (time (nth (doall (map inc (range 1000))) 999)) "Elapsed time: 5944.068355 msecs" 1000 user=>