From: Richard Todd <richardt@vzavenue.net>
Subject: keyword cleanup patch
Date: Thu, 8 Jan 2004 06:25:18 -0600 [thread overview]
Message-ID: <20040108122518.GA19086@pazuzu> (raw)
[-- Attachment #1.1.1: Type: text/plain, Size: 1138 bytes --]
Something about my state of mind made me unhappy with the way one can
use either #:xxx or :xxxx in for modules, so (I'll probably regret
this later!) I dropped that feature in my local copy of guile.
Why are both syntaxes allowed in this one area, anyway? I assume it's
a historical reason? It's inconsistent with the rest of guile (AFAIK)
where you have to set a reader option for this behavior.
Anyway, while I doubt you'd be interested in _that_ patch, there are
two options that I thought I'd mention:
A.) As a result of the change, (you can imagine), I had to
standardize all the guile-core code on #: in my local tree. Having
all the code match is kind of nice, even if you allow both syntaxes.
....and/or....
B) I did stumble across a bug-fix and a cleanup that I thought you
might want to apply. They are in the attached patch, and are:
1) ice-9/mapping.scm needed changes, since it has several keywords of
the form :xxx in it. Maybe everyone that uses it also uses the reader
'prefix option.
2) A goops error message about missing keywords writes them as :xxx
instead of #:xxx. Not a big deal, but...
Richard Todd
[-- Attachment #1.1.2: small.patch --]
[-- Type: text/plain, Size: 2156 bytes --]
Index: ice-9/mapping.scm
===================================================================
RCS file: /cvsroot/guile/guile/guile-core/ice-9/mapping.scm,v
retrieving revision 1.7
diff -u -r1.7 mapping.scm
--- ice-9/mapping.scm 5 Apr 2003 19:04:27 -0000 1.7
+++ ice-9/mapping.scm 8 Jan 2004 11:30:41 -0000
@@ -102,8 +102,8 @@
(define (hash-table-mapping . options)
(let* ((size (or (and options (number? (car options)) (car options))
71))
- (hash-proc (or (kw-arg-ref options :hash-proc) hash))
- (assoc-proc (or (kw-arg-ref options :assoc-proc)
+ (hash-proc (or (kw-arg-ref options #:hash-proc) hash))
+ (assoc-proc (or (kw-arg-ref options #:assoc-proc)
(cond
((eq? hash-proc hash) assoc)
((eq? hash-proc hashv) assv)
@@ -111,7 +111,7 @@
(else (error 'hash-table-mapping
"Hash-procedure specified with no known assoc function."
hash-proc)))))
- (delete-proc (or (kw-arg-ref options :delete-proc)
+ (delete-proc (or (kw-arg-ref options #:delete-proc)
(cond
((eq? hash-proc hash) delete!)
((eq? hash-proc hashv) delv!)
@@ -119,7 +119,7 @@
(else (error 'hash-table-mapping
"Hash-procedure specified with no known delete function."
hash-proc)))))
- (table-constructor (or (kw-arg-ref options :table-constructor)
+ (table-constructor (or (kw-arg-ref options #:table-constructor)
(lambda (len) (make-vector len '())))))
(make-hash-table-mapping (table-constructor size)
hash-proc
Index: oop/goops.scm
===================================================================
RCS file: /cvsroot/guile/guile/guile-core/oop/goops.scm,v
retrieving revision 1.36
diff -u -r1.36 goops.scm
--- oop/goops.scm 20 Apr 2003 17:35:41 -0000 1.36
+++ oop/goops.scm 8 Jan 2004 11:30:42 -0000
@@ -1431,7 +1431,7 @@
(set (get-keyword #:slot-set! (slot-definition-options s) #f))
(env (class-environment class)))
(if (not (and get set))
- (goops-error "You must supply a :slot-ref and a :slot-set! in ~S"
+ (goops-error "You must supply a #:slot-ref and a #:slot-set! in ~S"
s))
(list get set)))
(else (next-method))))
[-- Attachment #1.2: Type: application/pgp-signature, Size: 189 bytes --]
[-- Attachment #2: Type: text/plain, Size: 142 bytes --]
_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel
next reply other threads:[~2004-01-08 12:25 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-01-08 12:25 Richard Todd [this message]
2004-01-10 12:48 ` keyword cleanup patch Neil Jerram
2004-01-12 17:31 ` Marius Vollmer
2004-01-10 16:18 ` Stephen Compall
2004-01-11 0:53 ` Richard Todd
2004-01-12 16:59 ` Marius Vollmer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20040108122518.GA19086@pazuzu \
--to=richardt@vzavenue.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).