This is the mail archive of the kawa@sources.redhat.com 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]

define-syntax code generation bug?


Hi,

trying to find a replacement for brl-sql-syntax, I came across the following possible bug.
I apologize in advance in case I failed to see something in my code or reasoning and am eager to learn about R5RS syntactic macros.

(define-syntax jch-sql-repeat2
  (syntax-rules ()
   ((jch-sql-repeat2 stmt formals (query-string) body-expr ...)
    (let ((l (sql-statement-results stmt query-string)))
      ;;(write (list 'formals 'body-expr l))(newline)
      (for-each (lambda formals body-expr ...) l)
      (length l)
      ))
))

(jch-sql-repeat2 st xs ("SELECT * FROM consistency")
  (write xs)(newline))
-- works

(jch-sql-repeat2 st (x y z t) ("SELECT * FROM consistency")
  (write x)(newline))
java.lang.VerifyError: (class: atInteractiveLevel, method: apply signature: (Lgnu/mapping/CallContext;)V) Register 4 contains wrong type
	at java.lang.Class.getDeclaredFields0(Native Method)
	at java.lang.Class.privateGetDeclaredFields(Unknown Source)
	at java.lang.Class.getDeclaredField(Unknown Source)
	at gnu.expr.ModuleExp.evalToClass(ModuleExp.java:116)
	at gnu.expr.ModuleExp.evalModule(ModuleExp.java:166)

(jch-sql-repeat2 st (x) ("SELECT cri FROM consistency")
  (write x)(newline))
<stdin>:1012:2: warning - too few args for %proc
-- yet produces result

Results are unchanged when I introduce an extra clause for (formals ...).

Using Kawa-1.7 with jdk-1.4.2_02 on MS-windows 2.k.

Regards,
	Jorg Hohle.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]