Re: Attractive examples of function-generating functions

2012-08-10 Thread Brian Rowe
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 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. 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 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 
 generate multiple functions that all close over a shared value (which looks 
 more like an object), or use closures to avoid the need to have some 
 particular argument passed from function to function (which looks like the 
 `this` in an instance method). 

 Note: please put the flamethrower down. I'm not saying that looking like 
 objects is the point of higher-order functions. 

 I'll give full credit. 

 - 
 Brian Marick, Artisanal Labrador 
 Contract programming in Ruby and Clojure 
 Occasional consulting on Agile 




-- 
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: Attractive examples of function-generating functions

2012-08-08 Thread Brian Rowe
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 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 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 
 generate multiple functions that all close over a shared value (which looks 
 more like an object), or use closures to avoid the need to have some 
 particular argument passed from function to function (which looks like the 
 `this` in an instance method). 

 Note: please put the flamethrower down. I'm not saying that looking like 
 objects is the point of higher-order functions. 

 I'll give full credit. 

 - 
 Brian Marick, Artisanal Labrador 
 Contract programming in Ruby and Clojure 
 Occasional consulting on Agile 




-- 
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: A succinct reasonably fast sudoku solver in core.logic

2012-08-03 Thread Brian Rowe


On Tuesday, July 31, 2012 11:48:14 AM UTC-4, David Nolen wrote:

 A much shorter version using an everyo goal I just landed in master:

 http://gist.github.com/3217582

 David


That is awesome. 

-- 
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-25 Thread Brian Rowe
I think one of the strengths of clojure (over at least CL certainly) is 
it's a warm and helpful community.  Please, let's not poison that.

I think this response was not only not helpful, it was also, in some small 
way, damaging to the community.  Please don't reply to legitimate questions 
in this manor.

On Saturday, March 24, 2012 8:17:57 AM UTC-4, Luc wrote:

 I would suggest that we introduced some klingon characters in the language,
 we could then satisfy all these alien desires to change a syntax that has 
 been 
 established 4 years ago.

 We have a product driving an hospital here, your esthetic considerations 
 do not
 fit in my deployment plan. This is not a toy language anymore... That era 
 is behind
 us since Jan. 2009.

 With nearly 5 versions out since 2009, I think that we can say that the 
 language has 
 reached  some maturity at least regarding the syntax.

 Now we are in the framework selection phase to meet greater challenges and
 improving internals and platform availability.

 I suggest you clone the source code and create your custom reader version.
 Then you will be free to apply any change you may feel appropriate.

 vaj HabHa''a' je 'uSDu'lIj joj

 Luc


  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
  like (thing thing thing), #(thing thing thing), [thing thing thing],
  {thing thing thing}, and #{thing thing thing} (the file as a whole 
  be regarded as implicitly wrapped in (do ... )); then (assuming no
  unbalanced delimiters) make a second pass doing the rest of the
  reader's job. The second pass will see a {...} node with one direct
  child that is also a {...} node in, and only in, the case of the
  proposed set syntax. (It will also allow { {foo bar baz}} and
  similarly as sets.)
  
  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. (The #{...} syntax then remains
  comparatively desirable in the specific case that the set literal is
  being used as a predicate, as it's both a set and a lambda in that
  context.)
  
  -- 
  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+unsubscribe@​googlegroups.comclojure%2bunsubscr...@googlegroups.com
  For more options, visit this group at
  http://groups.google.com/​group/clojure?hl=enhttp://groups.google.com/group/clojure?hl=en
  
 --
 Softaddictslprefontaine@​softaddicts.ca lprefonta...@softaddicts.ca 
 sent by ibisMail!



-- 
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: SuperDevMode and SourceMaps for ClojureScript debugging

2012-03-22 Thread Brian Rowe
Any suggestions on how to get started on tackling that?

On Tuesday, March 20, 2012 5:05:40 PM UTC-4, David Nolen wrote:

 On Tue, Mar 20, 2012 at 2:45 PM, Alexander Zolotko azolo...@gmail.comwrote:

 Ray Cromwell https://plus.google.com/u/1/110412141990454266397/posts, 
 a Google employee, has recently announced new feature in Chrome Dev Tools: 
 SuperDevMode 
 and 
 SourceMapshttps://plus.google.com/u/1/110412141990454266397/posts/Nvr6Se6eAPh.
  It 
 helps to map source code written in programming language that targets 
 JavaScript run-time (e.g. CoffeeScript) to resulting JavaScript code. Is 
 it feasible to utilize it to debug ClojureScript in a browser? Please share 
 your thoughts.


 Yep, looks promising and we definitely want to support it. Would love to 
 see someone tackle this project.

 David 



-- 
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 One and Websockets

2012-03-18 Thread Brian Rowe
Hey Jay,

Are there any plans to make a ring adapter for webbit?
 
On Friday, March 2, 2012 6:40:27 AM UTC-5, Jay Fields wrote:

 clojure + web sockets, not using aleph: 
 http://blog.jayfields.com/2011/02/clojure-web-socket-introduction.html

 On Mar 1, 2012, at 10:51 PM, Brian Rowe wrote:

 Hi,

 I'm thinking about using clojurescript one a starting point for a web 
 game.  I would like to use websockets as the primary communication 
 mechanism between the browser and the server.  As far as I know Zack 
 Tellman's Aleph is the only clojure web server that supports websockets.  
 Is this true?  If so, are there any guides showing how to modify 
 clojurescript one to use Aleph?  If there are no guides, how much work 
 would it take to modify cljs one to use aleph?

 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 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 One and Websockets

2012-03-01 Thread Brian Rowe
Hi,

I'm thinking about using clojurescript one a starting point for a web 
game.  I would like to use websockets as the primary communication 
mechanism between the browser and the server.  As far as I know Zack 
Tellman's Aleph is the only clojure web server that supports websockets.  
Is this true?  If so, are there any guides showing how to modify 
clojurescript one to use Aleph?  If there are no guides, how much work 
would it take to modify cljs one to use aleph?

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

Writing Android Apps in Clojure

2011-05-29 Thread Brian Rowe
Hi, I've seen that one of the biggest speed bumps on the path to
delivering an Android application written in Clojure is app startup
time.

Has anyone tried writing the application's initial activity in pure
java and delegating the loading of clojure to a service?  Perhaps the
service could send a broadcast when it is finished loading. At that
point the activity could enable code paths that jump into Clojure
code.

I'm not completely familiar with how libraries get loaded and
initialized in Dalvik.  This may not even bee possible, or perhaps it
would require the service to be an out of process service.

Anyhow, I would be interested to know if anyone has tried this.

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