Skip to content

Instantly share code, notes, and snippets.

@otherjoel
Last active May 12, 2020 00:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save otherjoel/551636a8648d97aa7938a4a5603399b2 to your computer and use it in GitHub Desktop.
Save otherjoel/551636a8648d97aa7938a4a5603399b2 to your computer and use it in GitHub Desktop.
Pollen namespace reuse test
❯ raco pollen render another.txt example.txt
pollen: rendering another.txt example.txt
pollen: rendering /another.txt.pm
pollen: rendered /another.txt (421 ms)
pollen: rendering /example.txt.pm
pollen: rendered /example.txt (339 ms)
❯ cat another.txt
Result: 1
(template) Result: 1
❯ cat example.txt
Result: 2
(template) Result: 1
#lang racket
(provide (all-defined-out))
(define x 0)
(define (inc-x!)
(set! x (+ x 1)))
(define (xstr)
(format "Result: ~a" x))
(define (root . elems)
(inc-x!)
`(root ,(xstr)))
◊(inc-x!)
◊(cadr doc)
(template) ◊(xstr)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment