[spr26426] allegroserve: htmlgen: :COMMENT directive

The Bug Handler <[email protected]> Mon, 22 Jul 2002 12:23:34 -0700
Newsgroups gmane.lisp.open-source.franz
Message-ID <[email protected]>
dispatched to handler
No acknowledgement sent

@@id: spr26426
@@reference: 
@@summary: allegroserve: htmlgen: :COMMENT directive
@@product: acl
@@version: 6.1
@@component: allegroserve
@@customer-name: Andrew Philpot
@@customer-company: 
@@customer-phone: 
@@customer-email-address: owner-opensource
@@email-cc: [email protected], opensource
@@hardware: 
@@operating-system-and-version: 
@@implementation-time: 
@@state: logged 7/22/2002 by handler
@@state: dispatched 7/22/2002 to handler by handler
@@endstate
-------------------------------------------------------------------------------
@@resolution: 

-------------------------------------------------------------------------------
@@discussion:

Created only for the record. Discussion on opensource.


Return-Path: owner-opensource
Delivery-Date: Thu Jul 18 17:32:40 2002
Received: from turtlemail.franz.com (turtle [192.132.95.23])
	by quadra.franz.com (8.11.6/8.9.0) with ESMTP id g6J0Wcf14493
	for <handler@quadra>; Thu, 18 Jul 2002 17:32:38 -0700
Received: (from majordomo@localhost)
	by turtlemail.franz.com (8.9.3/8.9.0) id RAA09948
	for opensource-list; Thu, 18 Jul 2002 17:32:05 -0700
Received: from post.franz.com (post [10.1.0.2])
	by turtlemail.franz.com (8.9.3/8.9.0) with ESMTP id RAA09945
	for <opensource-real@turtle>; Thu, 18 Jul 2002 17:32:03 -0700
Received: (from root@localhost)
	by post.franz.com (8.11.6/8.9.0) id g6J0W3F25029
	for opensource-real@turtle; Thu, 18 Jul 2002 17:32:03 -0700
Received: from nitro.isi.edu (nitro.isi.edu [128.9.208.207])
	by post.franz.com (8.11.6/8.9.0) with ESMTP id g6J0W0U24992
	for <[email protected]>; Thu, 18 Jul 2002 17:32:00 -0700
Received: from blombos.isi.edu (blombos.isi.edu [128.9.216.39])
	by nitro.isi.edu (8.11.6/8.11.2) with ESMTP id g6J0VrA22970;
	Thu, 18 Jul 2002 17:31:53 -0700 (PDT)
Received: (from philpot@localhost)
	by blombos.isi.edu (8.11.6/8.8.6) id g6J0Vr428809;
	Thu, 18 Jul 2002 17:31:53 -0700
Date: Thu, 18 Jul 2002 17:31:53 -0700
Message-Id: <[email protected]>
X-Authentication-Warning: blombos.isi.edu: philpot set sender to [email protected] using -f
From: Andrew Philpot <[email protected]>
To: opensource
CC: [email protected]
Subject: allegroserve: htmlgen: :COMMENT directive
Sender: owner-opensource
Precedence: bulk


What's the proper way to use the :COMMENT directive to generate HTML
comments using ALLEGROSERVE?  I'm using 1.1.25.  I downloaded 1.2.21
but didn't install it yet as it didn't seem to have changed in the
relevant part of htmlgen.cl.

I know this seems like a straightforward thing, but since I didn't
find any examples of the use of this directive in the examples.cl, I
just tried a few things, with unexpected results:

(publish :path "/comment1"
	 :content-type  "text/html"
	 :function #'(lambda (req ent)
		       (with-http-response (req ent)
			 (with-http-body (req ent)
			   (html 
			    (:html
			     (:body "Hello World!")
			     (:comment "Comment1")))))))

==> valid document, empty comment


(publish :path "/comment2"
	 :content-type  "text/html"
	 :function #'(lambda (req ent)
		       (with-http-response (req ent)
			 (with-http-body (req ent)
			   (html 
			    (:html
			     (:body "Hello World!")
			     (:comment (:princ "Comment2"))))))))

=> error, attempt to call undefined function :PRINC


(publish :path "/comment3"
	 :content-type  "text/html"
	 :function #'(lambda (req ent)
		       (with-http-response (req ent)
			 (with-http-body (req ent)
			   (html 
			    (:html
			     (:body "Hello World!")
			     (:comment (princ "Comment3" *html-stream*))))))))

=> works!

But isn't it violating the abstraction to have to reference
*HTML-STREAM* during generation?

Confusingly, 

(with-output-to-string (s)
  (html-print '(:comment "Comment4") s))

corresponding more or less to "/comment1" above, works.

=> "<!--Comment4-->"

What am I missing?

Thanks,
Andrew