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
I would do as you do, finding a name, hopefully good enough to prevent an imperative need to jump to the function definition when re-reading the code 6 months later. Anyway, would you have written this particular function as a method of a class, would the problem of giving it a "short but meaningf

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
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 words. As an example, I've just created a function whi

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 programming

Re: Naming Functions...

2010-02-03 Thread David Nolen
On Wed, Feb 3, 2010 at 10:47 PM, Wardrop wrote: > I've always struggled when it comes to defining good names for > functions and methods. Now that I'm learning Clojure, function naming > becomes even more imperative, as you don't have classes and objects to > help give meaning to a method. I'm fi