Stefan Scholl | 12 Mar 01:21

New release CL-EMB 0.3.0 (API CHANGES!)

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
(Continue reading)

Stefan Scholl | 12 Mar 01:34

New release CL-EMB 0.3.0 (API CHANGES!)

Hi!

0.3.1 will come next week. I have to remove one important new
entry from the TODO list:

  - Locking mechanism for threaded/multiprocessing programs.

Until then: Be careful if you use threads/multiprocessing!

Regards,
Stefan

Stefan Scholl | 19 Feb 01:12

Re: New release CL-EMB 0.3.0 (API CHANGES!)

On 2005-03-12 00:25:04, Stefan Scholl wrote:
> - 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
>   
[...]

>   A simple example from the README:

This example was broken. I fixed it in
http://common-lisp.net/project/cl-emb/README and the current
release 0.4.3.

CL-USER> (emb:register-emb "test10" "Square root from 1 to <% @var numbers %>: <% @genloop numbers
%>sqrt(<% @var number %>) = <% @var sqrt %>  <% @endgenloop %>")
#<CL-EMB::EMB-FUNCTION {581EC765}>
CL-USER> (defun make-sqrt-1-to-n-gen (key n)
           (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)
(Continue reading)


Gmane