[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Consider a different define-record-type syntax
- To: srfi-99@xxxxxxxxxxxxxxxxx
- Subject: Consider a different define-record-type syntax
- From: Derick Eddington <derick.eddington@xxxxxxxxx>
- Date: Mon, 11 Aug 2008 00:07:17 -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=K4M/kEKDrW91VyYeLQlmiCrJ3kZDWyT1h2TJ93khhLQ=; b=ZYXDycrqGr84LUo3TWargLcXwVZNO2eIYCPGEsg5UarBE/S5tsuQsZu0QMm9/P1DGZ 4jCYaYjuAVrTeJCIJro4I8SIMtpaLL2dAS2G1NI3mbRHFrrivaiqP5bftztrR2buYaCx msRE3CuqlBYBH5HsTirtd5KvUCtgbbnTQdr0s=
- 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=LswUYX61acU4w2KGMRDfJqas1+6TxXnPQpRIALvTaCKgohPfZSb+IToW7bsz042iAt 3zopjSJfy9i3aNuySnC4ttj1bR0V0U2H7fG5mUFPYmw8A51pnnEPI6OwjdTldSSDMQea HZMssbs40Vk1n8KoKs8/HXakohwqb8eNjKf5I=
It is inconsistent that define-record-type provides succinct <field
spec> which automatically make names for the accessor and mutator but it
requires (annoyingly, not succinctly) using, and remembering to use, #t
#t to get it to automatically make names for the constructor and
predicate. I imagine it's like that to be compatible with SRFI-9, but
how important is that compatibility, i.e., how much will that
compatibility be used into the longer-term future? I'd much rather have
define-record-type's syntax be:
<record type definition>
-> (define-record-type <type spec>
<field spec> ...)
<type spec> -> <type name>
-> (<type name> <parent>)
-> (<type name> <parent> <constructor spec> <predicate spec>)
The first two <type spec> do automatic naming for the constructor and
predicate. The last uses <constructor spec> and <predicate spec> the
same as the current draft describes.
--
: Derick
----------------------------------------------------------------