Discussion:
strange behaviour: package and/or macro relevant?
olivier buechel
2008-08-25 23:42:08 UTC
Permalink
This works:
(in-package :cl-user)
(let* ((txt1 "hallo")
(txt2 "yellow"))
(cl-who:show-html-expansion (str nil :indent t)
((:a) txt1 txt2)))

This does not work and hell breaks out when compiling:
(defpackage :dummy-package
(:use :cl :cl-user :cl-who))
(in-package :dummy-package)
(let* ((txt1 "hallo")
(txt2 "yellow"))
(cl-who:show-html-expansion (str nil :indent t)
((:a) txt1 txt2)))
==>
(LET ((STR STR))
(PROGN
(WRITE-STRING "
<a>
"
LET ((#:G1 NIL)) (WHEN #:G1 (PRINC #:G1 STR)))
TXT1
(WRITE-STRING "
"
LET ((#:G2 NIL)) (WHEN #:G2 (PRINC #:G2 STR)))
TXT2
(WRITE-STRING "
</a>"
LET ((#:G3 NIL)) (WHEN #:G3 (PRINC #:G3 STR)))))

Well, I really don't get it with packages, so I just tried around and found
that this code here works:
(defpackage :dummy-package
(:use :cl :cl-user :cl-who))
(in-package :dummy-package)
(let* ((txt1 "hallo")
(txt2 "yellow"))
(cl-who:show-html-expansion (s nil :indent t)
((:a) txt1 txt2)))

So kind-of it's not the package alone the problem, somehow
it's the combination of package and using str in macro
Ha, just tried with fmt instead of str: same problem
Hint: Maybe no protection with gensym? And why does it work in cl-user?!?

Using cl-who-0.11.1

And yes, I was in hell...
And now (after changing str to s) I want just to understand what happend to
me.
thanks
olli
Edi Weitz
2008-08-25 23:52:09 UTC
Permalink
http://common-lisp.net/pipermail/cl-who-devel/2008-August/000167.html

Edi.

Loading...