From sscholl at common-lisp.net Sun Mar 6 14:34:40 2005 From: sscholl at common-lisp.net (Stefan Scholl) Date: Sun, 6 Mar 2005 15:34:40 +0100 Subject: [cl-emb-announce] New release CL-EMB 0.2.2 (minor bugfix) Message-ID: <20050306143440.GE10103@parsec.no-spoon.de> New release CL-EMB 0.2.2 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: - Minor bugfix. Declared ENV ignorable in the generated code. Should prevent warnings/errors regarding the defined but unused variable CL-EMB-INTERN::ENV From sscholl at common-lisp.net Fri Mar 11 23:25:04 2005 From: sscholl at common-lisp.net (Stefan Scholl) Date: Sat, 12 Mar 2005 00:25:04 +0100 Subject: [cl-emb-announce] New release CL-EMB 0.3.0 (API CHANGES!) Message-ID: <20050311232504.GC12435@parsec.no-spoon.de> New release CL-EMB 0.3.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: - API change: EXECUTE-EMB's optional parameters are now keyword parameters. You have to change your calls like this: OLD: (emb:execute-emb "foo" '(:language "Common Lisp")) NEW: (emb:execute-emb "foo" :env '(:language "Common Lisp")) See the added keyword :ENV before the plist. - Generator loops. The additional keyword parameter GENERATOR-MAKER to EXECUTE-EMB lets you supply a function, which returns a generator function. Generator functions are described on http://www.cs.northwestern.edu/academics/courses/325/readings/graham/generators.html Basically these are functions which answer to command codes :TEST (==> return true when there's no further data from the generator), :GET (==> return current value), :NEXT (==> return next value) The new template tags @genloop and @endgenloop are used to build a loop which uses this generator function. First the function supplied to GENERATOR-MAKER is called with the corresponding keyword to the parameter of @genloop and the value in the plist with this key. ("<% @genloop foo %>" ==> first parameter :FOO, second parameter (getf env :foo)). The loop itself tests if there are further values for iterations by calling the generator function with the command :TEST. Then the first value is fetched with :NEXT. (No :GET is used at the moment.) The returned values have to be plists. A simple example from the README: CL-USER> (emb:register-emb "test10" "Square root from 1 to <% @var numbers %>: <% @genloop numbers %>sqrt(<% @var number %>) = <% @var sqrt %> <% @endgenloop %>") # CL-USER> (declare (ignore key)) (let ((i 1)) #'(lambda (cmd) (ecase cmd (:test (> i n)) (:get `(:number ,i :sqrt ,(sqrt i))) (:next (prog1 `(:number ,i :sqrt ,(sqrt i)) (unless (> i n) (incf i)))))))) MAKE-SQRT-1-TO-N-GEN CL-USER> (emb:execute-emb "test10" :env '(:numbers 10) :generator-maker 'make-sqrt-1-to-n-gen) "Square root from 1 to 10: sqrt(1) = 1.0 sqrt(2) = 1.4142135 sqrt(3) = 1.7320508 sqrt(4) = 2.0 sqrt(5) = 2.236068 sqrt(6) = 2.4494898 sqrt(7) = 2.6457512 sqrt(8) = 2.828427 sqrt(9) = 3.0 sqrt(10) = 3.1622777 " From sscholl at common-lisp.net Fri Mar 18 15:09:55 2005 From: sscholl at common-lisp.net (Stefan Scholl) Date: Fri, 18 Mar 2005 16:09:55 +0100 Subject: [cl-emb-announce] New release CL-EMB 0.3.1 Message-ID: <20050318150955.GB14875@parsec.no-spoon.de> New release CL-EMB 0.3.1 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: - Bugfix regarding the template tags @include and @call The generated code wasn't correct after the API changes in 0.3.0