[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Lisp anime video
From: |
tomas |
Subject: |
Re: Lisp anime video |
Date: |
Sun, 29 Aug 2021 14:06:27 +0200 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On Sun, Aug 29, 2021 at 12:57:15PM +0200, Emanuel Berg via Users list for the
GNU Emacs text editor wrote:
> tomas wrote:
>
> >> ;; this file:
> >> ;; https://dataswamp.org/~incal/scheme/fac.scm
> >>
> >> (define (fac n)
> >> (if (> n 1)
> >> (* n (fac (- n 1)))
> >> 1) )
> >>
> >> (fac 10) ; 3 628 800
> >
> > That looks for me like a pretty reasonable value for (fac
> > 10). Actually, more reasonable that any other value?
>
> Yes, but I wrote that. In the video they show another piece of
> code which doesn't work in MIT/GNU Scheme what I can see.
So the difference is (1- n) vs (- n 1)? Why don't you say that,
instead of letting people find out?
Perhaps the function `1-' is just missing in "your" Scheme. You
can have it with
(def (1- n) (- n 1))
if you want :)
Note: Guile knows about `1-'.
Cheers
- t
signature.asc
Description: Digital signature
- Lisp anime video, Emanuel Berg, 2021/08/29
- Re: Lisp anime video, Emanuel Berg, 2021/08/29
- Re: Lisp anime video, Emanuel Berg, 2021/08/29
- Re: Lisp anime video, tomas, 2021/08/29
- Re: Lisp anime video, Emanuel Berg, 2021/08/29
- Re: Lisp anime video, tomas, 2021/08/29
- Re: Lisp anime video, Emanuel Berg, 2021/08/29
- Re: Lisp anime video,
tomas <=
- Re: Lisp anime video, Emanuel Berg, 2021/08/29
- Re: Lisp anime video, tomas, 2021/08/29
- Re: Lisp anime video, Emanuel Berg, 2021/08/29
- Re: Lisp anime video, Philip Kaludercic, 2021/08/29
- RE: [External] : Re: Lisp anime video, Drew Adams, 2021/08/29
- RE: [External] : Re: Lisp anime video, Drew Adams, 2021/08/29
- Re: [External] : Re: Lisp anime video, Emanuel Berg, 2021/08/30
- RE: [External] : Re: Lisp anime video, Drew Adams, 2021/08/30
- Re: [External] : Re: Lisp anime video, Philip Kaludercic, 2021/08/29
- RE: [External] : Re: Lisp anime video, Drew Adams, 2021/08/29