unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: "Linus Björnstam" <linus@fastmail.se>
To: Arne Babenhauserheide <arne_bab@web.de>, guile-devel@gnu.org
Subject: Re: GNU Guile 3.0.0 released
Date: Sun, 19 Jan 2020 13:03:17 +0100	[thread overview]
Message-ID: <85f37019-73d2-c305-65d1-4be80d564805@fastmail.se> (raw)
In-Reply-To: <87o8v32ifj.fsf@web.de>

On 2020-01-16 22:35, Arne Babenhauserheide wrote:

> Can we get this into the Scheme standard, too?

If you want a portable implementation, you can actually hack it using 
macros. Re-define lambda, define, let(*,-values,letrec,letrec*) and 
begin to rewrite everything to letrec and you are done! The problem is 
that it will be slower than using let* for the bindings that don't 
require letrec in many schemes, since the don't do the equivilent of 
guile's letrectification pass (described in the paper "Letrec done right 
(reloaded)" iirc).


I have a syntax-rules implementation of it if you are interested, that 
also supports a simplified define-like binding that converts to let*. 
That one does _not_ convert the body to one letrec, only defines 
following eachother.

so

(define a 1)

(when (even? a) (error "ERROR"))

(define b 2)

becomes

(letrec ((a ...))
   (when (even? a) (error "ERROR"))
     (letrec ((b 2))
       ...)

This is not compatible with guile, but is trivial to fix!

Trivially portable to any other scheme, since it uses no fancy features 
except the usual module things:

https://hg.sr.ht/~bjoli/guile-define/




  parent reply	other threads:[~2020-01-19 12:03 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-16 11:01 GNU Guile 3.0.0 released Andy Wingo
2020-01-16 17:56 ` Stefan Israelsson Tampe
2020-01-16 20:26   ` Stefan Israelsson Tampe
2020-01-16 20:46 ` Taylan Kammer
2020-01-18 13:54 ` Ludovic Courtès
     [not found] ` <87o8v32ifj.fsf@web.de>
2020-01-19 12:03   ` Linus Björnstam [this message]
2020-01-19 12:07   ` Linus Björnstam
2020-01-21 22:26 ` Stefan Israelsson Tampe
2020-01-21 23:06   ` Arne Babenhauserheide
2020-01-27 19:38 ` Stefan Israelsson Tampe

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=85f37019-73d2-c305-65d1-4be80d564805@fastmail.se \
    --to=linus@fastmail.se \
    --cc=arne_bab@web.de \
    --cc=guile-devel@gnu.org \
    /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).