nasser / nostrand

Clojure on Mono

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Allow multi-line input

LispEngineer opened this issue · comments

I can't put this input into nos repl without getting errors:

(defn xorshift64*
  "Implements the raw xorshift64* random algorithm. Takes the seed/state and returns the
   next 'random' number and the new seed. Since Clojure doesn't have unsigned 64-bit
   integers, but does have 64-bit signed integers, the seed and the result may be
   negative. These numbers can be made positive (and equivalent to the C algorithm's
   output) by converting to BigInt and adding 2^64. Input seed/state should may not be zero.
   See: https://en.wikipedia.org/wiki/Xorshift"
  [x]
  (let [a (bit-xor x (unsigned-bit-shift-right x 12))
        b (bit-xor a (bit-shift-left a 25))
        c (bit-xor b (unsigned-bit-shift-right b 27))
        ;; unchecked prevents math overflow
        r (unchecked-multiply c 2685821657736338717)]
    [r c]))

It works fine from JVM repl (e.g. java -jar clojure-1.7.0.jar).