[TBNL] No access to variables
- From: Stefan Nobis <snobis@xxxxxx>
- Date: Tue, 31 May 2005 19:16:16 +0200
Hi.
My first steps with TBNL and CL-WHO. I tried to write a simple
default-handler which just outputs some global variables i want to
use. But they seem to evaluate to nil. Here's my code:
----------------------------------------------------------------------
(in-package :my-tbnl-site)
(eval-when (:compile-toplevel :load-toplevel :execute)
(defparameter *basedir*
(merge-pathnames
(make-pathname :directory (pathname-directory *load-truename*))
(user-homedir-pathname)))
(defparameter *config-file*
(merge-pathnames
(make-pathname :name (pathname-name *load-truename*)
:type "db")
*basedir*)))
(defun foo ()
(log-message :info "My handler called for script ~A (cfg: ~A)" (script-name) *config-file*)
(with-html-output-to-string (*standard-output* nil :prologue t)
(:html
(:head (:title "First steps"))
(:body
(:h1 "title")
(:p "config: " (namestring *config-file*))
(:p "loadname: " *load-truename*)
(:p "script: " (script-name))))))
(setq *default-handler* 'foo)
----------------------------------------------------------------------
The log-message works, script-name and *config-file* are correctly
written. But in with-html-output-to-string everythings seems to
evaluate to nil (only the literal text shows up). What am i doing
wrong?
--
Stefan.
.
- Prev by Date: Re: open source e-commerce
- Next by Date: Re: win32 Lisp cannot load Gtk DLLs when C can?
- Previous by thread: Lisp + SDL + GTK
- Next by thread: Overlord programs
- Index(es):
Relevant Pages
|