Yiming Li - 2015-06-18

Hi,

I am currently going through the tutorial of Lush (http://lush.sourceforge.net/lush-manual/tutorial.html) and ran into a weird bug where I cannot define the type(s) of variable(s).

I would use the harmonic function in Section 1.9 of the tutorial as an example. I am using Lush 2.0.1 on Ubuntu 12.04.5.

First I defined the function as in the tutorial --

    (de harmonic (n)
            ((-double-) n)
            (let* ((z 0) (i 0))
             ((-double-) z i)
              (while (< i n) (incr i) (incr z (/ i)))))

But when I tried to compute the 100-th harmonic sum by (harmonic 100), the error message --

    *** -double- : not a function (nil) : -double-

was returned.

When I defined the function without declaring the types, everything is normal. But obviously I need to declare when writing compilable versions of the functions in the future, which are far more efficient...

I must be missing something here. Is this due to the syntax difference between Lush (the tutorial is for?) and Lush2? Or do you think there was something wrong with my installation?

I am pretty new to this and sorry if my problem is actually trivial. I would be happy to provide any further information needed for your judgement.

Thank you in advance, and looking forward to your reply!

Elizabeth