This is the mail archive of the kawa@sourceware.org mailing list for the Kawa project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
In a macro expanding to a define-simple-class, if a field init: form references a macro argument, then that field's allocation: expression will result in an error like the one in the subject line.
(define-syntax define-documented-class (syntax-rules () ((define-documented-class name supers docstr rest ...) (define-simple-class name supers (docstring ::String allocation: 'static init: docstr) rest ...))))
(define-documented-class vec2d () "A 2D vector." (x ::double) (y ::double))
(format #t "~A~%" vec2d:docstring)
gnu.text.SyntaxException:
/tmp/test1.scm:8:1: unknown allocation kind '#<syntax (quote static) in #8>'
at kawa.Shell.run(Shell.java:257)
at kawa.Shell.runFile(Shell.java:489)
at kawa.Shell.runFileOrClass(Shell.java:427)
at kawa.repl.processArgs(repl.java:216)
at kawa.repl.main(repl.java:831)
(define-syntax define-documented-class (syntax-rules () ((define-documented-class name supers docstr rest ...) (define-simple-class name supers (docstring ::String allocation: 'static init: "literal") rest ...))))
(define-documented-class vec2d () "A 2D vector." (x ::double) (y ::double))
(format #t "~A~%" vec2d:docstring)
literal
I'm not really sure why that makes a difference, but the attached patch fixes it:
Index: kawa/standard/object.java =================================================================== --- kawa/standard/object.java (revision 7059) +++ kawa/standard/object.java (working copy) @@ -188,6 +188,8 @@ nKeywords++; pair = (Pair) args; Object value = pair.getCar(); + while (value instanceof SyntaxForm) + value = ((SyntaxForm)value).getDatum(); args = pair.getCdr(); if (key == coloncolon || key == typeKeyword) typePair = pair;
A 2D vector.
-- Jamison Hope The PTR Group www.theptrgroup.com
Attachment:
object.patch
Description: Binary data
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |