It doesn't seem to be possible to local-require local files in a template. 
Consider:

;; template.html.p

◊(local-require "utils.rkt")
◊blah

;; utils.rkt

...
(provide blah)
...

;; sub/test.html.pm

test

When rendering sub/test.html, I would get the error that sub/utils.rkt 
doesn't exist.

I tried to fix this using a macro that expands to (local-require 
"../../../utils.rkt") with the appropriate number of "../", but that 
somehow also doesn't work due to an error that I don't totally understand:

template.html:2:2: blah: unbound identifier
  in: blah
  context...:
   #(100195 module) #(100198 module render-helper) #(100881 module g1707)
   #(100883 macro) #(102592 local) #(102593 intdef) #(102601 local)
   #(102602 intdef) [common scopes]
  other binding...:
   local
   #(-102508 module pollen) #(-102491 module) #(102764 macro)
   [common scopes]
  common scopes...:
   #(102643 intdef) #(103568 local) #(103569 intdef)


The reason why I want to local-require local files is that there are a lot 
of functions that are only specific to the template file. Putting those in 
pollen.rkt would solve the problem, but it would pollute the environment 
unnecessarily.

-- 
You received this message because you are subscribed to the Google Groups 
"Pollen" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to