guile-devel-internal
[Top][All Lists]
Advanced

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

Re: defstruct from (ice-9 match)


From: Mikael Djurfeldt
Subject: Re: defstruct from (ice-9 match)
Date: 09 Mar 2001 22:54:46 +0100
User-agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7

Keisuke Nishida <address@hidden> writes:

> At Fri, 09 Mar 2001 11:29:10 -0500,
> Mikael Djurfeldt wrote:
> > 
> > 2001-03-09  Keisuke Nishida  <address@hidden>
> > 
> >     * match.scm: export defstruct.
> > 
> > A match module should only export match-related bindings.  Are you
> > exporting defstruct because some macro expands into it?
> 
> Andrew K. Wright's pattern matcher contains a macro `define-structure',
> which expands into another macro `defstruct'.  Without these macros,
> we can't use the match syntax `($ <struct> <pat>...)'.

I suggest that we examine if we can modify the sources to use
define-record-type from SRFI-9 directly instead of using
define-structure and defstruct.

> > Also, why is the source formatted without whitespace?
> 
> The source I included is not the original source but a macro-expanded
> version (like psyntax.pp).  Since psyntax.pp is formatted without
> whitespace, I did the same.

But the source for psyntax.pp is psyntax.ss and there's a way to
"recompile" it.  (BTW, I just added a Makefile rule which does this.)

We should have the complete sources for Guile included in the
distribution.

> The original source cannot be executed by Guile because it uses
> `[...]' syntax for clause forms.  What should we do?

My suggestion:

1. Examine if define-record-type can replace all uses of
   define-structure and defstruct.

2. Include an implementation of define-record-type as a separate
   module.

3. Include the match sources in the Guile distribution.

4. Edit them according to 1 and replace [...] with (...).

5. Provide a way for the match module contents to be generated form
   the match sources, similar to psyntax.pp.



reply via email to

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