Jim Blandy | 10 Jan 1999 01:09
Favicon

How should one specify syntax and semantics?


I like the idea of LAND*; I think I'd use a form like this often.
The syntax proposed is clean and clear.  Thank you, Oleg!

However, the specification of LAND* in the draft SRFI is perhaps not
as clear as it could be.  I think it's important that the initial
SRFI's set a high standard for future authors to follow, so I hope
Oleg will not be offended if I explain how I think draft SRFI 2 might
be improved.

The notation used to describe the LAND* syntax is unfamiliar; it
resembles BNF, but uses `cons' in a way I've never seen in any other
BNF spec.  Whenever possible, I think SRFI's should use existing,
well-defined, and widely recognized notations for describing syntax;
when that is not possible, the SRFI itself should explain the notation
used.

The notation used to describe LAND*'s semantics is also unfamiliar.

I would suggest that SRFI's should imitate R5RS as closely as
possible, when R5RS provides appropriate examples.  In the present
case, R5RS provides excellent precedents to follow.

Thus, looking at how R5RS handles `cond', I would suggest a definition
consisting of:
- syntax, specified informally, using templates with English restrictions,
- semantics, specified informally, in English, and
- for derived expression types, a macro definition using R5RS's
  define-syntax.  (Note that using R5RS macros does *not* constrain an
  implementation to provide LAND* using R5RS macros, or macros of any
(Continue reading)


Gmane