Re: Macro usage within Clojure community and naming functions which perform actions under certain conditions

2016-05-04 Thread Fluid Dynamics
What about: safe-cell? (as described) reveal-safe-cells (as existing) (defn reveal-safe-cells-if-safe-cell [gs] (if (safe-cell? gs) (reveal-safe-cells gs) gs)) and elsewhere (-> gs ... ... (reveal-safe-cells-if-safe-cell) ... ...) -- You received this message because you a

Re: Macro usage within Clojure community and naming functions which perform actions under certain conditions

2016-04-26 Thread Jason Felice
I wrote packthread to avoid needing threading counterparts of a bunch of control forms - it rewrites threading through control forms. https://github.com/maitria/packthread It doesn't (yet) solve when you need the threaded value in the middle of a threading form. I've had some thoughts about thre

Re: Macro usage within Clojure community and naming functions which perform actions under certain conditions

2016-04-26 Thread Ray Miller
On 25 April 2016 at 21:03, Rafał Cieślak wrote: > Hi, > > I'm writing a turn-based game and one of the biggest functions is the one > which handles player moves. It receives the current game state (a map) and > the index of the cell that the player clicked on (an integer). > > It has to make a co

Macro usage within Clojure community and naming functions which perform actions under certain conditions

2016-04-25 Thread Rafał Cieślak
Hi, I'm writing a turn-based game and one of the biggest functions is the one which handles player moves. It receives the current game state (a map) and the index of the cell that the player clicked on (an integer). It has to make a couple of decisions based on the game state. So far I just us

Re: Naming Functions...

2010-02-04 Thread Wardrop
Hi Michael, Thanks for the implementation suggestion. I left school 2 years only so missed out on some of the more advanced mathematics, hence I was unaware of the function and purpose of log. Since reading your post, I've done a little bit of research on log as to educate myself. I've now re-impl

Re: Naming Functions...

2010-02-04 Thread Meikel Brandmeyer
Hi, Am 04.02.2010 um 20:00 schrieb Erik Price: > What kind of naming convention is appropriate for a function that > operates on a sequence, and, as one of its return values, returns a > new head for (or in other words a subsequence within) that sequence? > For example, a function that consumes s

Re: Naming Functions...

2010-02-04 Thread Erik Price
What kind of naming convention is appropriate for a function that operates on a sequence, and, as one of its return values, returns a new head for (or in other words a subsequence within) that sequence? For example, a function that consumes some portion of a stream. Or is it not conventional for a

Re: Naming Functions...

2010-02-04 Thread Michał Marczyk
On 4 February 2010 08:04, Wardrop wrote: > (defn [n base] >  (loop [n n count 0] >    (if (< n base) >      {:val n :count count} >      (recur (float (/ n base)) (inc count) > > [ ... ] > > I mean, what the hell would you name this function, or would you not > create such an obscure and gene

Re: Naming Functions...

2010-02-04 Thread Laurent PETIT
;, "KB", "MB", "GB", > "TB). > > I mean, what the hell would you name this function, or would you not > create such an obscure and generalised function to start with? > > On Feb 4, 3:15 pm, Jonathan Smith wrote: >> A function would be named

Re: Naming Functions...

2010-02-03 Thread Michael Wood
On 4 February 2010 09:04, Wardrop wrote: > I often myself creating functions which perform a rather clear and > simple task, but which is hard to describe, either because I don't > know the term for what I've just implemented, or because the function > is difficult to summarise in a couple of word

Re: Naming Functions...

2010-02-03 Thread Wardrop
b 4, 3:15 pm, Jonathan Smith wrote: > A function would be named based on what it is that it does. > > Difficulty naming functions would imply to me that the functions > involved do not contain a clear functionality. > > The names of the functions should sort of be an 'emerge

Re: Naming Functions...

2010-02-03 Thread Jonathan Smith
A function would be named based on what it is that it does. Difficulty naming functions would imply to me that the functions involved do not contain a clear functionality. The names of the functions should sort of be an 'emergent property' of a larger process of reasoning through the p

Re: Naming Functions...

2010-02-03 Thread David Nolen
ve meaning to a method. I'm finding at the moment that I'm > spending half my time thinking of decent names for functions. I'm just > wondering what process you all use when it comes to naming functions? > > Can you give a more specific example of something that your having

Naming Functions...

2010-02-03 Thread Wardrop
7;m spending half my time thinking of decent names for functions. I'm just wondering what process you all use when it comes to naming functions? -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@g