Re: read-from-string output difference between MacCL and Lispworks implementations of cl-http

"John C. Mallery" <[email protected]> Fri, 27 Oct 2006 20:26:14 -0400
Newsgroups gmane.lisp.cl-http
Message-ID <[email protected]>
First of all, calling the reader is neither recommended in general  
nor specifically in response functions. You could be exposing  
yourself to attacks on your system.

Second, you need to bind the package your expect data to be read  
into.  It sounds like you want my-read-from-string, which binds the  
package the way you want whenever your function is called.

Try tags query replace. to update your code.

Third, it sounds like the reader is just using whatever the global  
package happens to be when you run your code in some random thread.   
This may depend on whether the default package is set to http-user by  
the port.  You definitely do not want to rely on the glbal value of  
*package* for your code to work.


On Oct 27, 2006, at 8:03 PM, Mark Klein wrote:

>
> This is a follow-up to my posting from a couple hours ago:
>
> Read-from-string gives different results when called within cl-http  
> 70.214 methods, depending on whether it is run in lispworks 4.3 vs  
> mac common lisp 5.1.
>
> The test method:
>
> (defmethod rtest ((url url:http-computed-url) stream)
>   (http:with-successful-response (stream :html)
>     (format stream "package = ~a" (package-name (symbol-package  
> (read-from-string "test"))))))
>
> (http:export-url #u"/pql/rtest"
>                  :computed
>                  :response-function #'rtest)
>
> The results:
>
> lispworks: HTTP-USER
> mac cl: COMMON-LISP-USER
>
> Is this a known bug, or "feature", of the lispworks vs mac cl cl- 
> http implementations? Is there a simple way to make read-from- 
> string in the LispWorks version produce the same results as read- 
> from-string in the MacCL version? My code uses read-from-string  
> within cl-http methods a lot, and fixing each use one at a time  
> would be pretty time-consuming.
>
>      Thanks,
>
>         Mark
>
> -- 
> Mark Klein
> Principal Research Scientist
> Massachusetts Institute of Technology
> 77 Massachusetts Avenue, NE20-336
> Cambridge MA 02139 USA
> [email protected]
> http://cci.mit.edu/klein/
> _______________________________________________
> WWW-CL mailing list
> [email protected]
> https://lists.csail.mit.edu/mailman/listinfo/www-cl

_______________________________________________
WWW-CL mailing list
[email protected]
https://lists.csail.mit.edu/mailman/listinfo/www-cl