kawa-commonlisp-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Kawa-commonlisp-dev] [PATCH] DECLARE processing.


From: Charles Turner
Subject: [Kawa-commonlisp-dev] [PATCH] DECLARE processing.
Date: Tue, 14 Aug 2012 13:47:59 +0100

This isn't exactly what it looks like in my repository, there it has
been modified to deal with proper CL symbols, but I intend to send a
separate series of patches dealing with symbol issues.

The only part of this patch I'm not confident about is the new hook I
provided in Translator, rewriteAndMakeBody. The Lisp2Compilation in my
repository copies most of the rewrite_body method from Translator,
this was the best I could think of to reduce duplication. I worry it
might be a tad niche to provide a hook for.

Also, "proper" type syntax is not yet supported (it is in my
repository). I'll do this in a separate patch. For now, you must
specify types using the angle-bracket syntax.

I tried getting some test cases together, but one thing I found
annoying about RunTestScript is how it operates line-by-line in error
stream. So I'd like to write a test like

(defun test (x)
  (declare (<symbol> x))
  (list x))
(test 10)
;; Output: Invalid parameter, was: gnu.math.IntNum cannot be cast to
gnu.mapping.Symbol
;; Diagnostic: java.lang.ClassCastException: gnu.math.IntNum cannot be
cast to gnu.mapping.Symbol

But that fails saying:

FAIL warnings.lisp: more diagnostics than expected: '   at
warnings.test(warnings.lisp:31)'

Which is the next line in the stack trace. This is because of the
line-by-line processing done in RunTestScript. Would it not be better
to slurp in all the error output, and the submit regexes over that? So
I could write:
;; Diagnostic-pattern: (?s).*gnu.math.IntNum cannot be cast to
gnu.mapping.Symbol.*

Or something similar? Maybe I'm just not using the tool correctly. :-)

Charles.

Attachment: declare.patch
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]