Verified Commit 4207b3b0 authored by Vladimir Sedach's avatar Vladimir Sedach
Browse files

Updated introduction.lisp PS-HTML example w/current PS-HTML output

parent 2806eec2
...@@ -87,16 +87,14 @@ for (var i = 0, j = arr[i]; i < 10; i = ++i, j = arr[i]) { ...@@ -87,16 +87,14 @@ for (var i = 0, j = arr[i]; i < 10; i = ++i, j = arr[i]) {
(ps (ps
(defun add-div (name href link-text) (defun add-div (name href link-text)
(document.write (funcall (getprop document 'write)
(ps-html ((:div :id name) (ps-html ((:div :id name)
"The link is: " "The link is: "
((:a :href href) link-text)))))) ((:a :href href) link-text))))))
;; compiles to ;; compiles to
" "
function addDiv(name, href, linkText) { function addDiv(name, href, linkText) {
document.write('<div id=\"' + name + '\">The link is: <a href=\"' return document.write(['<div id=\\\"', name, '\\\">The link is: <a href=\\\"', href, '\\\">', linkText, '</a></div>'].join(''));
+ href + '\">' };
+ linkText + '</a></div>');
}
" "
...@@ -243,7 +243,7 @@ ...@@ -243,7 +243,7 @@
(defpsmacro stringify (&rest things) (defpsmacro stringify (&rest things)
(if (and (= (length things) 1) (stringp (car things))) (if (and (= (length things) 1) (stringp (car things)))
(car things) (car things)
`((@ (list ,@things) join) ""))) `(funcall (getprop (list ,@things) 'join) "")))
(defun stringify (&rest things) (defun stringify (&rest things)
"Like concatenate but prints all of its arguments." "Like concatenate but prints all of its arguments."
(format nil "~{~A~}" things)) (format nil "~{~A~}" things))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment