unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Damien Mattei <damien.mattei@gmail.com>
To: Maxime Devos <maximedevos@telenet.be>
Cc: "Linus Björnstam" <linus.bjornstam@veryfast.biz>,
	guile-user <guile-user@gnu.org>,
	guile-devel <guile-devel@gnu.org>
Subject: Re: expression and definition context in Scheme
Date: Thu, 1 Sep 2022 22:21:09 +0200	[thread overview]
Message-ID: <CADEOadeGmqwx3goq-26oZsLHpwGsdzRUP_580dkGxb6n-TyZcQ@mail.gmail.com> (raw)
In-Reply-To: <2ed55f9c-640c-2dea-007a-51407845068d@telenet.be>

On Wed, Aug 31, 2022 at 5:29 PM Maxime Devos <maximedevos@telenet.be> wrote:

>
> On 31-08-2022 09:01, Damien Mattei wrote:
> > I always try to keep compatibility with RnRS and in fact except cond
> > none of when, unless, cond, case, while, and do are in standart RnRS
> schem
>
> 'when', 'unless' and 'do' are actually RnRS, see (rnrs control).
>

oh your're right...i was sticked to R5RS ,time i was student...

>
> 'case' is also RnRS, see (rnrs base).
>
> However, looking at (guile)while do, 'while' is indeed non-standard.
>

and i had rewritten last week a 'while ... do' like in C or Pascal:
https://www.tutorialspoint.com/pascal/pascal_while_do_loop.htm
https://www.tutorialspoint.com/cprogramming/c_while_loop.htm

in my Scheme+:

;; (define do '())
;; (while {i < 4}
;;    do
;;      (display i)
;;      (newline)
;;      {i <- {i + 1}})
;; 0
;; 1
;; 2
;; 3
;; $1 = #f
(define-syntax while
  (syntax-rules (while do)
    ((_ pred do b1 ...)
     (let loop () (when pred b1 ... (loop))))))

i will have to forget it! as i want to keep compatibility with standard
Scheme also but i will rewrite all with (let () ...) instead of (begin ...)
unless it can cause some incompatibilities, for now , i do not see problems
as "who can do more can do less"......

Regards,
Damien

>
>


  reply	other threads:[~2022-09-01 20:21 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-27 16:48 expression and definition context in Scheme Damien Mattei
2022-08-27 17:00 ` Maxime Devos
2022-08-27 19:02   ` Damien Mattei
2022-08-27 19:14     ` Maxime Devos
2022-08-27 19:20     ` Maxime Devos
     [not found]       ` <CADEOadfCCLaqEvzLYUzEYhg94pqN3r9=c6LT=FmCivJsPudUzg@mail.gmail.com>
     [not found]         ` <b95df274-b727-5bb9-4657-f263a837e0f1@telenet.be>
     [not found]           ` <CADEOadfKR_u3qS5N5MwRuCRTxPjKi_wyWzgv-xJJ96e56X2meg@mail.gmail.com>
2022-08-29 10:10             ` Fwd: " Damien Mattei
2022-08-30 10:47 ` Linus Björnstam
2022-08-31  7:01   ` Damien Mattei
2022-08-31 15:29     ` Maxime Devos
2022-09-01 20:21       ` Damien Mattei [this message]
2022-09-04  8:08         ` Damien Mattei
2022-09-07 23:12   ` Aleix Conchillo Flaqué

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=CADEOadeGmqwx3goq-26oZsLHpwGsdzRUP_580dkGxb6n-TyZcQ@mail.gmail.com \
    --to=damien.mattei@gmail.com \
    --cc=guile-devel@gnu.org \
    --cc=guile-user@gnu.org \
    --cc=linus.bjornstam@veryfast.biz \
    --cc=maximedevos@telenet.be \
    /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).