From: freakrobot on
I was a newbie to lush programming. And I can't make it work properly

I am using Fedora 12/Linux as platform. My lush version is
lush-1.2.1-6.

When I trying,

###############################################
(de harmonic (n)
((-double-) n)
(let* ((z 0) (i 0))
((-double-) z i)
(while (< i n) (incr i) (incr z (/ i)))))
= harmonic
(dhc-make "junk" harmonic)

*** Warning: Creating /home/freakrobot/C
*** Warning: Creating /home/freakrobot/C/i386-redhat-linux-gnu
Preprocessing and parsing harmonic ...
Generating C for harmonic ...
gcc -DHAVE_CONFIG_H -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions
-fstack-protector --param=ssp-buffer-size=4 -m32 -march=i686 -
mtune=atom -fasynchronous-unwind-tables -DNO_DEBUG -Wall -O3 -
march=i386 -pthread -I/usr/share/lush/include -I/usr/include/freetype2
-c /home/freakrobot/C/junk.c -o /home/freakrobot/C/i386-redhat-linux-
gnu/junk.o

**** GASP: Severe error : Signal 11 has occurred
**** GASP: Trying to recover
**** GASP: You should save your work immediatly

##################################################

I have search the Internet, I get a bug report.
http://lists.ibiblio.org/pipermail/sm-grimoire-bugs/2006-May/004254.html

It was reported long time ago. I wonder if there is a way to fix it.
Thanks a lot~
From: Tamas K Papp on
On Fri, 26 Feb 2010 21:48:57 -0800, freakrobot wrote:

> I was a newbie to lush programming. And I can't make it work properly
>
> I am using Fedora 12/Linux as platform. My lush version is lush-1.2.1-6.
>
> When I trying,
>
> ###############################################
> (de harmonic (n)
> ((-double-) n)
> (let* ((z 0) (i 0))
> ((-double-) z i)
> (while (< i n) (incr i) (incr z (/ i)))))
> = harmonic
> (dhc-make "junk" harmonic)

I can't help you with LUSH. I considered using it when I started
programming in Lisp, and decided that it is an antiquated and badly
designed Lisp dialect.

Unless you have a compelling reason to use Lush, I would recommend
that you use Common Lisp instead. It will give you a much more
advanced programming language with implementations that are actively
developed. You will go much, much further with CL.

A good introductory book to Common Lisp is Peter Seibels Practical
Common Lisp, available online at http://www.gigamonkeys.com/book/ .

By the way, this is how your function could look like in CL:

(defun harmonic (n)
(loop
for i from 1 to n
summing (/ i)))

Hope this helps,

Tamas
From: freakrobot on
Oh, thank you. I really appreciate your help.
I am just looking around and finding LUSH can be used with a lot of
tools, and it can create 2D&3D things which is interesting. But it's
really buggy. It seems that I made a really bad choice. I will come
back to CL. Thank you~

freakrobot

On 2月27日, 下午2时35分, Tamas K Papp <tkp...(a)gmail.com> wrote:
> On Fri, 26 Feb 2010 21:48:57 -0800, freakrobot wrote:
> > I was a newbie to lush programming. And I can't make it work properly
>
> > I am using Fedora 12/Linux as platform. My lush version is lush-1.2.1-6..
>
> > When I trying,
>
> > ###############################################
> >  (de harmonic (n)
> >       ((-double-) n)
> >       (let* ((z 0) (i 0))
> >         ((-double-) z i)
> >          (while (< i n) (incr i) (incr z (/ i)))))
> >         = harmonic
> >  (dhc-make "junk" harmonic)
>
> I can't help you with LUSH.  I considered using it when I started
> programming in Lisp, and decided that it is an antiquated and badly
> designed Lisp dialect.
>
> Unless you have a compelling reason to use Lush, I would recommend
> that you use Common Lisp instead.  It will give you a much more
> advanced programming language with implementations that are actively
> developed.  You will go much, much further with CL.
>
> A good introductory book to Common Lisp is Peter Seibels Practical
> Common Lisp, available online athttp://www.gigamonkeys.com/book/.
>
> By the way, this is how your function could look like in CL:
>
> (defun harmonic (n)
>   (loop
>     for i from 1 to n
>     summing (/ i)))
>
> Hope this helps,
>
> Tamas