public inbox for kawa@sourceware.org
 help / color / mirror / Atom feed
* Using with-syntax
@ 2018-03-02 23:29 Duncan Mak
  2018-03-02 23:50 ` Per Bothner
  0 siblings, 1 reply; 3+ messages in thread
From: Duncan Mak @ 2018-03-02 23:29 UTC (permalink / raw)
  To: kawa mailing list

Hello,

I'm writing some macro code and I make use of with-syntax quite a bit.
When I load it in the REPL, it all seems to work, but when I load it
as an R7RS library module definition, I run into various issues:

1) If I run it with (import (scheme base)), I fall into a recursive
loop inside some rewrite step, and it eventually gives up.

2) If I run it with (import (scheme base) (kawa lib std_syntax)), I
seem to see something similar (http://savannah.gnu.org/bugs/?49416
says to import std_syntax).

3) If I run it with (import (kawa base)), then things seem to work,
but now I can't define my own macro named define-variable.

What's the right way to get with-syntax to work?



-- 
Duncan.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Using with-syntax
  2018-03-02 23:29 Using with-syntax Duncan Mak
@ 2018-03-02 23:50 ` Per Bothner
  2018-03-03  4:37   ` Duncan Mak
  0 siblings, 1 reply; 3+ messages in thread
From: Per Bothner @ 2018-03-02 23:50 UTC (permalink / raw)
  To: Duncan Mak, kawa mailing list

On 03/02/2018 03:28 PM, Duncan Mak wrote:
> Hello,
> 
> I'm writing some macro code and I make use of with-syntax quite a bit.
> When I load it in the REPL, it all seems to work, but when I load it
> as an R7RS library module definition, I run into various issues:
> 
> 1) If I run it with (import (scheme base)), I fall into a recursive
> loop inside some rewrite step, and it eventually gives up.

Curious.

> 2) If I run it with (import (scheme base) (kawa lib std_syntax)), I
> seem to see something similar (http://savannah.gnu.org/bugs/?49416
> says to import std_syntax).
> 
> 3) If I run it with (import (kawa base)), then things seem to work,
> but now I can't define my own macro named define-variable.

How about:

   (import (except (kawa base) define-variable))

> What's the right way to get with-syntax to work?

We should probably have a (kawa syntax-case) library.

-- 
	--Per Bothner
per@bothner.com   http://per.bothner.com/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Using with-syntax
  2018-03-02 23:50 ` Per Bothner
@ 2018-03-03  4:37   ` Duncan Mak
  0 siblings, 0 replies; 3+ messages in thread
From: Duncan Mak @ 2018-03-03  4:37 UTC (permalink / raw)
  To: Per Bothner; +Cc: kawa mailing list

(import (except (kawa base) define-variable)) worked, thanks!

I filed an Issue for (kawa syntax-case) library -
https://gitlab.com/kashell/Kawa/issues/38


Duncan.

On Fri, Mar 2, 2018 at 6:50 PM, Per Bothner <per@bothner.com> wrote:
> On 03/02/2018 03:28 PM, Duncan Mak wrote:
>>
>> Hello,
>>
>> I'm writing some macro code and I make use of with-syntax quite a bit.
>> When I load it in the REPL, it all seems to work, but when I load it
>> as an R7RS library module definition, I run into various issues:
>>
>> 1) If I run it with (import (scheme base)), I fall into a recursive
>> loop inside some rewrite step, and it eventually gives up.
>
>
> Curious.
>
>> 2) If I run it with (import (scheme base) (kawa lib std_syntax)), I
>> seem to see something similar (http://savannah.gnu.org/bugs/?49416
>> says to import std_syntax).
>>
>> 3) If I run it with (import (kawa base)), then things seem to work,
>> but now I can't define my own macro named define-variable.
>
>
> How about:
>
>   (import (except (kawa base) define-variable))
>
>> What's the right way to get with-syntax to work?
>
>
> We should probably have a (kawa syntax-case) library.
>
> --
>         --Per Bothner
> per@bothner.com   http://per.bothner.com/



-- 
Duncan.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-03-03  4:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-02 23:29 Using with-syntax Duncan Mak
2018-03-02 23:50 ` Per Bothner
2018-03-03  4:37   ` Duncan Mak

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).