Arc Forumnew | comments | leaders | submitlogin
18 points by killerstorm 5900 days ago | link | parent

Common Lisp, ABCL-web(http://abcl-web.sourceforge.net/web-engine.html):

    (defun said ()
      (make-page "a" 
       (action-form (((:input :name "foo"))
                      (form-submit "s"))
        (make-page "b"
          (action-link "click here"
             (make-page "c"
                (html (:princ "you said: " (getf form-data :foo))))))))
pretty much same, modulo shortcut functions, but i'd say it's easier to understand code in ABCL-web because code flow matches control flow.


2 points by ryantmulligan 5899 days ago | link

I like the control flow better than the arc example.

-----

2 points by pg 5899 days ago | link

Defun defines something that works in urls?

-----

2 points by killerstorm 5899 days ago | link

no, direct accessibility by URL was not in original requirements, so i didn't bother with it. in ABCL-web there is one entry point and other pages are linked via action-link from it. so if i rename said to start-page it will work directly.

newer version of ABCL-web i'm currenly working on supports publishing functions by URLs, so i could write "(defpage said.." with it.

-----

2 points by pg 5898 days ago | link

Technically it was in the original requirements, which were to translate the Arc code. Would there be a way to do that in ABCL? If not I look forward to seeing it in the new version.

-----

1 point by killerstorm 5897 days ago | link

everything is possible, of course, but there's no _pretty_ way to define new named entry point. with code I currently have at hands one needs to populate table manually:

    (setf (gethash "said" *views*)
          (view-definition (action-form ...
because it was made as an experiment to submit/publish functions via web, and so there's no macro like defpage to do this.

i'm actually planning to finalize this stuff and release it as live demo -- so people can try programming it online -- soon.

-----