[Top][All Lists]

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

Re: [bootstrappable] Re: Can Guile be bootstrapped from source without p

From: Michael Schierl
Subject: Re: [bootstrappable] Re: Can Guile be bootstrapped from source without psyntax-pp.scm?
Date: Sun, 14 Mar 2021 15:18:13 +0100
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv: Gecko/20090812 Thunderbird/ Mnenhy/

Hello Jan,

Am 14.03.2021 um 14:57 schrieb Jan Nieuwenhuizen:
Michael Schierl writes:


For the record, I have written a psyntax implementation that can be used
by Guile (3.0.2) and does not require an expanded version of itself.

Oh, that's amazing!  I see that you are using make-syntax-transformer
(and others) which GNU Mes does not support yet; it only has
define-macro.  This may be a good reason/opportunity to work towards
better Guile support in Mes.

In fact, I use make-syntax-transformer only because Guile does not have
native define-macro support (it uses psyntax to emulate it).

When there is native define-macro support, you can replace step1.scm by

(define s1*-define-macro define-macro)

(define-macro (s1*-expand-with-side-effects seff1 body seff2)
  (list '(lambda (a b . c) (apply values b))
        (list 'call-with-values (list 'lambda '() body)
              '(lambda rest rest))

which will make the bootstrap even shorter.

Probably you should validate whether the evaluation order is right so
that s1*-expand-with-side-effects will really expand the side effect 1
before the body and side effect 2 after the body (there is an example in
psyntax-bootstrapping.scm line 76 which should display 1 2 3 and return 42).

You can skip step 2 as well, as you already have a quasiquote expander
that does not rely on psyntex.

The further steps up to step 7 will not use make-syntax-transformer, it
will come back in step 8 (patched psyntax.scm). But probably for step 8
you would have to patch your own psyntax.scm instead of patching guile's
version anyway.



reply via email to

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