A Clojure REPL that works on iPhone and iPad platforms. Will the wonders of web application delivery never cease? :)
Does it? I couldn't get it to execute anything on my iPhone. Or delete anything I'd written for that matter. (Not knocking it. A lot of things don't work quite right on touch-only platforms. Try Haskell doesn't work either IIRC. Just a matter of testing and debugging I'm sure.)
Try Clojure
61–63 of 63 posts
Re: Try Clojure
#62Earlier quoted context omitted.
Are you familiar with python? Perhaps this will help: if cnd: return do_big_stuff else: return do_other_big_stuff has different semantics than a hypothetical "if" function call: def a(): return do_big_stuff def b(): return do_other_big_stuff return if(cnd,a(),b()) Note here, both "do_big_stuff" and "do_other_big_stuff" are evaluated, regardless of the value of "cond". A short-circuiting if (only possible if "if" is a…
Yeah okay I got it. I think the funcall/lambda stuff got me confused, it's kind of obvious in hindsight. In which case I agree it's a matter of taste. I guess I just like the taste of Factor/REBOL always passing blocks to if, having to say t [ 0 ] [ 3 ] if instead of simply say t 0 3 if is the trade off I suppose[1]. I'm guessing it works for picolisp because it's purely interpreted? because it certainly doesn't seem…
Re: Try Clojure
#63This isn't really a Clojure specific question but is there any benefit to making 'if' a special form? Meaning you can't do: (map if [true false true] [1 1 1] [2 2 2]) not that I can think of any reason why you'd want to do that (specifically) but Picolisp, Factor, REBOL and I'm sure a couple other languages implement if as a normal function. To take an example from some edition of programming clojure: (defmacro unles…
(if (zero? x)
0
#(dec x))
To me, this seems a rather counter-intuitive step with very little benefit. People rarely need to use "if" as a function, so having "if" as a macro optimizes for the common case.