[cl-who-devel] setting *attribute-quote-char*

Hi, Could someone please tell me the proper way to set *attribute-quote-char*? I'm a noob, but I've spent the past 4 hours trying every way I could think of, to no avail. If I recompile a handler function, then it will take, but I can't get it to be set when I load the system via asdf. It's likely some ignorance on my part regarding packages or macros, but I would really appreciate it if someone could show me an example of how they use it. Thanks. -austin

On Sun, 19 Mar 2006 23:01:46 -0500, Austin Haas <austin@pettomato.com> wrote:
Could someone please tell me the proper way to set *attribute-quote-char*?
I'm a noob, but I've spent the past 4 hours trying every way I could think of, to no avail. If I recompile a handler function, then it will take, but I can't get it to be set when I load the system via asdf.
What do you mean by "get it to be set when I load the system?" Which system, CL-WHO or your own system which requires CL-WHO? You want to set the variable before CL-WHO is loaded?

Sorry, I meant my system, which requires CL-WHO. I have this in the main component file of my system: (setq tbnl:*tbnl-port* 3000) (setq cl-who:*attribute-quote-char* #\") (setq cl-who:*prologue* "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">") (in-package #:pettomato) (defun test-handler() (with-html-output-to-string (*standard-output* nil :prologue t) (:html (:body :bgcolor "black" "Not much there")) (values))) (defun start () (print "Starting server") (terpri) (tbnl:start-tbnl)) (defun stop () (print "Stopping server") (terpri) (tbnl:stop-tbnl)) ;; Route requests to handlers. (setq *dispatch-table* (nconc (mapcar (lambda (args) (apply #'create-regex-dispatcher args)) '(("test\.l" test-handler))) (list #'default-dispatcher))) (start) After the server starts, if I hit the test.l page, I will see that the prologue is still 'strict' and the *attribute-quote-char* is still #\'. If I reevaluate test-handler, then it will take the new values that I set above. Please feel free to bash anything that I'm doing naively. I would very much appreciate it. -austin Edi Weitz wrote:
On Sun, 19 Mar 2006 23:01:46 -0500, Austin Haas <austin@pettomato.com> wrote:
Could someone please tell me the proper way to set *attribute-quote-char*?
I'm a noob, but I've spent the past 4 hours trying every way I could think of, to no avail. If I recompile a handler function, then it will take, but I can't get it to be set when I load the system via asdf.
What do you mean by "get it to be set when I load the system?" Which system, CL-WHO or your own system which requires CL-WHO? You want to set the variable before CL-WHO is loaded?

On Mon, 20 Mar 2006 09:28:31 -0500, Austin Haas <austin@pettomato.com> wrote:
Sorry, I meant my system, which requires CL-WHO.
I have this in the main component file of my system:
[...]
After the server starts, if I hit the test.l page, I will see that the prologue is still 'strict' and the *attribute-quote-char* is still #\'. If I reevaluate test-handler, then it will take the new values that I set above.
Yeah, that's a matter of macro expansion time vs. compile time vs. load time. Wrap the SETQs with EVAL-WHEN or (better) put them into a file that is LOADed before your functions (using CL-WHO macros) are compiled. <http://www.lispworks.com/documentation/HyperSpec/Body/03_b.htm> <http://www.gigamonkeys.com/book/macros-defining-your-own.html> HTH, Edi.
participants (2)
-
Austin Haas
-
Edi Weitz