2010/1/4 Tom Hicks <hickstoh...@gmail.com>:
> Comments and code review welcome

Hi Tom,

Some interesting additions. Regarding sub-sequence it might also be
written like so:

(defn subseq2
  [coll start end]
  (take (- end start) (drop start coll)))
; (subseq2 [0 1 2 3 4] 1 3)
; = (1 2)

There is a clash with core's existing subseq function which is
specifically for sorted collections. I realize you named it slightly
differently but there is little to distinguish from the name what the
difference is, which will lead me to confusing the two. There are a
few ways this could be resolved:
1) Allow core subseq to operate as you described on unsorted
collections, and as it does now on sorted collections. This would make
the signature of the function a little curly but seems reasonable.
2) Live with similar name. I can't think of anything that contrasts
subseq appropriately.
3) Core subseq renamed to subsorted or find or search - Unlikely and
undesirable.
4) Just use take and drop.

In terms of hyphenation I believe Lisp and Clojure idioms tend to
prefer hyphenating separate words, but sub is a conjunction so should
not be hyphenated (e.g.: submarine yellow-submarine).


Regards,
Tim.

-- 
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

Reply via email to