#271 (declare ((integer 0) posn)) is rejected by lisp-to-c compiler

Stable_release
closed
nobody
lisp-to-c (1)
1
2013-10-29
2013-10-23
Anton Vodonosov
No

When ECL lisp-to-c compiler sees the following code:

(defun note-position (posn)
  (declare ((integer 0) posn)
           (special *seen-positions-table*))
  (incf (gethash posn *seen-positions-table* 0)))

it fails with message:

;;; Compiling (DEFUN NOTE-POSITION ...).
;;; Error:
;;;   in file basic.lisp, position 4783
;;;   at (DEFUN NOTE-POSITION ...)
;;;   * Syntax error in declaration ((INTEGER 0) POSN)

Other lisps, as well as ECL bytecode compiler
accept the declaration.

The code is from the cl-parser-combinators library.
I have opened a ticket in the library issue tracker:
https://github.com/Ramarren/cl-parser-combinators/issues/11

ECL versions where this problem was observed include:
ecl-12.12.1, ecl-13.4.1-0e93edfc, ecl-13.4.1-94e04b54,
ecl-13.5.1, ecl-13.5.1-44c86e08

Discussion


  • Anonymous
    2013-10-28

    If the type specifier is a symbol, then I agree that the abbreviation is valid, I'm not so sure that it's valid if the type requires a list however...

     


Anonymous


Cancel   Add attachments