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]) {
(ps
(defun add-div (name href link-text)
(document.write
(ps-html ((:div :id name)
"The link is: "
((:a :href href) link-text))))))
(funcall (getprop document 'write)
(ps-html ((:div :id name)
"The link is: "
((:a :href href) link-text))))))
;; compiles to
"
function addDiv(name, href, linkText) {
document.write('<div id=\"' + name + '\">The link is: <a href=\"'
+ href + '\">'
+ linkText + '</a></div>');
}
return document.write(['<div id=\\\"', name, '\\\">The link is: <a href=\\\"', href, '\\\">', linkText, '</a></div>'].join(''));
};
"
......@@ -243,7 +243,7 @@
(defpsmacro stringify (&rest things)
(if (and (= (length things) 1) (stringp (car things)))
(car things)
`((@ (list ,@things) join) "")))
`(funcall (getprop (list ,@things) 'join) "")))
(defun stringify (&rest things)
"Like concatenate but prints all of its arguments."
(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