Helping out

18 views
Skip to first unread message

Antony Lee

unread,
May 5, 2012, 3:45:27 AM5/5/12
to clojure...@googlegroups.com
Hi,
I just discovered the project and I love it :-)
I started looking into untranslated.clj and found out that there were quite a few functions that, apparently, just needed to be lifted into core.clj and would work "as-is", e.g. max-key and min-key... am I missing something?
Also, I wrote a Python version of rand, which would also bring rand-int in.  I can set up a proper clone on github etc etc but since it's so short...

(require 'random)
(defn rand
  "Returns a random floating point number between 0 (inclusive) and
  n (default 1) (exclusive)."
  {:added "1.0"
   :static true}
  ([] (random/random))
  ([n] (* n (rand))))

The only thing that I found a bit bad is that core.clj apparently mixes tabs and spaces and that's really awful :-)

Anyways, I'll be happy to participate in the project!
Antony

Antony Lee

unread,
May 5, 2012, 4:07:53 AM5/5/12
to clojure...@googlegroups.com
Ijust had a look at subs, and this raises another question: should functions defined in core.clj adhere strictly to JVM-clojure behaviour, or is it allowed to "extend" the behaviour in a pythonic way?  I'm thinking about (subs "abc" 1 -1), which raises an exception in JVM-clojure but should "naturally" be translated into "abc"[1:-1] (== "b") in Python.  I'm ONLY talking about avoiding exceptions, i.e. a function call that was going to raise an exception returning instead whatever a Python programmer would have expected it to return.
Antony

2012/5/5 Antony Lee <anntz...@gmail.com>
Reply all
Reply to author
Forward
0 new messages