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

Reference implementation's use of datum->syntax is not portable

This page is part of the web mail archives of SRFI 99 from before July 7th, 2015. The new archives for SRFI 99 contain all messages, not just those from before July 7th, 2015.



The R6RS Libraries 12.6 says of datum->syntax: "Template-id must be a
template identifier and datum should be a datum value."  

That does say "should", not "must", but to be portable, only a datum
value should be used, right?  The syntax object
#'define-record-type-helper in the below makes the list not be a datum
value.  This prevents the reference implementation from working in PLT
Scheme and Ikarus.

          (datum->syntax
           #'tname
           `(,#'define-record-type-helper
             ,type-name ,fields ,parent
             ,(if constructor-args
                  (list constructor-name constructor-args)
                  constructor-name)
             ,predicate-name
             ,accessor-fields ,mutator-fields)))))))


(import
  (rnrs base)
  (err5rs records syntactic))
(define-record-type A #t #t a b)


PLT's error =>

zone/scheme/err5rs/records/syntactic.sls:119:10: datum->syntax: 
expected argument of type <datum>; given
{#<syntax:/home/d/.plt-scheme/4.0.2.6/collects/err5rs/records/syntactic.sls:121:16> A #(a b) #f make-A A? {{A-a a} {A-b b}} ()}


-- 
: Derick
----------------------------------------------------------------