unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Chusslove Illich <caslav.ilic@gmx.net>
Subject: Re: stack overflow problem
Date: Sun, 5 Feb 2006 00:03:25 +0100	[thread overview]
Message-ID: <200602050003.31442.caslav.ilic@gmx.net> (raw)
In-Reply-To: <87slqzl7hv.fsf@www.williamxu.com>


[-- Attachment #1.1: Type: text/plain, Size: 594 bytes --]

> [: William Xu :]
> Might be a bug? (i also tested this on mzscheme, and works fine.)
>
> Guile version: 1.6.7, debian unstable.

Same Debian, same Guile, same effect. I guess stack has to go at one point 
or another, and it is anyway a better idea to use tail recursion:

(define (enumerate-interval low high)
  (letrec ((helper
             (lambda (low high seq)
                     (if (> low high)
                         seq
                         (helper low (1- high) (cons high seq))))))
    (helper low high '())))

-- 
Chusslove Illich (Часлав Илић)

[-- Attachment #1.2: Type: application/pgp-signature, Size: 189 bytes --]

[-- Attachment #2: Type: text/plain, Size: 140 bytes --]

_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-user

  reply	other threads:[~2006-02-04 23:03 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-04 10:54 stack overflow problem William Xu
2006-02-04 23:03 ` Chusslove Illich [this message]
2006-02-05  1:18 ` Stephen Compall
2006-02-05 14:08   ` William Xu
2006-02-13 18:08     ` Holger Blasum
  -- strict thread matches above, loose matches on Subject: below --
2006-02-04 17:09 William Xu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200602050003.31442.caslav.ilic@gmx.net \
    --to=caslav.ilic@gmx.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).