[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Reference implementation's use of datum->syntax is not portable
- To: srfi-99@xxxxxxxxxxxxxxxxx
- Subject: Reference implementation's use of datum->syntax is not portable
- From: Derick Eddington <derick.eddington@xxxxxxxxx>
- Date: Tue, 12 Aug 2008 00:39:45 -0700
- Delivered-to: srfi-99@xxxxxxxxxxxxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:subject:from:to:content-type :date:message-id:mime-version:x-mailer:content-transfer-encoding; bh=SsEAOmAaQhLYRx2duB0M/ydlP2/OpvwuVE9zS3NtV3I=; b=AiV94tcrbk/aeSV6mLr7Ex6KaxYYt4FY5HPsEiT9unu7jToP90qcQK0I2HIsmHbab9 YWA7TtslJDON+3DMPNSJ6MZRyxpcjrRe6mjwbDsW7kLBWLPiJR/KkwERygGmNSKL9Dbt eOAMTdlW7TqTTX/GrilFBFgxEAP6A4LtXSo9g=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:from:to:content-type:date:message-id:mime-version:x-mailer :content-transfer-encoding; b=UmgWXZpcZYoGffdmStnYcJJ62vZ1LdD0JKmFItI5vuLLlJ84KYwk8qCe7fChQKr6Ip LEVJrqkttO5nNMXMZRo+1xjWCb/EPHBdamDzHTJQ/3fTf6em58KEbWmk/EPLgK3QAIOs dSC6c+XZs+ahDsuRoCgi7Vt4vnM6vaNenmWzs=
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
----------------------------------------------------------------