guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: GNU Guile 3.0.0 released


From: Linus Björnstam
Subject: Re: GNU Guile 3.0.0 released
Date: Sun, 19 Jan 2020 13:03:17 +0100
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:68.0) Gecko/20100101 Thunderbird/68.4.1

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/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]