From DKICK1 at motorola.com Fri Nov 19 20:05:11 2004 From: DKICK1 at motorola.com (Kick Damien-DKICK1) Date: Fri, 19 Nov 2004 14:05:11 -0600 Subject: [cl-ppcre-devel] Warning from CMUCL 19a about CL-PPCRE 0.9.0 usage Message-ID: <8E4E38BF6D087F4488E80ABAACA2F3F4B2A41E@il27exm02.cig.mot.com> I'm seeing some warnings from CMUCL that I don't understand. Here is the warning the simplest code I've written at the moment that produces the warning: (defun flurp (line) (let (delta) (register-groups-bind (delta-str) ('(:sequence (:register (:greedy-repetition 1 nil :digit-class))) line) (setq delta (parse-integer delta-str))))) and the warning: ; In: DEFUN FLURP ; (REGISTER-GROUPS-BIND (DELTA-STR) ('# LINE) (SETQ DELTA #)) ; --> LET MULTIPLE-VALUE-BIND MULTIPLE-VALUE-CALL FUNCTION WHEN COND IF PROGN ; --> LET* LET ; ==> ; (IF #:START-INDEX5 ; (FUNCALL #:SUBSTR-FN6 #:TARGET-STRING0 #:START-INDEX5 #) ; NIL) ; Warning: This is not a (VALUES &OPTIONAL BASE-STRING &REST T): ; NIL ; ; [Last message occurs 2 times] What follows are a few more examples, with SSMT-OUTPUT-SUMMARY being the original snippet. (in-package #:pg-user) (defun ssmt-output-summary (pname) (with-open-file (in pname :direction :input) (loop with line = nil and delta = 0 and added = 0 and changed = 0 and deleted = 0 while (setq line (read-line in nil)) when (register-groups-bind (delta-str added-str changed-str deleted-str) ('(:sequence "__UNDEF__" (:greedy-repetition 1 nil :whitespace-char-class) ;; Delta SLOC (:register (:greedy-repetition 1 nil :digit-class)) (:greedy-repetition 1 nil :whitespace-char-class) ;; Skip over delta AELOC (:greedy-repetition 1 nil :digit-class) (:greedy-repetition 1 nil :whitespace-char-class) ;; Code added (:register (:greedy-repetition 1 nil :digit-class)) (:greedy-repetition 1 nil :whitespace-char-class) ;; Code changed (:register (:greedy-repetition 1 nil :digit-class)) (:greedy-repetition 1 nil :whitespace-char-class) ;; Code deleted (:register (:greedy-repetition 1 nil :digit-class))) line) ;; Somebody doesn't like our attempting to return ;; multiple values past the REGISTER-GROUPS-BIND (setq delta (parse-integer delta-str) added (parse-integer added-str) changed (parse-integer changed-str) deleted (parse-integer deleted-str))) do (return (values delta added changed deleted)) finally (warn "Could not find summary for ~A" pname)))) (defun foo (line) (let (delta added changed deleted) (register-groups-bind (delta-str added-str changed-str deleted-str) ('(:sequence "__UNDEF__" (:greedy-repetition 1 nil :whitespace-char-class) ;; Delta SLOC (:register (:greedy-repetition 1 nil :digit-class)) (:greedy-repetition 1 nil :whitespace-char-class) ;; Skip over delta AELOC (:greedy-repetition 1 nil :digit-class) (:greedy-repetition 1 nil :whitespace-char-class) ;; Code added (:register (:greedy-repetition 1 nil :digit-class)) (:greedy-repetition 1 nil :whitespace-char-class) ;; Code changed (:register (:greedy-repetition 1 nil :digit-class)) (:greedy-repetition 1 nil :whitespace-char-class) ;; Code deleted (:register (:greedy-repetition 1 nil :digit-class))) line) (setq delta (parse-integer delta-str) added (parse-integer added-str) changed (parse-integer changed-str) deleted (parse-integer deleted-str))))) (defun bar (line) (register-groups-bind (delta-str added-str changed-str deleted-str) ('(:sequence "__UNDEF__" (:greedy-repetition 1 nil :whitespace-char-class) ;; Delta SLOC (:register (:greedy-repetition 1 nil :digit-class)) (:greedy-repetition 1 nil :whitespace-char-class) ;; Skip over delta AELOC (:greedy-repetition 1 nil :digit-class) (:greedy-repetition 1 nil :whitespace-char-class) ;; Code added (:register (:greedy-repetition 1 nil :digit-class)) (:greedy-repetition 1 nil :whitespace-char-class) ;; Code changed (:register (:greedy-repetition 1 nil :digit-class)) (:greedy-repetition 1 nil :whitespace-char-class) ;; Code deleted (:register (:greedy-repetition 1 nil :digit-class))) line) (declare (ignore delta-str added-str changed-str deleted-str)))) (defun baz (line) (register-groups-bind (delta-str added-str changed-str deleted-str) ('(:sequence "__UNDEF__" (:greedy-repetition 1 nil :whitespace-char-class) ;; Delta SLOC (:register (:greedy-repetition 1 nil :digit-class)) (:greedy-repetition 1 nil :whitespace-char-class) ;; Skip over delta AELOC (:greedy-repetition 1 nil :digit-class) (:greedy-repetition 1 nil :whitespace-char-class) ;; Code added (:register (:greedy-repetition 1 nil :digit-class)) (:greedy-repetition 1 nil :whitespace-char-class) ;; Code changed (:register (:greedy-repetition 1 nil :digit-class)) (:greedy-repetition 1 nil :whitespace-char-class) ;; Code deleted (:register (:greedy-repetition 1 nil :digit-class))) line) (declare (ignore added-str changed-str deleted-str)) delta-str)) (defun blatz (line) (register-groups-bind (delta-str added-str changed-str deleted-str) ('(:sequence "__UNDEF__" (:greedy-repetition 1 nil :whitespace-char-class) ;; Delta SLOC (:register (:greedy-repetition 1 nil :digit-class)) (:greedy-repetition 1 nil :whitespace-char-class) ;; Skip over delta AELOC (:greedy-repetition 1 nil :digit-class) (:greedy-repetition 1 nil :whitespace-char-class) ;; Code added (:register (:greedy-repetition 1 nil :digit-class)) (:greedy-repetition 1 nil :whitespace-char-class) ;; Code changed (:register (:greedy-repetition 1 nil :digit-class)) (:greedy-repetition 1 nil :whitespace-char-class) ;; Code deleted (:register (:greedy-repetition 1 nil :digit-class))) line) (values delta-str added-str changed-str deleted-str))) (defun blurp (line) (register-groups-bind (delta-str added-str changed-str deleted-str) ('(:sequence "__UNDEF__" (:greedy-repetition 1 nil :whitespace-char-class) ;; Delta SLOC (:register (:greedy-repetition 1 nil :digit-class)) (:greedy-repetition 1 nil :whitespace-char-class) ;; Skip over delta AELOC (:greedy-repetition 1 nil :digit-class) (:greedy-repetition 1 nil :whitespace-char-class) ;; Code added (:register (:greedy-repetition 1 nil :digit-class)) (:greedy-repetition 1 nil :whitespace-char-class) ;; Code changed (:register (:greedy-repetition 1 nil :digit-class)) (:greedy-repetition 1 nil :whitespace-char-class) ;; Code deleted (:register (:greedy-repetition 1 nil :digit-class))) line) (declare (ignore delta-str added-str changed-str deleted-str)) 69)) (defun flurp (line) (let (delta) (register-groups-bind (delta-str) ('(:sequence (:register (:greedy-repetition 1 nil :digit-class))) line) (setq delta (parse-integer delta-str))))) And the complaints during compilation. * (lisp-implementation-version) "19a" * (lisp-implementation-type) "CMU Common Lisp" * (software-version) "5.8" * (software-type) "SunOS" * (compile-file "/home/kick/tmp/scratch.lisp") ; Python version 1.1, VM version UltraSparc/Solaris 7 on 19 NOV 04 01:59:21 pm. ; Compiling: /home/kick/tmp/scratch.lisp 19 NOV 04 01:58:23 pm ; Compiling Load Time Value of (CREATE-SCANNER '(:SEQUENCE "__UNDEF__" # ...)): ; Converted SSMT-OUTPUT-SUMMARY. ; Compiling DEFUN SSMT-OUTPUT-SUMMARY: ; ; ; File: /home/kick/tmp/scratch.lisp ; In: DEFUN SSMT-OUTPUT-SUMMARY ; (REGISTER-GROUPS-BIND (DELTA-STR ADDED-STR CHANGED-STR DELETED-STR) ; ('# LINE) ; (SETQ DELTA # ADDED # ...)) ; --> LET MULTIPLE-VALUE-BIND MULTIPLE-VALUE-CALL FUNCTION WHEN COND IF PROGN ; --> LET* LET ; ==> ; (IF #:START-INDEX15 ; (FUNCALL #:SUBSTR-FN16 #:TARGET-STRING10 #:START-INDEX15 #) ; NIL) ; Warning: This is not a (VALUES &OPTIONAL BASE-STRING &REST T): ; NIL ; ; [Last message occurs 8 times] ; Compiling Load Time Value of (CREATE-SCANNER '(:SEQUENCE "__UNDEF__" # ...)): ; Converted FOO. ; Compiling DEFUN FOO: ; ; ; File: /home/kick/tmp/scratch.lisp ; In: DEFUN FOO ; (REGISTER-GROUPS-BIND (DELTA-STR ADDED-STR CHANGED-STR DELETED-STR) ; ('# LINE) ; (SETQ DELTA # ADDED # ...)) ; --> LET MULTIPLE-VALUE-BIND MULTIPLE-VALUE-CALL FUNCTION WHEN COND IF PROGN ; --> LET* LET ; ==> ; (IF #:START-INDEX5 ; (FUNCALL #:SUBSTR-FN6 #:TARGET-STRING0 #:START-INDEX5 #) ; NIL) ; Warning: This is not a (VALUES &OPTIONAL BASE-STRING &REST T): ; NIL ; ; [Last message occurs 8 times] ; Compiling Load Time Value of (CREATE-SCANNER '(:SEQUENCE "__UNDEF__" # ...)): ; Converted BAR. ; Compiling DEFUN BAR: ; Compiling Load Time Value of (CREATE-SCANNER '(:SEQUENCE "__UNDEF__" # ...)): ; Converted BAZ. ; Compiling DEFUN BAZ: ; Compiling Load Time Value of (CREATE-SCANNER '(:SEQUENCE "__UNDEF__" # ...)): ; Converted BLATZ. ; Compiling DEFUN BLATZ: ; Compiling Load Time Value of (CREATE-SCANNER '(:SEQUENCE "__UNDEF__" # ...)): ; Converted BLURP. ; Compiling DEFUN BLURP: ; Compiling Load Time Value of (CREATE-SCANNER '(:SEQUENCE #)): ; Converted FLURP. ; Compiling DEFUN FLURP: ; ; ; File: /home/kick/tmp/scratch.lisp ; In: DEFUN FLURP ; (REGISTER-GROUPS-BIND (DELTA-STR) ('# LINE) (SETQ DELTA #)) ; --> LET MULTIPLE-VALUE-BIND MULTIPLE-VALUE-CALL FUNCTION WHEN COND IF PROGN ; --> LET* LET ; ==> ; (IF #:START-INDEX5 ; (FUNCALL #:SUBSTR-FN6 #:TARGET-STRING0 #:START-INDEX5 #) ; NIL) ; Warning: This is not a (VALUES &OPTIONAL BASE-STRING &REST T): ; NIL ; ; [Last message occurs 2 times] ; Byte Compiling Top-Level Form: ; Compilation unit finished. ; 18 warnings ; /home/kick/tmp/scratch.sparcf written. ; Compilation finished in 0:00:02. #p"/home/kick/tmp/scratch.sparcf" T T * I don't understand why only SSMT-OUTPUT-SUMMARY, FOO, and FLURP are the only ones with warnings. -- Damien Kick -------------- next part -------------- An HTML attachment was scrubbed... URL: From edi at agharta.de Sun Nov 21 15:10:47 2004 From: edi at agharta.de (Edi Weitz) Date: Sun, 21 Nov 2004 16:10:47 +0100 Subject: [cl-ppcre-devel] Warning from CMUCL 19a about CL-PPCRE 0.9.0 usage In-Reply-To: <8E4E38BF6D087F4488E80ABAACA2F3F4B2A41E@il27exm02.cig.mot.com> (Kick Damien-DKICK's message of "Fri, 19 Nov 2004 14:05:11 -0600") References: <8E4E38BF6D087F4488E80ABAACA2F3F4B2A41E@il27exm02.cig.mot.com> Message-ID: On Fri, 19 Nov 2004 14:05:11 -0600, Kick Damien-DKICK1 wrote: > I'm seeing some warnings from CMUCL that I don't understand. Here > is the warning the simplest code I've written at the moment that > produces the warning: > > (defun flurp (line) > (let (delta) > (register-groups-bind (delta-str) > ('(:sequence (:register (:greedy-repetition 1 nil :digit-class))) > line) > (setq delta (parse-integer delta-str))))) > > and the warning: > > ; In: DEFUN FLURP > > ; (REGISTER-GROUPS-BIND (DELTA-STR) ('# LINE) (SETQ DELTA #)) > ; --> LET MULTIPLE-VALUE-BIND MULTIPLE-VALUE-CALL FUNCTION WHEN COND IF PROGN > ; --> LET* LET > ; ==> > ; (IF #:START-INDEX5 > ; (FUNCALL #:SUBSTR-FN6 #:TARGET-STRING0 #:START-INDEX5 #) > ; NIL) > ; Warning: This is not a (VALUES &OPTIONAL BASE-STRING &REST T): > ; NIL > ; ; [Last message occurs 2 times] CMUCL is clever, it knows that the first argument to PARSE-INTEGER must be a string but in your function FLURP it is possible that DELTA-STR is NIL (if there's no match). Thus the warning. The form you're seeing in the warning is part of the macro expansion of REGISTER-GROUPS-BINDS, it's the part where DELTA-STR is finally computed. Does that help? Cheers, Edi. From edi at agharta.de Mon Nov 29 10:23:29 2004 From: edi at agharta.de (Edi Weitz) Date: Mon, 29 Nov 2004 11:23:29 +0100 Subject: [cl-ppcre-devel] New release 0.9.1 Message-ID: Changelog: Version 0.9.1 2004-11-29 Shortcuts for REGISTER-GROUPS-BIND and DO-REGISTER-GROUPS (suggested by Alexander Kjeldaas) Download: Cheers, Edi. From DKICK1 at motorola.com Mon Nov 29 17:51:09 2004 From: DKICK1 at motorola.com (Kick Damien-DKICK1) Date: Mon, 29 Nov 2004 11:51:09 -0600 Subject: [cl-ppcre-devel] Warning from CMUCL 19a about CL-PPCRE 0.9.0 usage Message-ID: <8E4E38BF6D087F4488E80ABAACA2F3F4B2A421@il27exm02.cig.mot.com> Edi Weitz [edi at agharta.de] wrote: > On Fri, 19 Nov 2004 14:05:11 -0600, Kick Damien-DKICK1 > wrote: > > I'm seeing some warnings from CMUCL that I don't understand. [...] > [...] the first argument to PARSE-INTEGER must be a string but in > your function FLURP it is possible that DELTA-STR is NIL [...] Does > that help? Yes, thank you for your help.