< Support Home
defstruct with print-function.
ID
Created
Type
mocl Version
Dev OS
Target
Status
#85
by informatimago on 2015-03-01 (2156 days ago)
defect
14.08
Mac OS X
n/a
open
Description
Summary: There's no way to compile defstruct without an error. Steps to Reproduce: Try to compile: (declaim (ftype (function (t t t) t) print-point)) (defstruct (point (:print-function print-point)) x y) (defun print-point (point stream level) (format stream "~V<~><~A ~A>" level (point-x point) (point-y point))) ;; with or without the declaim! Expected Results: A clean compilation. Actual Results: n=bug-defstruct ; echo --- ; mkdir -p /tmp/${n}/src ; mocl --verbose --warn --android /tmp/${n} ${n}.lisp --- mocl 14.08 Copyright (C) 2013-2014 Wukix, Inc. (https://wukix.com) [Source Analysis] /Users/pjb/src/mocl/bug-defstruct.lisp Warning: undefined function: PRINT-POINT ; in: DEFSTRUCT POINT ; (FUNCALL #'PRINT-POINT #:OBJECT3 #:STREAM4 SB-KERNEL:*CURRENT-LEVEL-IN-PRINT*) ; ==> ; (SB-C::%FUNCALL #'PRINT-POINT #:OBJECT3 #:STREAM4 ; SB-KERNEL:*CURRENT-LEVEL-IN-PRINT*) ; ; caught STYLE-WARNING: ; undefined function: PRINT-POINT ; ; compilation unit finished ; Undefined function: ; PRINT-POINT ; caught 1 STYLE-WARNING condition defstruct point deftype point Warning: Unable to evaluate; function PRINT-POINT is undefined. defun print-point [Finalization] finalizing classes finalizing generic functions [Optimization] dead code elimination tail recursion elimination type inference (level 0) code graph analysis substitution and simplification dead code elimination code graph analysis side effect analysis let form optimization type inference (level 2) substitution and simplification dead code elimination code graph analysis [Code Generation] /private/tmp/bug-defstruct/jni/mocl/program.h /private/tmp/bug-defstruct/jni/mocl/program.c 0 Errors, 2 Warnings Compilation finished at Sun Mar 1 13:14:04 or, without the declaim: n=bug-defstruct ; echo --- ; mkdir -p /tmp/${n}/src ; mocl --verbose --warn --android /tmp/${n} ${n}.lisp --- mocl 14.08 Copyright (C) 2013-2014 Wukix, Inc. (https://wukix.com) [Source Analysis] /Users/pjb/src/mocl/bug-defstruct.lisp Warning: undefined function: PRINT-POINT ; in: DEFSTRUCT POINT ; (FUNCALL #'PRINT-POINT #:OBJECT3 #:STREAM4 SB-KERNEL:*CURRENT-LEVEL-IN-PRINT*) ; ==> ; (SB-C::%FUNCALL #'PRINT-POINT #:OBJECT3 #:STREAM4 ; SB-KERNEL:*CURRENT-LEVEL-IN-PRINT*) ; ; caught STYLE-WARNING: ; undefined function: PRINT-POINT ; ; compilation unit finished ; Undefined function: ; PRINT-POINT ; caught 1 STYLE-WARNING condition defstruct point deftype point Warning: Unable to evaluate; function PRINT-POINT is undefined. defun print-point [Finalization] finalizing classes finalizing generic functions [Optimization] dead code elimination tail recursion elimination type inference (level 0) code graph analysis substitution and simplification dead code elimination code graph analysis side effect analysis let form optimization type inference (level 2) substitution and simplification dead code elimination code graph analysis [Code Generation] /private/tmp/bug-defstruct/jni/mocl/program.h /private/tmp/bug-defstruct/jni/mocl/program.c 0 Errors, 2 Warnings or with the defun print-point before the defstruct: n=bug-defstruct ; echo --- ; mkdir -p /tmp/${n}/src ; mocl --verbose --warn --android /tmp/${n} ${n}.lisp --- mocl 14.08 Copyright (C) 2013-2014 Wukix, Inc. (https://wukix.com) [Source Analysis] /Users/pjb/src/mocl/bug-defstruct.lisp defun print-point Warning: undefined function: PRINT-POINT ; in: DEFSTRUCT POINT ; (FUNCALL #'PRINT-POINT #:OBJECT5 #:STREAM6 SB-KERNEL:*CURRENT-LEVEL-IN-PRINT*) ; ==> ; (SB-C::%FUNCALL #'PRINT-POINT #:OBJECT5 #:STREAM6 ; SB-KERNEL:*CURRENT-LEVEL-IN-PRINT*) ; ; caught STYLE-WARNING: ; undefined function: PRINT-POINT ; ; compilation unit finished ; Undefined function: ; PRINT-POINT ; caught 1 STYLE-WARNING condition defstruct point deftype point [Finalization] finalizing classes finalizing generic functions [Optimization] dead code elimination tail recursion elimination type inference (level 0) code graph analysis substitution and simplification dead code elimination code graph analysis side effect analysis let form optimization type inference (level 2) substitution and simplification dead code elimination code graph analysis [Code Generation] /private/tmp/bug-defstruct/jni/mocl/program.h /private/tmp/bug-defstruct/jni/mocl/program.c 0 Errors, 1 Warnings Notes:
Comments
(no comments)
Log In
to add a comment.
(no comments)
Log In to add a comment.