unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Ken Anderson <kanderson@bbn.com>
Cc: Timothy Hickey <timhickey@mac.com>
Subject: Re: macro like "my" in Perl
Date: Tue, 02 Jul 2002 11:34:53 -0400	[thread overview]
Message-ID: <5.0.2.1.2.20020626211956.00afd020@zima.bbn.com> (raw)
In-Reply-To: <02062609450009.13022@locke.free-expression.org>

At 10:45 AM 6/26/2002, Lynn Winebarger wrote:
>On Wednesday 26 June 2002 08:15, Ken Anderson wrote:
> > In Jscheme, not guile, i recently redefined (define) so that groups of
> > internal defines are turned into let* or letrec as appropriate, so you can
> > write code without additional indenting:
>
>How do you handle
>(let ()
>    (define (even? x) (if (= x 0) #t (not (odd? (- x 1)))))
>    (define foo (even? 7))
>    (define (odd? x) (if (= x 1) #t (not (even? (- x 1))))))
Rather than let, say define.
(define (?)
    ...)

This would be converted into
   (letrec ((even? (lambda (x) (if (= x 0) #t (not (odd? (- x 1)))))))
     (let* ((foo (even? 7)))
       (letrec ((odd? (lambda (x)
                        (if (= x 1) #t (not (even? (- x 1)))))))))))


Procedures that refer to each other should be declared in a group, as is 
usually done with letrec.


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


  reply	other threads:[~2002-07-02 15:34 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-06-25 22:19 macro like "my" in Perl Paul Jarc
2002-06-25 23:16 ` Robert Uhl <ruhl@4dv.net>
2002-06-26  2:25 ` Alex Shinn
2002-06-26 13:15   ` Ken Anderson
2002-06-26 14:45     ` Lynn Winebarger
2002-07-02 15:34       ` Ken Anderson [this message]
2002-06-26 14:44   ` Lynn Winebarger
2002-06-27  1:28     ` Alex Shinn
2002-07-12 20:43 ` Paul Jarc
2002-07-13  0:09   ` Neil Jerram
2002-07-13 20:48     ` Paul Jarc
2002-07-16 20:49       ` Neil Jerram
2002-07-16 21:05         ` Paul Jarc

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=5.0.2.1.2.20020626211956.00afd020@zima.bbn.com \
    --to=kanderson@bbn.com \
    --cc=timhickey@mac.com \
    /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).