[cl-emb-devel] New release CL-EMB 0.4.0 (API CHANGES!)

Stefan Scholl sscholl at common-lisp.net
Mon Jun 20 13:54:37 UTC 2005


New release CL-EMB 0.4.0

CL-EMB is a library to embed Common Lisp and special template
tags into normal text files. Can be used for dynamically
generated HTML pages.


You can download it from
http://common-lisp.net/project/cl-emb/
or install with ASDF-Install.

CL-USER> (asdf:operate 'asdf:load-op :asdf-install)
CL-USER> (asdf-install:install :cl-emb)


Changes:
- Extended way to access environment (the supplied plist)
  with template tags.

  E.g.:  <% @var foo/bar %> 
         --> Like accessing (GETF (GETF ENV :FOO) :BAR)

  When your're inside a nested loop you can access the
  elements of the toplevel by starting the parameter with
  a slash.

CL-USER> (emb:register-emb "test11" "<% @loop bands %>Band: <% @var band %> (Genre: <% @var /genre %>)<br><% @endloop %>")
#<CL-EMB::EMB-FUNCTION {58ADB12D}>
CL-USER> (emb:execute-emb "test11" :env '(:genre "Rock" :bands ((:band "Queen") (:band "The Rolling Stones") (:band "ZZ Top"))))
"Band: Queen (Genre: Rock)<br>Band: The Rolling Stones (Genre: Rock)<br>Band: ZZ Top (Genre: Rock)<br>"

CL-USER> (emb:register-emb "test12" "<% @repeat /foo/bar/count %>*<% @endrepeat %>")
#<CL-EMB::EMB-FUNCTION {58B7583D}>
CL-USER> (emb:execute-emb "test12" :env '(:foo (:bar (:count 42))))
"******************************************"





More information about the cl-emb-devel mailing list