Opened 7 years ago

Closed 5 years ago

#39 closed defect (fixed)

syntax-error

Reported by: cowan Owned by: alexshinn
Priority: major Milestone:
Component: WG1 - Macros Keywords:
Cc:

Description

Should we have syntax-error parallel to SRFI-23 error? This is evoked when macros are expanded.

There is a definition in JRM's Syntax-Rules Primer using syntax-rules, but it relies on the syntax-rules implementation reporting an unmatchable pattern with a complaint that includes the pattern.

Change History (9)

comment:1 Changed 7 years ago by arcfide

There's an issue here that no one has brought up. In order for the SYNTAX-ERROR binding to be invoked and evaluated at macro time, it would have to be a macro. This causes a problem if we also want to support later macro systems that allow for arbitrary code evaluation. If a syntax error is desired when the code is being evaluated at macro time, then it can't be a syntax, as it will evaluate and signal the error even when it should not. This necessitates two forms, one syntactic and one procedural. Is this a good thing?

comment:2 Changed 7 years ago by cowan

SYNTAX-ERROR is intended to be invoked only from syntax-rules macros. Procedural macros should invoke ERROR (or some lower-level equivalent), and the system would intercept this and report a syntax error, since it is known when we are running macro code and when we are not.

comment:3 Changed 7 years ago by kumoyuki

All of the syntax-rules implementations that i have used report syntax errors, if not exactly as described in the ticket, so i don't see why we are multiplying entities here

comment:4 Changed 7 years ago by cowan

  • Resolution set to fixed
  • Status changed from new to closed

The WG voted to accept syntax-error as part of the core.

comment:5 Changed 7 years ago by alexshinn

  • Resolution fixed deleted
  • Status changed from closed to reopened

comment:6 Changed 7 years ago by alexshinn

  • Owner alexshinn deleted
  • Status changed from reopened to assigned

comment:7 Changed 7 years ago by alexshinn

  • Status changed from assigned to decided

comment:8 Changed 6 years ago by alexshinn

  • Owner set to alexshinn
  • Status changed from decided to writing

comment:9 Changed 5 years ago by cowan

  • Resolution set to fixed
  • Status changed from writing to closed
Note: See TracTickets for help on using tickets.