-
11
pages
-
English
-
Documents
Description
TutorialAugust28,2007Contents1 ParenScriptTutorial 12 SettinguptheParenScriptenvironment 13 Asimpleembeddedexample 24 AddinganinlineParenScript 25 GeneratingaJavaScriptfile 46 AParenScriptslideshow 57 Customizingtheslideshow 101 ParenScriptTutorialThis chapter is a short introductory tutorial to ParenScript. It hopefully willgiveyouanideahowParenScriptcanbeusedinaLispwebapplication.2 SettinguptheParenScriptenvironmentIn this tutorial, we will use the Portable Allegroserve webserver to serve thetutorial web application. We use the ASDF system to load both Allegroserveand ParenScript. I assume you have installed and downloadedandParenscript,andknowhowtosetupthecentralregistryforASDF.(asdf:oos ’asdf:load-op :aserve); ... lots of compiler output ...(asdf:oos ’asdf:load-op :parenscript); ... lots of compiler output ...Thetutorialwillbeplacedinitsownpackage,whichwefirsthavetodefine.1(defpackage :js-tutorial(:use :common-lisp :net.aserve :net.html.generator :parenscript))(in-package :js-tutorial)Thenextcommandstartsthewebserverontheport8080.(start :port 8080)We are now ready to generate the first JavaScript enabled webpages usingParenScript.3 AsimpleembeddedexampleThe first document we will generate is a simple HTML document, which fea tures a single hyperlink. When clicking the hyperlink, a JavaScript handleropens a popup alert window with the string “Hello world”. To facilitate thedevelopment, we will factor out the HTML generation to a separate ...
-
Publié par
-
Langue
English