Hi,
Its been 19 years since I last wrote anything serious in lisp (and
that was Scheme). In the intervening time I've mostly used OO
languages, for lack of more practical functional ones. There are now
a number of functional or hybrid functional languages available which
have become practical.
Thanks
The use of (int ...) works, avoiding the dispatch, but it has to be
used everywhere there is a variable or literal. Starts getting very
ugly and unreadable as expressions get longer.Is there any way to
indicate an "int" or "double" literal short of (int 2). Here is the
modified func
It looks like the new (deftype ..) may be what I am looking for in
terms of binding heterogenous state efficiently. The matrix function
was just a test case for how to bind state efficiently. Thanks for
all of the responses.
On Mar 8, 2:57 pm, Jonathan Shore wrote:
> Hi,
>
> I'm still trying
Hmm, is there a notation to express an int literal. Better yet,
clojure should try to infer that if I do (+ v 2) where v was hinted to
be "int", 2 should be considered to be an int. The code starts
getting really messy:
(defn fib [a]
(let [v (int a)]
(if (< v (int 2))