Using eval on a page causes rendering to fail
#259
Closed
opened 3 years ago by jo-sm
·
3 comments
Loading…
Reference in New Issue
There is no content yet.
Delete Branch '%!s(<nil>)'
Deleting a branch is permanent. It CANNOT be undone. Continue?
I recently wrote a post on my website that involved evaluating some syntax to illustrate the expressiveness of Pollen:
When I run it in
start
mode, everything seems to work and it's rendered as expected (first printing the syntax then printing the list). However, when I attempt to render the page usingraco pollen render
, I get the following error:I was able to work around this by evaluating it with
(make-base-namespace)
:Is this intended, or is this a bug?
P.S. Since I don't have another place to put this, and sorry for putting this on a bug report: thanks for writing Pollen. I'm really happy to have a tool in Racket that lets me write my website, and more importantly a tool that is nice to use and just basically gets out of my way.
I think this is a Racket question more than a Pollen question. The answer is, this is intended. See https://docs.racket-lang.org/guide/eval.html#%28part._namespaces%29.
FWIW, Pollen has a discussion area at https://github.com/mbutterick/pollen-users.
@sorawee After reading that I think I'm still a little confused. Like I mention, when the page is rendered via
pollen start
it renders fine, but not when rendered viapollen render
. Is this becausepollen start
instantiates an initial namespace?When using
raco pollen start
, every page render gets a fresh namespace (because this ensures that changes to the underlying files are reflected in the next refresh of the page). But duringraco pollen render
, all the renders share a namespace (because this is faster).