[TBNL] No access to variables



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.
.



Relevant Pages

  • Re: My First Lisp Program
    ... (defparameter *player-names* (cons nil nil)) ... Not only is it nice to point out that you're using global variables, ... :when (funcall fn elt) ... Without the, to unquote board-size, this will only work by happy ...
    (comp.lang.lisp)
  • Re: My First Lisp Program
    ... (defparameter *player-names* (cons nil nil)) ... Not only is it nice to point out that you're using global variables, ... :when (funcall fn elt) ... Without the, to unquote board-size, this will only work by happy ...
    (comp.lang.lisp)
  • Re: Duplicating objects in Delphi ?
    ... inherited Duplicate(ParaChild); ... Global variables are garbage so they need to be set to nil manually.... ...
    (alt.comp.lang.borland-delphi)
  • Re: quick question
    ... Ilan Berci wrote: ... There are no globals in ruby! ... Global variables begin with $ ...
    (comp.lang.ruby)