[Ecls-list] Another compiler error with ecl and cl-http

Karsten Poeck karsten.poeck at gmail.com
Sat Nov 19 08:50:01 UTC 2005


Hello,

with the call-next-method problem solved, I have now been able to 
compile the core of cl-http.

But a strange problem let my tests fail.

In the code attached is a reproducible test case.
The call in test should return 3 values, as does test2, but it doesn't

The error only happens if the code is compiled and loaded via 
compiled-file, interpreted code runs fine

salud2

Karsten

;;;Platform, Windows XP, cvs of 2005-11-18, free visual c++ toolkit 2003

(in-package :cl-user)

(defvar *debug-server* nil)

(defmacro handler-case-if (condition form &body clauses)
   "Sets up condition handlers when condition returns non-null."
   `(flet ((execute-form () ,form))
      (declare (inline execute-form))
      (cond (,condition
             (handler-case (execute-form) , at clauses))
            (t (execute-form)))))

(defmacro with-bad-escaping-resignalled ((string &key reason start 
end (error-class 'error)) &body body)
   `(handler-case-if (not *debug-server*)
       (progn , at body)
      (,error-class (err)
       (error err
	     :url ,(if (and start end)
		       `(subseq ,string (max ,start 0) (min ,end (length ,string)))
		       `(progn ,string))
	     ,@(when reason `(:reason ,reason))
	     :format-string "hugo"))))

(defun %unescape-url (url-string start end destructive-p)
   (declare (fixnum start end)
            (values canonical-url new-start new-end))
   (declare (ignore destructive-p))
   (with-bad-escaping-resignalled (url-string :start start :end end
                                              :reason "Bad Escaping: 
Ill-escaped URL")
     (multiple-value-bind (unescaped-string chars-unescaped-p new-url-string-p)
         (string-unescape-special-chars url-string start end t)
       (declare (ignore chars-unescaped-p))
       (unless new-url-string-p
         (setq unescaped-string (subseq url-string start end)))
       (values unescaped-string 0 (length unescaped-string)))))

(defun string-unescape-special-chars (string &optional (start 0) (end 
(length string) end-supplied-p) (escape-fragments-p t))
   (declare (ignore start end end-supplied-p escape-fragments-p))
   (let ((new-string (make-string 10 :initial-element #\a)))
     new-string))

(defun test ()
   (let ((url "http://localhost/foo.html"))
     (%unescape-url url 0 (length url) nil)))

(defun %unescape-url-2 (url-string start end destructive-p)
   (declare (fixnum start end)
            (values canonical-url new-start new-end))
   (declare (ignore destructive-p))
   (progn
     (multiple-value-bind (unescaped-string chars-unescaped-p new-url-string-p)
         (string-unescape-special-chars url-string start end t)
       (declare (ignore chars-unescaped-p))
       (unless new-url-string-p
         (setq unescaped-string (subseq url-string start end)))
       (values unescaped-string 0 (length unescaped-string)))))

(defun test2 ()
   (let ((url "http://localhost/foo.html"))
     (%unescape-url-2 url 0 (length url) nil)))





More information about the ecl-devel mailing list