From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Damien Mattei Newsgroups: gmane.lisp.guile.user,gmane.lisp.guile.devel Subject: Re: expression and definition context in Scheme Date: Sun, 4 Sep 2022 10:08:24 +0200 Message-ID: References: <2ed55f9c-640c-2dea-007a-51407845068d@telenet.be> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28398"; mail-complaints-to="usenet@ciao.gmane.io" Cc: =?UTF-8?Q?Linus_Bj=C3=B6rnstam?= , guile-user , guile-devel To: Maxime Devos Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Sun Sep 04 10:09:54 2022 Return-path: Envelope-to: guile-user@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oUkhV-0007C0-Ue for guile-user@m.gmane-mx.org; Sun, 04 Sep 2022 10:09:53 +0200 Original-Received: from localhost ([::1]:54802 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oUkhU-00076V-AX for guile-user@m.gmane-mx.org; Sun, 04 Sep 2022 04:09:52 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55080) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oUkgL-000763-00; Sun, 04 Sep 2022 04:08:41 -0400 Original-Received: from mail-lj1-x234.google.com ([2a00:1450:4864:20::234]:34451) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oUkgI-0000AP-Oc; Sun, 04 Sep 2022 04:08:40 -0400 Original-Received: by mail-lj1-x234.google.com with SMTP id z23so6391302ljk.1; Sun, 04 Sep 2022 01:08:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=ru8Vnba+9nOGfs2or7sgA3HDUiT0ha0qFsc2c+tNd9w=; b=EyUao0+kSVYT5ls4ZmZ7XaxLb8wtC2ldoJ/vNavtp0Z4XjbFSc5YcDufSGL61vfuXw vsreEJ0ZSCcur2sni/nJoAwvUwmg67DQw4bTVEPGTO66T98Im4hxRb405deFHLfq8aUK rfxy7nYbsC7aNxXQ0dKcPbnvsCnZT5EJdSH7yHAlEMhF4knWXnRSkf2WR6VuAHN5j8ou KuPI3BHENOwTAIM7eaywxgDQlEVZLCLnRf+fvOInQkNYkmOCuLYz8OqSLaAdMNTEvvsT +2CTGm8vNaJogl1PWTbO1fAXPP15I/fAion2sR3woMHQNxF6ytoK6KyPs0iSd/RXVf0C qLwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=ru8Vnba+9nOGfs2or7sgA3HDUiT0ha0qFsc2c+tNd9w=; b=MQcsdLXjuz30w15B8qZ0fvNOeXYFFMYw5yd43UdU/F6ghbPgAV7KsSd3BP62rI980/ rQaGbpBTp/93KyUxLmliQyKugFkijxFrQ20MaYoiFi41d4CUH3UcH9y8hQ31Mt1P32ik 5UcJ4l4SfbIGvCGZiAzrxxyiTkpFUKkic5ByjfLpg+Qyc+Aiitnmy8d1BsckxUA0Ypi/ /k7SX9fVUj3WTdr1DmjA9/kOrOHE+1uNTN8ZiqdS2aikJ3RIYGzYQfrcxQzo4bGonrmc zf0himukiw3ZFuWr84kP46kH7BiEjtR8Vx2DBStFLZlm7ioL3krDVHBYtFhS3AJRKk4Z +V/Q== X-Gm-Message-State: ACgBeo2A1CBaNYcl6F3uaSDjzKGtuClcAK4FmZy3ZbQbttx+7YqeP67b K604AqDrMCJpk/uQ0KN8nMq/RHZm2i/559ryzbQ= X-Google-Smtp-Source: AA6agR6CcvVsQZ/Gg7+RSbKUtFUxia42QF4Fffe+iHxYL8xTzqeudmG5mh3me6eNJ66KwWUjPMwTkkhx3KZcBuoCEUY= X-Received: by 2002:a05:651c:10d4:b0:265:5f3b:a9a0 with SMTP id l20-20020a05651c10d400b002655f3ba9a0mr8482189ljn.229.1662278915421; Sun, 04 Sep 2022 01:08:35 -0700 (PDT) In-Reply-To: Received-SPF: pass client-ip=2a00:1450:4864:20::234; envelope-from=damien.mattei@gmail.com; helo=mail-lj1-x234.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.io gmane.lisp.guile.user:18560 gmane.lisp.guile.devel:21341 Archived-At: i finalize my ideas about 'controls' and loops (with break and continue, as while feature them ,even if scheme and macro do not allow ? (if someone else have idea and solution about it?) implements of 'continue and 'break because hygiene forbid it) https://github.com/damien-mattei/library-FunctProg/blob/master/while-do-when-unless.scm ;; scheme@(guile-user)> (for/break-cont break continue ({i <+ 0} {i < 5} {i <- {i + 1}}) {x <+ 7} (display x) (newline)) ;; 7 ;; 7 ;; 7 ;; 7 ;; 7 ;; scheme@(guile-user)> (for/break-cont break continue ({i <+ 0} {i < 5} {i <- {i + 1}}) {x <+ 7} (display x) (newline) (break)) ;;7 ;; scheme@(guile-user)> (for/break-cont break continue ({i <+ 0} {i < 5} {i <- {i + 1}}) {x <+ 7} (continue) (display x) (newline) (break)) (define-syntax for/break-cont (syntax-rules () ((_ (init test incrmt) b1 ...) (call/cc (lambda () (let () init (let loop () (when test (call/cc (lambda () b1 ...)) incrmt (loop))))))))) https://github.com/damien-mattei/library-FunctProg/blob/master/for-next-step.scm Damien On Thu, Sep 1, 2022 at 10:21 PM Damien Mattei wrote: > On Wed, Aug 31, 2022 at 5:29 PM Maxime Devos > 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 > >> >>