Reference implementation's use of datum->syntax is not portable
Derick Eddington 12 Aug 2008 07:39 UTC
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
----------------------------------------------------------------