I don't have my own examples, anyway being a daily object-oriented
programmer I'm feeling compelled to say that where function-generating
functions prove their main practical power is in what I'd label man in
the middle functions.
Whenever I need to add behaviour to an existing OO method I have
typo, I meant ring *middleware*, not ring handlers
On Thu, Aug 16, 2012 at 1:01 PM, Roberto Mannai roberm...@gmail.com wrote:
So if you are searching for practical examples I'd suggest to look for
such use cases, although their best application IMHO has to be found not in
business code but
On Wednesday, August 8, 2012 7:48:23 PM UTC+3, Brian Marick wrote:
I'm looking for medium-scale examples of using function-generating
functions.
Brian, when I saw this I was reminded of ring middleware - eg.
http://jgre.org/2010/10/04/ring-middleware/
--
You received this message
How about the new reducers library:
http://clojure.com/blog/2012/05/08/reducers-a-library-and-model-for-collection-processing.html
http://clojure.com/blog/2012/05/15/anatomy-of-reducer.html
Jonas
On Wednesday, August 8, 2012 7:48:23 PM UTC+3, Brian Marick wrote:
I'm looking for medium-scale
While admittedly neat, and educational, this kind of code is fancy for
production use in my opinion:
(defn make-point [x y]
(fn [member]
(cond (= member :x) x
(= member :y) y)))
On Fri, Aug 10, 2012 at 6:06 PM, Jonas jonas.enl...@gmail.com wrote:
How about the new reducers
I think enlives transformersare a very good example of functions returning
functions. Maybe you should have a look at the getting started guide and
the tutorials
Send from Android
Am 09.08.2012 23:13 schrieb Jonah Benton jo...@jonah.com:
You've probably seen these, but if not, Doug Crockford's
That's a good call. +1
On Friday, August 10, 2012 8:36:25 AM UTC-4, Jonas wrote:
How about the new reducers library:
http://clojure.com/blog/2012/05/08/reducers-a-library-and-model-for-collection-processing.html
http://clojure.com/blog/2012/05/15/anatomy-of-reducer.html
Jonas
On
I use quite a few of these in my Overtone rendering of
Bachhttp://skillsmatter.com/podcast/home/functional-composition
:
; Defining a scale function from intervals
(defn sum-n [series n] (reduce + (take n series)))
(defn scale [intervals]
(fn [degree]
(if-not (neg? degree)
(sum-n
On Wednesday, August 8, 2012 6:48:23 PM UTC+2, Brian Marick wrote:
... show the mechanics, but I'm looking for examples that would resonate
more with an object-oriented programmer. Such examples might be ones that
close over a number of values (which looks more like an object), or
You've probably seen these, but if not, Doug Crockford's video series
on javascript walks through a number of interesting information
sharing examples like the ones you're looking for using
fn-generating-fns-
http://yuiblog.com/crockford/
They're all great but act 3 - function the ultimate is
I'm looking for medium-scale examples of using function-generating functions.
I'm doing it because examples like this:
(def make-incrementer
(fn [increment]
(fn [x] (+ increment x
... or this:
(def incish (partial map + [100 200 300]))
... show the mechanics, but I'm looking
I'm looking for medium-scale examples of using function-generating
functions.
I'm not sure if this is exactly what you're looking for, but this sort of
thing is pretty cool:
(defn make-point [x y]
(fn [member]
(cond (= member :x) x
(= member :y) y)))
We're basically creating
trampolines is a slightly different example.
--
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
On Wed, Aug 8, 2012 at 11:48 AM, Brian Marick mar...@exampler.com wrote:
I'm looking for medium-scale examples of using function-generating functions.
Such examples might be ones that ... use closures to avoid the need to have
some particular argument passed from function to function (which
On Aug 8, 2012, at 2:50 PM, Timothy Baldridge wrote:
I'm not sure if this is exactly what you're looking for, but this sort of
thing is pretty cool:
(defn make-point [x y]
(fn [member]
(cond (= member :x) x
(= member :y) y)))
I actually have a whole chapter on
On Aug 8, 2012, at 1:50 PM, Timothy Baldridge tbaldri...@gmail.com wrote:
I'm looking for medium-scale examples of using function-generating
functions.
I'm not sure if this is exactly what you're looking for, but this sort of
thing is pretty cool:
(defn make-point [x y]
(fn
Maybe SICP's simulator of digital circuits will provide some inspiration. I
know when I read this I was deeply awed by what HOFs can do. Maybe
Clojure's zippers would be good too?
On Wednesday, August 8, 2012 12:48:23 PM UTC-4, Brian Marick wrote:
I'm looking for medium-scale examples of
On Wed, Aug 08, 2012 at 08:00:26PM -0600, Jim Weirich wrote:
On Aug 8, 2012, at 1:50 PM, Timothy Baldridge tbaldri...@gmail.com wrote:
I'm looking for medium-scale examples of using function-generating
functions.
I'm not sure if this is exactly what you're looking for, but
On 8/8/12 10:48 AM, Brian Marick wrote:
I'm looking for medium-scale examples of using function-generating functions.
I'm doing it because examples like this:
(def make-incrementer
(fn [increment]
(fn [x] (+ increment x
... or this:
(def incish (partial map + [100 200
19 matches
Mail list logo