åã®èšäºã®èªè ã¢ããªã±ãŒã·ã§ã³éçºãžã®æ ¹æ¬çãªã¢ãããŒãã¯ããã®èšäºãçè«çãããããšãæ£ããèªèã§ããŸã ã ãããã£ãŠãç§ã¯çè«ãšå®è·µã®åãšæªã®ãã©ã³ã¹ãå埩ããããšãæ¥ãã§ããŸãã
ãã®èšäºã§ã¯ãpicoLispãšåŒã°ããæ°·å±±ã®äžè§ãæããã«ããŠããŸãã ããŒã¿ããŒã¹ã®å éšãåæ£ããŒã¿ããŒã¹ã®æ§æããããã°ãæ©èœçI / Oãå€éç¶æ¿ãåãããªããžã§ã¯ãã¢ãã«ãPicoLisp Prologã«é¢ããŠã¯ãèå³æ·±ãç¹ãæ®ãããŠããŸãã...
ç§ã¯ãŸã ãåœå ã®ããã°ã©ããŒããã®åŒ·åãªããŒã«ã詳ãã調ã¹ãããšãæãã§ããŸãã
泚æãã«ããã®äžã«ã¯å€ãã®ããã¹ããšæ¬åŒ§ããããŸãïŒ
abu@software-lab.de
PicoLispã§ã®Webã¢ããªã±ãŒã·ã§ã³éçº
©Software Labã ã¢ã¬ã¯ãµã³ããŒã»ããŒã¬ãŒ
ãã®ããã¥ã¡ã³ãã§ã¯ãPicoLispã§Webã¢ããªã±ãŒã·ã§ã³ãäœæããããã®æŠèŠã説æããŸãã
XHTML / CSSãã¬ãŒã ã¯ãŒã¯ïŒä»¥åã®Java-AWTãJava-Swingãããã³ãã¬ãŒã³HTMLãã¬ãŒã ã¯ãŒã¯ãšã¯ç°ãªããŸãïŒã«çŠç¹ãåœãŠãŠããã䜿ãããããèšèšã®æè»æ§ãé«ãããã©ã°ã€ã³ãJavaScriptãCookieããŸãã¯CSSã«äŸåããŸããã
ã·ã³ãã«ãªHTTP / HTMLã°ã©ãã£ã«ã«ã€ã³ã¿ãŒãã§ã€ã¹ã«ã¯ããã€ãã®å©ç¹ããããŸããã©ã®ãã©ãŠã¶ã§ãåäœããã¹ã¯ãªããïŒ "@ lib / scrape.l"ïŒã§å®å šã«å¶åŸ¡ã§ããŸãã
ããæ£ç¢ºã«ã¯ãCSS ã䜿çšããŠã¬ã€ã¢ãŠããæ¹åã§ããŸãã ãŸãã JavaScriptãæèŒãããã©ãŠã¶ã¯ãããéããããã¹ã ãŒãºã«å¿çããŸãã ãã ãããã®ãã¬ãŒã ã¯ãŒã¯ã¯ãCSSãŸãã¯JavaScriptã«ã€ããŠäœãç¥ããªããã©ãŠã¶ãŒã§ãæ£åžžã«æ©èœããŸãã ãã¹ãŠã®äŸã¯ãw3mããã¹ããã©ãŠã¶ã§ããã¹ããããŠããŸãã
PicoLispã·ã¹ãã ã«é¢ããåºæ¬æ å ±ïŒ PicoLispãªãã¡ã¬ã³ã¹ããã³PicoLispãã¥ãŒããªã¢ã« ã HTMLããã³äžéšã®CSSãšHTTPã®ç¥èãåæãšãªããŸãã
äŸã§ã¯ãPicoLispãã°ããŒãã«ã€ã³ã¹ããŒã«ããèµ·åãããããšãæ³å®ããŠããŸãïŒ ã€ã³ã¹ããŒã«ãåç §ïŒã
éçããŒãž
PicoLispã䜿çšããŠãéçãªHTMLããŒãžãäœæã§ããŸãã HTMLã³ãŒããçŽæ¥äœæããããšãåæ§ã«å¯èœã§ãããããããã ãã§ã¯ããŸãæå³ããããŸããããããã¯å¯Ÿè©±åã¢ããªã±ãŒã·ã§ã³ã®åºç€ã圢æããã¢ããªã±ãŒã·ã§ã³ãµãŒããŒããã®ä»ã®åºæ¬æŠå¿µãç解ããããšãå¯èœã«ããŸãã
ãããŒã¯ãŒã«ã
æå°éã®ã¢ããªã±ãŒã·ã§ã³ã§éå§ããã«ã¯ãPicoLispã€ã³ã¹ããŒã«ãã£ã¬ã¯ããªã«ãproject.lããã¡ã€ã«ãäœæãã次ã®2è¡ãå ¥åããŸãã
######################################################################## (html 0 "Hello" "@lib.css" NIL "Hello World!" ) ########################################################################
ïŒæ¬¡ã®ãã¹ãŠã®äŸã§ãã®ãã¡ã€ã«ã䜿çšããã³å€æŽããŸããè¡ïŒ '#####'ïŒã®éã«ããã°ã©ã ã®ãã®ãããªéšåãçºçããå Žåã¯ãã³ããŒããŠãproject.lããã¡ã€ã«ã«è²Œãä»ãããã¿ã³ãã¯ãªãã¯ããŸãããã©ãŠã¶ããæŽæ°ãããŠçµæã衚瀺ããŸãïŒ
ã¢ããªã±ãŒã·ã§ã³ãµãŒããŒã®èµ·å
ã¿ãŒããã«ãŠã£ã³ããŠãéããPicoLispã¢ããªã±ãŒã·ã§ã³ãµãŒããŒãèµ·åããŸã
$ pil @lib/http.l @lib/xhtml.l @lib/form.l --server 8080 project.l +
ã³ãã³ãããã³ããã¯è¡šç€ºãããŸããã ãµãŒããŒã¯èµ·åããŠãããæ¥ç¶ãåŸ æ©ããŠããŸãã ãã®ç«¯æ«ã§
Ctrl-C
ã
Ctrl-C
ããå¥ã®ç«¯æ«ãŠã£ã³ããŠã§ '
killall pil
'ãå®è¡ããããšã§ãåŸã§åæ¢ã§ããŸãã
ïŒãããªãäŸã§ã¯ããã®HTTPãµãŒããŒã¯åŒãç¶ãåäœãããšæ³å®ããŠããŸãïŒ
ãã©ãŠã¶ã§URL ' httpïŒ// localhostïŒ8080 'ãéããŸãã 空çœã®ããŒãžã«1è¡ã®ããã¹ãã衚瀺ãããŸãã
ã©ã®ããã«æ©èœããŸããïŒ
äžèšã®è¡ã¯ããããã¬ãŒïŒãªãã·ã§ã³ã+ãïŒãHTTPãµãŒããŒã³ãŒãïŒã@ lib / http.lãïŒãXHTMLé¢æ°ïŒã@ lib / xhtml.lãïŒããã³GUIãã¬ãŒã ã¯ãŒã¯ïŒã@ lib / form.lãïŒãããŒãããŸãã ã€ã³ã¿ã©ã¯ãã£ããã©ãŒã ã«ã¯åŸã§å¿ èŠã«ãªããŸãïŒã
次ã«ã
server
é¢æ°ãããŒãçªå·ãšããã©ã«ãURLã§åŒã³åºãããŸãã 圌女ã¯ãç¡éã®ã«ãŒãã§çä¿¡HTTPèŠæ±ã®ãã®ããŒãããªãã¹ã³ããŸãã GETèŠæ±ãããŒã8080ã«å°çãããã³ã«ããproject.lããã¡ã€ã«ãããŠã³ããŒãããã ïŒloadïŒã䜿çšããŠå®è¡ãããŸã
ãã®ãã¡ã€ã«ã®å®è¡äžã«ãçŸåšã®åºåãã£ãã«ïŒSTDOUTïŒã«èšé²ããããã¹ãŠã®ããŒã¿ããã©ãŠã¶ãŒã«çŽæ¥éä¿¡ãããŸãã "project.l"ã®ã³ãŒãã¯ãHTMLïŒãŸãã¯ãã©ãŠã¶ãŒãç解ããå¥ã®åœ¢åŒïŒãçæããŸãã
URLæ§æ
ã¢ããªã±ãŒã·ã§ã³ãµãŒããŒã¯ãã¯ã©ã€ã¢ã³ããšURLã亀æãããšãã«ããããã«ç¹æ®ãªæ§æã䜿çšããŸãã URLã®ããã¹ãéšåã¯ãããªãã³ã°åŸã«æ®ããŸã
- ãããã³ã«ããã¹ããããã³ããŒãã®ä»æ§ã
- æåŸã®çå笊ãšåŒæ°ã
ããã€ãã®ã«ãŒã«ã«åŸã£ãŠè§£éãããŸãã ãããã®æãéèŠãªãã®ïŒ
- ãã¹ãæåç¬ŠïŒ 'ïŒ'ïŒã§å§ãŸãå Žåãæ®ãïŒ 'ïŒ'ãªãïŒã¯Lispé¢æ°ã®ååãšèŠãªãããŸãã çå笊ã®åŸã®ãã¹ãŠã®åŒæ°ã¯ããã®é¢æ°ã«æž¡ãããŸãã
- ãã¹ãã.lãïŒå°æåã®ããããšãLãïŒã§çµããå ŽåãLispãã¡ã€ã«ã®ååãšã¿ãªããã ïŒloadïŒã䜿çšããŠããŒããããŸã ã ããã¯æãäžè¬çãªã±ãŒã¹ã§ãããproject.lã®äŸã§äœ¿çšããŸãã
- ãã¡ã€ã«åæ¡åŒµåãã°ããŒãã«mime
*Mimes
ã¿ã€ãããŒãã«ã®ãšã³ããªãšäžèŽããå Žåããã¡ã€ã«ã¯mime-typeãšãã®ããŒãã«ããååŸããmax-ageå€ãšãšãã«ã¯ã©ã€ã¢ã³ãã«éä¿¡ãããŸãã - ãã以å€ã®å Žåããã¡ã€ã«ã¯MIMEã¿ã€ããapplication / octet-streamãã§æ倧ç§æ°1ç§ã§ã¯ã©ã€ã¢ã³ãã«éä¿¡ãããŸãã
ã¢ããªã±ãŒã·ã§ã³ã¯ã
mime
é¢æ°ã®å¶éãªãã«
*Mimes
ããŒãã«ãå±éãŸãã¯å€æŽã§ããŸãã äŸãã°
(mime "doc" "application/msword" 60)
1åéã®max-ageã§æ°ããMIMEã¿ã€ããå®çŸ©ããŸãã
ãã¹ãšçå笊ã®åŸã®URLã®åŒæ°ã®å€ã¯ãLispããŒã¿åãä¿æãããããªæ¹æ³ã§ãšã³ã³ãŒããããŸãã
- éåžžã®èšå·ïŒå éšèšå·ïŒã¯ãã«èšå·ïŒã$ãïŒã§å§ãŸããŸã
- çªå·ã¯ãã©ã¹èšå·ïŒ+ïŒã§å§ãŸããŸã
- å€åïŒããŒã¿ããŒã¹ãªããžã§ã¯ãïŒã¯ããã·ã¥ïŒ '-'ïŒã§å§ãŸããŸã
- ãªã¹ãïŒã·ã³ã°ã«ã¬ãã«ã®ã¿ïŒã¯ã¢ã³ããŒã¹ã³ã¢ïŒ '_'ïŒã§ãšã³ã³ãŒããããŸã
- ãã以å€ã®å Žåã¯ãééæåïŒéåžžã®æååïŒ
ãã®ããã«ããŠãé«ã¬ãã«ã®ããŒã¿åãURLã§ãšã³ã³ãŒããããé¢æ°ã«çŽæ¥æž¡ããããã¡ã€ã«ãããŠã³ããŒãããåã«ã°ããŒãã«å€æ°ã«å²ãåœãŠãããšãã§ããŸãã
å®å šæ§
ãã¡ãããããã¯ãLispãã¡ã€ã«ãURLããçŽæ¥ããŒãã§ããä»»æã®é¢æ°ãåŒã³åºãããšãã§ããå Žåã倧ããªã»ãã¥ãªãã£ããŒã«ã«ãªããŸãã ãã®ãããã¢ããªã±ãŒã·ã§ã³ã§ã¯ãURLã§èš±å¯ããããã¡ã€ã«ãšé¢æ°ãæ£ç¢ºã«æå®ããå¿ èŠããããŸãã ãµãŒããŒã¯ã°ããŒãã«* Allowå€æ°ããã§ãã¯ãããã®å€ã
NIL
ã§ãªãå Žåãã³ã³ãã³ããšäžèŽããªããã®ãžã®ã¢ã¯ã»ã¹ãæåŠããŸãã
ååãšããŠ
*Allow
ã¯çŽæ¥å€æŽããã èš±å¯ããã³èš±å¯æ©èœã䜿çšããŸã
(allowed ("app/") "!start" "@lib.css" "customer.l" "article.l" )
ããã¯éåžžãã¢ããªã±ãŒã·ã§ã³ã®éå§æã«åŒã³åºãããapp /ãã£ã¬ã¯ããªãéå§é¢æ°ãããã³@ lib.cssãcustome customelãããã³article.lãã¡ã€ã«ãžã®ã¢ã¯ã»ã¹ãèš±å¯ããŸãã
åŸã§ãããã°ã©ã ã§ã
*Allow
allow
ã
allow
ã§åçã«å±éã§ããŸã
(allow "!foo") (allow "newdir/" T)
ããã«ãããfooé¢æ°ãšnewdir /ãã£ã¬ã¯ããªãèš±å¯ãããèŠçŽ ã®ã»ããã«è¿œå ãããŸãã
ãã¡ã€ã«.pw
ã»ãã¥ãªãã£ç£èŠã§äœ¿çšããã«ã¯ïŒäž»ã«åŸã®äŸã®ããã«
psh
é¢æ°ã䜿çšããããïŒãPicoLispã€ã³ã¹ããŒã«ãã£ã¬ã¯ããªã«ã.pwããšããååã®ãã¡ã€ã«ãäœæããå¿ èŠããããŸãã ãã®ãã¡ã€ã«ã«ã¯ããã¹ã¯ãŒããšããŠäœ¿çšããä»»æã®ããŒã¿ã1è¡å«ãŸããŠããå¿ èŠããããŸãã
ãã®ãã¡ã€ã«ãäœæããæšå¥šæ¹æ³ã¯ãã@ lib / http.lãã§å®çŸ©ãããŠãã
pw
é¢æ°ãåŒã³åºãããšã§ã
$ pil @lib/http.l -'pw 12' -bye
ãã®ã³ãã³ããå®è¡ããŠãã ããã
html
é¢æ°
Hello Worldã®äŸã«æ»ããŸãããã åºæ¬çã«ãäžé£ã®åºåã¹ããŒãã¡ã³ããšããŠãproject.lããèšè¿°ã§ããŸãã
######################################################################## (prinl "HTTP/1.0 200 OK^M") (prinl "Content-Type: text/html; charset=utf-8") (prinl "^M") (prinl "<html>") (prinl "Hello World!") (prinl "</html>") ########################################################################
ãã ãã
html
é¢æ°ã䜿çšããæ¹ãã¯ããã«äŸ¿å©ã§ãã
ããã«ã
html
ã¯å°å·æ©èœã«ãããŸããã PicoLispã·ã§ã«ïŒ
psh
ïŒããµãŒããŒããã»ã¹ã«æ¥ç¶ãïŒãã®ããã«ã.pwããã¡ã€ã«ãçæããå¿ èŠããããŸããïŒã
html
é¢æ°ãå ¥åãããšããããç°¡åã«ç¢ºèªã§ããŸãã
$ /usr/lib/picolisp/bin/psh 8080 : (html 0 "Hello" "@lib.css" NIL "Hello World!") HTTP/1.0 200 OK Server: PicoLisp Date: Fri, 29 Dec 2006 07:28:58 GMT Cache-Control: max-age=0 Cache-Control: no-cache Content-Type: text/html; charset=utf-8 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>Hello</title> <base href="http://localhost:8080/"/> <link rel="stylesheet" type="text/css" href="http://localhost:8080/@lib.css"/> </head> <body>Hello World!</body> </html> -> </html> : # (type Ctrl-D here to terminate PicoLisp)
html
åŒæ°ïŒ
-
0
ïŒãã©ãŠã¶ãŒã®ãã£ãã·ã¥ãç£èŠããããã®max-ageå€ïŒç§åäœã§ããŒãã¯ããã£ãã·ã¥ãªãããæå³ããŸãïŒã ãŸãã«ããå€æŽãããªãããŒãžã«ã¯ããé«ãå€ãèšå®ã§ãããã£ãã·ã¥å¶åŸ¡ãç¡å¹ã«ããã«ã¯NIL
ãèšå®ã§ããŸãã -
"Hello"
ïŒããŒãžã®ååã -
"@lib.css"
ïŒCSSãã¡ã€ã«åã CSSã䜿çšããªãå Žåã¯NIL
æž¡ããŸããè€æ°ã®CSSãã¡ã€ã«ã䜿çšããå Žåã¯ãã¡ã€ã«åã®ãªã¹ããæž¡ããŸãã -
NIL
ïŒbody
ã¿ã°ã®CSSå±æ§ã®ä»æ§ïŒä»¥äžã®CSSå±æ§ã®èª¬æãåç §ïŒã
ããã4ã€ã®åŒæ°ã®åŸã«ãä»»æã®æ°ã®åŒãç¶ããããšãã§ããŸãã ãããã¯ããŒãžã®æ¬æã圢æããç¹å¥ãªèŠåã«åŸã£ãŠèšç®ãããŸãã ãããã®èŠåã¯ãéåžžã®èšç®èŠåãšã¯å°ãç°ãªããŸãã
- åŒæ°ãã¢ãã ïŒæ°å€ãŸãã¯æå/æååïŒã®å Žåããã®å€ã¯ããã«åºåãããŸãã
- ãã以å€ã®å ŽåïŒãªã¹ãïŒãLispé¢æ°ãšããŠè©äŸ¡ãããŸãïŒéåžžããããã¯printã¹ããŒãã¡ã³ãã®ããã€ãã®åœ¢åŒã§ãïŒã
ãããã£ãŠããœãŒã¹ãã¡ã€ã«ã¯æ¬¡ã®ããã«æžãããšãã§ããŸãã
######################################################################## (html 0 "Hello" "@lib.css" NIL (prinl "Hello World!") ) ########################################################################
æãäžè¬çãªå°å·æ©èœã¯ãããã€ãã®HTMLã¿ã°ã§ãã
######################################################################## (html 0 "Hello" "@lib.css" NIL (<h1> NIL "Hello World!") (<br> "This is some text.") (ht:Prin "And this is a number: " (+ 1 2 3)) ) ########################################################################
<h1>
ããã³
<br>
ã¯ã¿ã°é¢æ°ã§ãã
<h1>
ã¯ãæåã®åŒæ°ãšããŠCSSå±æ§ãåããŸãã
ht:Prin
代ããã«
ht:Prin
䜿çšããŠããããšã«æ³šæããŠãã ããã
ht:Prin
é¢æ°ã¯ãç¹æ®æåããšã¹ã±ãŒããããããHTMLããŒãžã§ã®çŽæ¥å°å·ã«äœ¿çšããå¿ èŠããããŸãã
CSSå±æ§
äžèšã®
html
é¢æ°ãšå€ãã®ã¿ã°é¢æ°ã¯ ãCSSå±æ§ã®ä»æ§ãåãå ¥ããŸãã ã¢ãã ãã³ã³ã¹ãã¢ããŸãã¯ã³ã³ã¹ãã¢ã®ãªã¹ããæå®ã§ããŸãã ãããäŸãšããŠ
<h1>
ã¿ã°ã䜿çšããŠç€ºããŸãã
ã¢ãã ïŒéåžžã¯æåãŸãã¯æååïŒã¯CSSã¯ã©ã¹åãšããŠè§£éãããŸã
: (<h1> 'foo "Title") <h1 class="foo">Title</h1>
ã³ã³ã¹ãã¢ã®å ŽåãCARã¯å±æ§åãšããŠãCDRã¯å±æ§å€ãšããŠæ±ãããŸã
: (<h1> '(id . bar) "Title") <h1 id="bar">Title</h1>
ãããã£ãŠãã³ã³ã¹ãã¢ã®ãªã¹ãã¯ãå±æ§ãšå€ã®ãã¢ã®ã»ãããæäŸããŸã
: (<h1> '((id . "abc") (lang . "de")) "Title") <h1 id="abc" lang="de">Title</h1>
ã¿ã°æ©èœ
ãã¹ãŠã®å®çŸ©æžã¿XHTMLã¿ã°é¢æ°ã¯ãã@ lib / xhtml.lãã«ãããŸãã PicoLispã³ã³ãœãŒã«ã§å®çŸ©ãå®è¡ããããproject.lãã¡ã€ã«ãç·šéããåŸã«[ãã©ãŠã¶ãŒã®æŽæ°]ãã¿ã³ãã¯ãªãã¯ããŠãå®çŸ©ã確èªããå°ãå®éšããããšããå§ãããŸãã
é©åãªPicoLispã³ã³ãœãŒã«ãååŸããã«ã¯ãå¥ã®ã¿ãŒããã«ãŠã£ã³ããŠã§PicoLispã·ã§ã«ïŒ
psh
ïŒã³ãã³ããå®è¡ããŸãïŒã¢ããªã±ãŒã·ã§ã³ãµãŒããŒãå®è¡ããã ããpwããã¡ã€ã«ãäœæããå Žåã®ã¿æ©èœããŸã ïŒ
$ /usr/lib/picolisp/bin/psh 8080 :
ãŸãã¯ãã¢ãžã¥ãŒã«ã@ lib / xhtml.lããããŒãããŠã€ã³ã¿ãŒããªã¿ãŒãå®è¡ããŸã
$ pil @lib/http.l @lib/xhtml.l + :
ããããã¹ãŠã®ã¿ã°é¢æ°ã«ã¯ã ã¿ã°é¢æ°ãè©äŸ¡ããããã®èŠåãé©çšãããããšã«æ³šæããŠãã ããã
ã·ã³ãã«ãªã¿ã°
ã»ãšãã©ã®ã¿ã°é¢æ°ã¯ã·ã³ãã«ã§ç°¡åã§ãã ãããã®ããã€ãã¯åã«åŒæ°ãåºåããŸãã
: (<br> "Hello world") Hello world<br/> : (<em> "Hello world") <em>Hello world</em>
ãã ãããããã®ã»ãšãã©ã¯ãCSSå±æ§ã®ã»ãããæåã®åŒæ°ãšããŠåãå ¥ããŸãïŒäžèšã®
<h1>
ããã«ïŒ
: (<div> 'main "Hello world") <div class="main">Hello world</div> : (<p> NIL "Hello world") <p>Hello world</p> : (<p> 'info "Hello world") <p class="info">Hello world</p>
ãããã®é¢æ°ã¯ãã¹ãŠãä»»æã®æ°ã®åŒæ°ãåããä»»æã®å ¥ãåã®æ·±ããæã€ããšãã§ããŸãïŒçµæã®HTMLããŒã¯ã¢ãããæå¹ã§ããéãïŒ
: (<div> 'main (<h1> NIL "Head") (<p> NIL (<br> "Line 1") "Line" (<nbsp>) (+ 1 1) ) ) <div class="main"><h1>Head</h1> <p>Line 1<br/> Line 2</p> </div>
ãªã¹ã
<ol>
ããã³
<ul>
ã¿ã°ã«ãã£ãŠå®è£ ãããHTMLãªã¹ãã䜿çšãããšãéå±€æ§é ãå®çŸ©ã§ããŸãã 次ã®ã³ãŒãããproject.lãã®ã³ããŒã«è²Œãä»ããŸãã
######################################################################## (html 0 "Unordered List" "@lib.css" NIL (<ul> NIL (<li> NIL "Item 1") (<li> NIL "Sublist 1" (<ul> NIL (<li> NIL "Item 1-1") (<li> NIL "Item 1-2") ) ) (<li> NIL "Item 2") (<li> NIL "Sublist 2" (<ul> NIL (<li> NIL "Item 2-1") (<li> NIL "Item 2-2") ) ) (<li> NIL "Item 3") ) ) ########################################################################
ããã§ã¯ãä»ã®ã¿ã°é¢æ°ãå«ãããã®ããªãŒã®åããŒãã«ä»»æã®ã³ãŒããé 眮ããããšãã§ããŸãã
ããŒãã«
éå±€æ§é ãšåæ§ã«ã
<table>
ããã³
<row>
é¢æ°ã䜿çšããŠ2次å ããŒãã«ãçæã§ããŸãã
次ã®äŸã¯ãæ°åãšãã®æ£æ¹åœ¢ã®è¡šã衚瀺ããŸãã
######################################################################## (html 0 "Table" "@lib.css" NIL (<table> NIL NIL NIL (for N 10 # A table with 10 rows (<row> NIL N (prin (* NN))) ) ) ) # and 2 columns ########################################################################
<table>
ã®æåã®åŒæ°ã¯éåžžã®CSSå±æ§ã2çªç®ã¯ãªãã·ã§ã³ã®ããããŒã3çªç®ã¯åããããŒã®ãªãã·ã§ã³ã®ãªã¹ãã§ãã ãã®ãªã¹ãã§ã¯ãCARã®CSSå±æ§ãšåããããŒã®ã³ã³ãã³ãã®CDRã®ã¿ã°æ¬æã䜿çšããŠãååã®ãªã¹ããæž¡ãããšãã§ããŸãã
æ¬äœ
<table>
ã«ã¯ã
<row>
é¢æ°ã®åŒã³åºããå«ãŸããŠããŸãã ãã®é¢æ°ã®ç¹åŸŽã¯ãæ¬äœã®ååŒãããŒãã«ã®åå¥ã®åã«ç§»åããããšã§ãã åèŠåºããš
<row>
é¢æ°ã«CSSå±æ§ãæå®ãããŠããå Žåããããã¯ã¹ããŒã¹ãšçµåãããŠ
<td>
æž¡ãããŸãã ããã«ãããè¡ãšåããšã«ç°ãªãCSSå±æ§ãæå®ã§ããŸãã
äžèšã®äŸã®è¡šã®æ¡åŒµãšããŠãè¡šèªäœã«ããã€ãã®å±æ§ãèšå®ããŠã¿ãŸãããïŒããã¯ãå§ãã§ããŸããããCSSãã¡ã€ã«ã§ãã®ãããªã¹ã¿ã€ã«ãå®çŸ©ããã¯ã©ã¹åã
<table>
æž¡ãããšããå§ãããŸãïŒãå€æ°ïŒèµ€ãšéïŒã®è²ãžã®æåå
######################################################################## (html 0 "Table" "@lib.css" NIL (<table> '((width . "200px") (style . "border: dotted 1px;")) # table style "Square Numbers" # caption '((align "Number") (align "Square")) # 2 headers (for N 10 # 10 rows (<row> (xchg '(red) '(blue)) # red or blue N # 2 columns (prin (* NN) ) ) ) ) ) ########################################################################
1ã€ã®ã»ã«ãè€æ°ã®åãå ããããã«ããŒãã«å ã®2ã€ä»¥äžã®ã»ã«ãçµåããå Žåã¯ãè¿œå ã®ãã©ã¡ãŒã¿ãŒ
<row>
ãšããŠã
-
ãèšå·ãæž¡ãããšãã§ããŸãã ããã«ãããã
-
ãæåã®å·ŠåŽã®ããŒã¿ãå³åŽã«å±éãããŸãã
éåžžã®ã¿ã°é¢æ°
<th>
ã
<tr>
ããã³
<td>
ããŠãããŒãã«æ§é ãçŽæ¥æå®ããããšãã§ããŸãã
ã³ã³ããŒãã³ãã®2次å é åã®ã¿ãå¿ èŠãªå Žåã¯ãããã«åçŽãª
<grid>
é¢æ°ã䜿çšã§ããŸãã
######################################################################## (html 0 "Grid" "@lib.css" NIL (<grid> 3 "A" "B" "C" 123 456 789 ) ) ########################################################################
æåã®ãã©ã¡ãŒã¿ãŒã¯åã®æ°ïŒããã§ã¯3ïŒã§ã次ã«ã»ã«ããšã«1ã€ã®åŒã§ãã æ°å€ã®ä»£ããã«ãCSSå±æ§ã®ãªã¹ããæž¡ãããšãã§ããŸãã ãã®ãªã¹ãã®é·ãã«ãããåã®æ°ã決ãŸããŸãã äžèšã®äŸã®2è¡ç®ã次ã®ããã«å€æŽã§ããŸãã
(<grid> '(NIL NIL right)
ãã®å Žåã3çªç®ã®åã¯å³æãã«ãªããŸãã
ã¡ãã¥ãŒãšã¿ãïŒã¿ãïŒ
æã匷åãª2ã€ã®ã¿ã°é¢æ°ã¯
<menu>
ãš
<tab>
ã§ãã åå¥ã«ãŸãã¯çµã¿åãããŠäœ¿çšââãããšãããã²ãŒã·ã§ã³ãã¬ãŒã ã¯ãŒã¯ã圢æããŸãã
- ãµãã¡ãã¥ãŒãéãããéãããã§ããã¡ãã¥ãŒé ç®
- å¥ã®ããŒãžã«ç§»åãããµãã¡ãã¥ãŒé ç®
- ã¿ãïŒã¿ãïŒãããŸããŸãªãµãããŒãžã«ç§»åããŸã
次ã®äŸã¯ããã¹ãŠã®èŠçŽ ã®URLãåãproject.lããŒãžã«ã€ãªãããããããŸã圹ã«ç«ã¡ãŸããããããã¯æ©èœã瀺ãã®ã«ååã§ãã
######################################################################## (html 0 "Menu+Tab" "@lib.css" NIL (<div> '(id . menu) (<menu> ("Item" "project.l") # Top level item (NIL (<hr>)) # Plain HTML (T "Submenu 1" # Submenu ("Subitem 1.1" "project.l") (T "Submenu 1.2" ("Subitem 1.2.1" "project.l") ("Subitem 1.2.2" "project.l") ("Subitem 1.2.3" "project.l") ) ("Subitem 1.3" "project.l") ) (T "Submenu 2" ("Subitem 2.1" "project.l") ("Subitem 2.2" "project.l") ) ) ) (<div> '(id . main) (<h1> NIL "Menu+Tab") (<tab> ("Tab1" (<h3> NIL "This is Tab 1") ) ("Tab2" (<h3> NIL "This is Tab 2") ) ("Tab3" (<h3> NIL "This is Tab 3") ) ) ) ) ########################################################################
<menu>
ã¯äžé£ã®ã¡ãã¥ãŒé ç®ãåãå ¥ããŸãã åã¡ãã¥ãŒé ç®ã¯ãCARãå«ãLispãªã¹ãã§ãã
-
NIL
ïŒéã¢ã¯ãã£ããªã¡ãã¥ãŒé ç®ããªã¹ãã®æ®ãã®éšåã¯ä»»æã®ã³ãŒãïŒéåžžã¯HTMLã¿ã°ïŒã§æ§æãããŸãã -
T
ïŒ2çªç®ã®èŠçŽ ã¯ãµãã¡ãã¥ãŒã®ååã§ãããã®ååãã¯ãªãã¯ãããšã察å¿ãããµãã¡ãã¥ãŒãééããŸãã ãªã¹ãã®æ«å°Ÿã¯ããµãã¡ãã¥ãŒïŒä»»æã®ãã¹ãã®æ·±ãïŒãååž°çã«å®çŸ©ããŸãã - ãã以å€ã®å ŽåïŒã¡ãã¥ãŒé ç®ã¯ïŒãµãã¡ãã¥ãŒãéãã®ã§ã¯ãªãïŒçŽæ¥ã¢ã¯ã·ã§ã³ãå®çŸ©ããŸãããªã¹ãã®æåã®èŠçŽ ã¯ã¡ãã¥ãŒèŠçŽ ã®ååã§ã2çªç®ã®èŠçŽ ã¯å¯Ÿå¿ããURLã§ãã
<tab>
ã¯ãµãããŒãžã®ãªã¹ããåãå ¥ã
<tab>
ã åããŒãžã¯åã«ã¿ãã®ååã§ããã次ã«ä»»æã®ã³ãŒãïŒéåžžã¯HTMLã¿ã°ïŒã§ãã
äžåºŠã«ã¢ã¯ãã£ãã«ã§ããã¡ãã¥ãŒãšã¿ãã¯1ã€ã ãã§ããããšã«æ³šæããŠãã ããã
ã€ã³ã¿ã©ã¯ãã£ããã©ãŒã
HTMLã§ã¯ããŠãŒã¶ãŒå ¥åã®å¯äžã®æ¹æ³ã¯ãHTTP POSTã¡ãœããã䜿çšããŠãµãŒããŒãšå¯Ÿè©±ãã
<form>
ããã³
<input>
èŠçŽ ã䜿çšããããšã§ãã
ã@ Lib / xhtml.lãã¯ã
<post>
ãšåŒã°ããé¢æ°ãšãHTMLãã©ãŒã ã®çŽæ¥ããã°ã©ãã³ã°ãå¯èœã«ããããŒã¿å ¥åã¿ã°ã®ã³ã¬ã¯ã·ã§ã³ãå®çŸ©ããŸãã ç°¡åãªäŸã1ã€ã ã瀺ããŸãã
######################################################################## (html 0 "Simple Form" "@lib.css" NIL (<post> NIL "project.l" (<field> 10 '*Text) (<submit> "Save") ) ) ########################################################################
ãã®äŸã§ã¯ãããã¹ãå ¥åãã£ãŒã«ãã
*Text
ã°ããŒãã«å€æ°ã«ãã€ã³ãããŸãã çŸåšã®å€
*Text
ãã£ãŒã«ãã«è¡šç€ºãããéä¿¡ãã¿ã³ãæŒããšããŠãŒã¶ãŒãå ¥åããæååå€ãå²ãåœãŠããã
*Text
㧠"project.l"ãåããŒããããŸãã
ã¢ããªã±ãŒã·ã§ã³ã¯ããã®å€æ°ã䜿çšããŠãããŒã¿ããŒã¹ã«å€ãä¿åãããªã©ã®äŸ¿å©ãªã¢ã¯ã·ã§ã³ãå®è¡ã§ããŸãã
ãã®ãã©ãŒã ã®ç°¡åãªäœ¿çšã«é¢ããåé¡ã¯æ¬¡ã®ãšããã§ãã
- ããã°ã©ããŒã¯ãå€æ°ã®ã°ããŒãã«å€æ°ã管çããå¿ èŠããããŸãã ããŒãžäžã®åå ¥åãã£ãŒã«ãã«ã¯ããµãŒããŒãšã¯ã©ã€ã¢ã³ãéã®éä¿¡çšã®å€æ°ãå¿ èŠã§ãã
- ã¢ããªã±ãŒã·ã§ã³ã®å
éšç¶æ
ã¯ä¿æãããŸããã åPOSTãªã¯ãšã¹ãã¯ãµãŒããŒäžã«åå¥ã®ããã»ã¹ãçæããã°ããŒãã«å€æ°ãæ°ããå€ã«èšå®ããHTMLããŒãžãçæãããã®åŸçµäºããŸãã ã¢ããªã±ãŒã·ã§ã³ã¹ããŒã¿ã¹ã¯ãããšãã°
<hidden>
ã䜿çšããŠæ瀺çã«æž¡ãå¿ èŠããããŸãã - ããŸãã€ã³ã¿ã©ã¯ãã£ãã§ã¯ãããŸããã éåžžããéä¿¡ããã¿ã³ã¯1ã€ã ãã§ãã ãŠãŒã¶ãŒã¯å€æ°ã®å ¥åãã£ãŒã«ãã«å ¥åããŸããããéä¿¡ããã¿ã³ãã¯ãªãã¯ãããå Žåã«ã®ã¿å€æŽãæå¹ã«ãªããŸãã
ãã®ã¹ã¿ã€ã«ã§ããã€ãã®ã¢ããªã±ãŒã·ã§ã³ãäœæããŸããããã@ lib / form.lãã§æäŸãããGUIãã¬ãŒã ã¯ãŒã¯ããå§ãããŸãã ã¯ã©ã€ã¢ã³ããšãµãŒããŒã®å¯Ÿè©±ã«å€æ°ã¯å¿ èŠãããŸããããã¢ããªã±ãŒã·ã§ã³ããžãã¯ããã¿ã³ã¢ã¯ã·ã§ã³ãããã³ããŒã¿éä¿¡ãæœè±¡åããããã®GUIã³ã³ããŒãã³ãã®ã¯ã©ã¹ã®éå±€ãå®è£ ããŸãã
ã»ãã·ã§ã³
ãŸãããµãŒããŒäžã«æ°žç¶çãªç°å¢ãäœæããŠãåã ã®ã»ãã·ã§ã³ãïŒæ¥ç¶ãããã¯ã©ã€ã¢ã³ãããšã«ïŒåŠçããå¿ èŠããããŸãã
æè¡çã«ã¯ãããã¯äžã§èµ·åãããµãŒããŒã®åããã»ã¹ã«ããã ãHTMLããŒãžããã©ãŠã¶ãŒã«éä¿¡ããçŽåŸã«ã¯çµäºããŸãã ã ããã¯ãã¢ããªã±ãŒã·ã§ã³åæåã³ãŒãã®ã©ããã§
app
é¢æ°ãåŒã³åºãããšã§å®çŸãããŸãã
######################################################################## (app) # Start a session (html 0 "Simple Session" "@lib.css" NIL (<post> NIL "project.l" (<field> 10 '*Text) (<submit> "Save") ) ) ########################################################################
åã®äŸãšã®éãã¯ãããŸããã ãã ãããã©ãŠã¶ãæ¥ç¶ããã¢ããªã±ãŒã·ã§ã³ãµãŒããŒãå®è¡ãããŠããã¿ãŒããã«ãŠã£ã³ããŠãèŠããšãã³ãã³ïŒPicoLispã³ãã³ãã©ã€ã³ïŒã«æ°ä»ãã§ãããã
$ pil @lib/http.l @lib/xhtml.l @lib/form.l --server 8080 project.l + :
Unix
ps
ãŠãŒãã£ãªãã£ãªã©ã®ããŒã«ã¯ã2ã€ã®
picolisp
ããã»ã¹ãçŸåšå®è¡ãããŠããããšãéç¥ããŸãã
picolisp
ããã»ã¹ã¯2
picolisp
ããã»ã¹ã®èŠªã§ãã
ãã©ãŠã¶ãŠã£ã³ããŠã®ããã¹ãããã¯ã¹ã«ãabcdefããšããã¹ããå ¥åãã[ä¿å]ãã¿ã³ãã¯ãªãã¯ããŠã
*Text
å€æ°ã調ã¹ãå Žåã
: *Text -> "abcdef"
ã¯ã©ã€ã¢ã³ãã«ãæ¥ç¶ããããŠããå°çšã®PicoLispããã»ã¹ãããããšãããããŸãã
空ã®ã³ãã³ãã©ã€ã³ã§
Ctrl-D
ãæŒããšããã®ããã»ã¹ãïŒPicoLispã®ã€ã³ã¿ã©ã¯ãã£ãã»ãã·ã§ã³ãšåæ§ã«ïŒçµäºã§ããŸãã ãã以å€ã®å Žåãã¿ã€ã ã¢ãŠãæéïŒããã©ã«ãã§ã¯5åïŒä»¥å ã«ä»ã®ãã©ãŠã¶ãŒèŠæ±ãåä¿¡ãããªãå Žåãèªåçã«çµäºããŸãã
ïŒãããã°ãªãã§ïŒå®åããŒãžã§ã³ãéå§ããã«ã¯ãéåžžããµãŒããŒã¯ã+ããã©ã°ãªãã§
-wait
ã䜿çšããŠ
-wait
$ pil @lib/http.l @lib/xhtml.l @lib/form.l --server 8080 project.l -wait
ãã®å®è¡ãªãã·ã§ã³ã䜿çšãããšãã¯ã©ã€ã¢ã³ãã®æ¥ç¶æã«ã³ãã³ãã©ã€ã³ããã³ããïŒ:)ã¯è¡šç€ºãããŸããã
ãã©ãŒã ïŒã¢ã¯ã·ã§ã³ãã©ãŒã ïŒ
åã¯ã©ã€ã¢ã³ãã®ã»ãã·ã§ã³ãã§ããã®ã§ãã¢ã¯ãã£ããªGUIãã¬ãŒã ã¯ãŒã¯ãæ§æã§ããŸãã
ãããè¡ãããã«ã
action
html
é¢æ°åŒã³åºããã©ããã
action
ãããã£å ã§ã¯
html
ãä»ã®ãã¹ãŠã®ã¿ã€ãã®ã¿ã°é¢æ°ã«å ããŠã1ã€ä»¥äžã®åŒã³åºããå¯èœã§ã
form
######################################################################## (app) # Start session (action # Action handler (html 0 "Form" "@lib.css" NIL # HTTP/HTML protocol (form NIL # Form (gui 'a '(+TextField) 10) # Text Field (gui '(+Button) "Print" # Button '(msg (val> (: home a))) ) ) ) ) ########################################################################
*Text
å ¥åãã£ãŒã«ãã®å 容ãä¿åããããã®ãªã©ã®ã°ããŒãã«å€æ°ã¯ãããªãããšã«æ³šæããŠãã ããã代ããã«ã `
a
`ã³ã³ããŒãã³ãã«ããŒã«ã«ã®ã·ã³ãã«åãä»ããŸãã
+TextField
(gui 'a '(+TextField) 10) # Text Field
ä»ã®ã³ã³ããŒãã³ããã¢ã¯ã»ã¹ããå ŽåããããŸãã
'(msg (val> (: home a)))
(: home)
ãã®GUIã³ã³ããŒãã³ããå«ããã©ãŒã ãžã®ãªã³ã¯ãåžžã«è¿ããŸããã ãã
(: home a)
-
a
çŸåšã®ãã©ãŒã ã®ã³ã³ããŒãã³ã ' ' ãžã®ãªã³ã¯ã以æ¥MSG㯠STDERRã«ãã®åŒæ°ã衚瀺ããããã®æ¹æ³ã¯ã
val>
çŸåšã®ã³ã³ããŒãã³ãã®å 容ãæœåºããæã ã¯ãã¿ã³ãæŒãããšãã«ãæã ã¯ãããã¹ãããã¯ã¹ã«å ¥åãããã³ã³ãœãŒã«ã®ããã¹ãã§è¡šç€ºãããŸãã
åå¥ã«
action
ã
form
ããŸãæå³ããªããªãããã ãããšã®å éš
html
ã§ã¯
form
ãHTMLé¢æ°ïŒããã³ãã®ä»ã®Lispé¢æ°ïŒãèªç±ã«æ··åšãããããšãã§ããŸãã
å žåçãªããŒãžã«ã¯ã次ã®æ§é ããããŸãã
(action # Action handler (html .. # HTTP/HTML protocol (<h1> ..) # HTML tags (form NIL # Form (<h3> ..) (gui ..) # GUI component(s) (gui ..) .. ) (<h2> ..) (form NIL # Another form (<h3> ..) (gui ..) # GUI component(s) .. ) (<br> ..) .. ) )
æ©èœ gui
äœå ã§æãéèŠãªæ©èœ
form
ã¯function
gui
ã§ããããã¯ãã°ã©ãã£ã«ã«ã€ã³ã¿ãŒãã§ã€ã¹ã®æ§ç¯ã®äž»åã§ãã
é¢æ°ã®å€åŽã¯
form
gui
å®çŸ©ãããŠããŸãããæåã®ãã©ã¡ãŒã¿ãŒã¯ããªãã·ã§ã³ã®ãšã€ãªã¢ã¹ãã¯ã©ã¹ã®ãªã¹ããããã³ãããã®ã¯ã©ã¹ã®ã³ã³ã¹ãã©ã¯ã¿ãŒã«å¿ èŠãªè¿œå ã®åŒæ°ã§ããåã®äŸã§èŠã
(gui 'a '(+TextField) 10) # Text Field
ããã§ãã
a
ãã¯ã¿ã€ãã³ã³ããŒãã³ãã®ãšã€ãªã¢ã¹ã§ã
(+TextField)
ãæ°å€åŒæ°
10
ãããã¹ããã£ãŒã«ãã«æž¡ãããå¹ ã決å®ãããŸããGUIã¯ã©ã¹ã®ç« ã®ä»ã®äŸãåç §ããŠãã ããã
GETãªã¯ãšã¹ã
gui
ã¯æ¬è³ªçã«ã®ããã³ããšã³ãã§ã
new
ãã³ã³ããŒãã³ããæ§ç¯ããçŸåšã®ãã©ãŒã ã®å éšæ§é ã«æ ŒçŽããã³ã³ããŒãã³ãã«ã¡ãã»ãŒãžãéä¿¡ããŠåæåããŸã
init>
ãæåŸã«ã圌ã¯ã¡ãã»ãŒãžãéä¿¡ã
show>
ãŠHTMLã³ãŒããçæãããã©ãŠã¶ãŒã«éä¿¡ããŸãã
POSTèŠæ±äžã
gui
æ°ããã³ã³ããŒãã³ãã¯äœæãããŸããã代ããã«ãæ¢åã®ã³ã³ããŒãã³ããåå©çšãããŸãããããã£ãŠã
gui
ã¡ãã»ãŒãžã³ã³ããŒãã³ããéä¿¡ãã以å€ã«äœãããå¿ èŠã¯ãããŸãã
show>
ã
å¶åŸ¡ãããŒ
HTTPã«ã¯ããã©ãŠã¶ãŠã£ã³ããŠãå€æŽããããã®2ã€ã®ã¡ãœãããGETãšPOSTã®ã¿ããããŸãããããã®2ã€ã®æ¹æ³ã¯ãæ確ã«å®çŸ©ãããæ¹æ³ã§äœ¿çšããŸãã
- GETã¯ãæ°ããããŒãžãäœæãããããšãæå³ããŸããéåžžããã©ãŠã¶ãŒã®ã¢ãã¬ã¹ãã£ãŒã«ãã«URLãå ¥åãããããªã³ã¯ïŒå€ãã®å Žåããµãã¡ãã¥ãŒãŸãã¯ã¿ãã®èŠçŽ ïŒãã¯ãªãã¯ããŠãããŒãžã«åããŠã¢ã¯ã»ã¹ãããšãã«äœ¿çšãããŸãã
- POSTã¯åžžã«åãããŒãžã«ã€ãªãããŸãããã©ãŒã äžã®ãã¿ã³ãæŒãããšã§éå§ããã察å¿ãããã©ãŒã ã®ããŒã¿æ§é ãæŽæ°ãããã®ãã¿ã³ã«é¢é£ä»ããããã³ãŒããå®è¡ããŸãã
ãã¿ã³ã«é¢é£ä»ããããã³ãŒãã¯ãã»ãšãã©ãã¹ãŠãå®è¡ã§ããŸãïŒå ¥åãã£ãŒã«ãã®å 容ã®èªã¿åããšå€æŽãããŒã¿ããŒã¹ãšã®éä¿¡ãã¡ãã»ãŒãžãšãã€ã¢ãã°ããã¯ã¹ã®è¡šç€ºããŸãã¯GETãªã¯ãšã¹ãã§ã®POSTãªã¯ãšã¹ãã®åœé ã¯ããŸã£ããç°ãªãããã¥ã¡ã³ãã®è¡šç€ºã«ã€ãªãããŸãïŒURLã®å€æŽãåç §ïŒã¢ãã¬ã¹ïŒã
GETã¯ããµãŒããŒäžã«ãã¹ãŠã®GUIã³ã³ããŒãã³ããæ§ç¯ããŸãããããã®ã³ã³ããŒãã³ãã¯ããã©ãŠã¶ãŒã®HTMLããŒãžã®ç¶æ ãšåäœãã«ãã»ã«åãããªããžã§ã¯ãã§ãããã¿ã³ãæŒããããã³ã«ãããŒãžã¯POSTãªã¯ãšã¹ãã§ãªããŒããããŸãã次ã«ããã©ãŠã¶ã«ããŒã¿ãéä¿¡ããåã«ãå¶åŸ¡ãé¢æ°ã«è»¢éãããŸã
action
ããã¹ãŠã®ã³ã³ããŒãã³ãã®ãšã©ãŒãã§ãã¯ãå®è¡ããHTMLããŒãžã§ã®ãŠãŒã¶ãŒå ¥åãåŠçããåã³ã³ããŒãã³ãã®å€ãç®çã®åœ¢åŒïŒããã¹ããæ°å€ãæ¥ä»ããªããžã§ã¯ããªã©ïŒã§ä¿åããŸãã
ãã©ãŒã ã®ç¶æ ã¯æéãšãšãã«æç¶ããŸãããŠãŒã¶ãŒããã©ãŠã¶ãŒã®æ»ããã¿ã³ã䜿çšããŠåã®ããŒãžã«æ»ããšããã®ç¶æ ãåéãããPOSTèŠæ±ã«ãã£ãŠå床éä¿¡ã§ããŸãã
次ã®ç°¡åãªäŸã§ã¯ã2ã€ã®ããã¹ããã£ãŒã«ãã衚瀺ããŠããŸããããœãŒã¹ããã£ãŒã«ãã«ããã¹ããå ¥åããå Žåãããããã®ãã¿ã³ãã¯ãªãã¯ããŠããå®å ããã£ãŒã«ãã«å€§æåãŸãã¯å°æåã§ã³ããŒã§ããŸãã
######################################################################## (app) (action (html 0 "Case Conversion" "@lib.css" NIL (form NIL (<grid> 2 "Source" (gui 'src '(+TextField) 30) "Destination" (gui 'dst '(+Lock +TextField) 30) ) (gui '(+JS +Button) "Upper Case" '(set> (: home dst) (uppc (val> (: home src))) ) ) (gui '(+JS +Button) "Lower Case" '(set> (: home dst) (lowc (val> (: home src))) ) ) ) ) ) ########################################################################
[
+Lock
å®å ]ãã£ãŒã«ãã®ãã¬ãã£ãã¯ã¹ã¯ã©ã¹ã«ããããã®ãã£ãŒã«ãã¯èªã¿åãå°çšã«ãªããŸãããã®ãã£ãŒã«ãã«ããã¹ããå ¥åããå¯äžã®æ¹æ³ã¯ããã¿ã³ã®1ã€ã䜿çšããããšã§ãã
URLåãæ¿ã
ã¢ã¯ã·ã§ã³ã³ãŒãïŒãã¿ã³ïŒã¯
html
ãHTTPããããŒãéä¿¡ããåã«å®è¡ããããããçŸåšã®ããŒãžã«å²ã蟌ãã§ããŠãŒã¶ãŒã«äœãä»ã®ãã®ãæ瀺ã§ããŸããå¥ã®HTMLããŒãžã®å ŽåããããŸãããéåžžã®ãªã³ã¯ã§ååãªã®ã§ãããã¯ããŸãèå³æ·±ãã±ãŒã¹ã§ã¯ãããŸããã代ããã«ãã³ãŒãã«ãããåçã«çæãããããŒã¿ãããŒããããå ŽåããããŸãã
次ã®äŸã¯ãããã¹ãããã¯ã¹ãš2ã€ã®ãã¿ã³ã瀺ããŠããŸããããã¹ãé åã«å ¥åãããããã¹ãã¯ãæåã®ãã¿ã³ããããã¹ããã¡ã€ã«ã«ãšã¯ã¹ããŒãããããã2çªç®ã®ãã¿ã³ããPDFããã¥ã¡ã³ãã«ãšã¯ã¹ããŒããããŸãã
######################################################################## (load "@lib/ps.l") (app) (action (html 0 "Export" "@lib.css" NIL (form NIL (gui '(+TextField) 30 8) (gui '(+Button) "Text" '(let Txt (tmp "export.txt") (out Txt (prinl (val> (: home gui 1)))) (url Txt) ) ) (gui '(+Button) "PDF" '(psOut NIL "foo" (a4) (indent 40 40) (down 60) (hline 3) (font (14 . "Times-Roman") (ps (val> (: home gui 1))) ) (hline 3) (page) ) ) ) ) ) ########################################################################
ïŒã¯ã©ã¹ã«2ã€ã®åŒæ°
+TextField
ïŒå¹ ãšé«ãïŒãæž¡ããšãèŠçŽ ãäœæãããŸã
textarea
ïŒ
æåã®ãã¿ã³ã®ã¢ã¯ã·ã§ã³ã³ãŒãã¯äžæãã¡ã€ã«ïŒã€ãŸããçŸåšã®ããã»ã¹ã®äžæãã£ã¬ã¯ããªã«ãããexport.txtããšããååã®ãã¡ã€ã«ïŒãäœæããããã¹ãé åã®å€ãå°å·ããŸãïŒä»åã¯guièŠçŽ ã«ååãä»ããã®ã§ã¯ãªãããã®ãã¡ã€ã«å ã®ãã©ãŒã ã®æåã®èŠçŽ ãšããŠåç §ããã ã
url
ã§ããã¡ã€ã«åãæã€é¢æ°ãåŒã³åºãããŸãã
2çªç®ã®ãã¿ã³ã¯ã@ lib / ps.l PostScriptã©ã€ãã©ãªã䜿çšããŠããfoo.pdfããšããäžæãã¡ã€ã«ãäœæããŸããããã¯ãäžæãã¡ã€ã«ã®äœæãšé¢æ°ã®åŒã³åºã
url
ãå éšã«é ãããŠããå Žæ
psOut
ã§ãããã®çµæããã©ãŠã¶ã¯PDFããã¥ã¡ã³ããåä¿¡ããŠââ衚瀺ããŸãã
ã¢ã©ãŒããšãã€ã¢ãã°
å®éãã¢ã©ãŒããšãã€ã¢ãã°ã¯ã以åèŠããã®ãšãŸã£ããåãã§
ã¯ãããŸãã;-) ãããã¯ãããã¢ããã§ã¯ãããŸããããã®ãã¬ãŒã ã¯ãŒã¯ã§ã¯ããããã¯äºåå®çŸ©ãããã¿ã€ãã®äœ¿ãããã圢åŒã§ãããã¿ã³ã³ãŒãããåŒã³åºãããšãã§ããããããäœæãããã©ãŒã ã®çŽåã®çŸåšã®ããŒãžã«åžžã«è¡šç€ºãããŸãã
2ã€ã®ã¢ã©ãŒããšãã€ã¢ãã°ããã¯ã¹ã䜿çšããäŸãèŠãŠã¿ãŸããããæåã¯ãããã¯ãããããã¹ãããã¯ã¹ãš2ã€ã®ãã¿ã³ãæã€ã·ã³ãã«ãªãã©ãŒã ã衚瀺ããŸã
######################################################################## (app) (action (html 0 "Alerts and Dialogs" "@lib.css" NIL (form NIL (gui '(+Init +Lock +TextField) "Initial Text" 20 "My Text") (gui '(+Button) "Alert" '(alert NIL "This is an alert " (okButton)) ) (gui '(+Button) "Dialog" '(dialog NIL (<br> "This is a dialog.") (<br> "You can change the text here " (gui '(+Init +TextField) (val> (: top 1 gui 1)) 20) ) (<br> "and then re-submit it to the form.") (gui '(+Button) "Re-Submit" '(alert NIL "Are you sure? " (yesButton '(set> (: home top 2 gui 1) (val> (: home top 1 gui 1)) ) ) (noButton) ) ) (cancelButton) ) ) ) ) ) ########################################################################
ãã¬ãã£ãã¯ã¹ã¯ã©ã¹
+Init
ã¯ããMy Textããã£ãŒã«ããæååãInitial Textãã§åæåããŸãããã£ãŒã«ãã¯ããã¯ãããŠããããããã®å€ãçŽæ¥å€æŽããããšã¯ã§ããŸããã
æåã®ãã¿ã³ã«ã¯ããããã¯ã¢ã©ãŒãã§ãããšããã¢ã©ãŒãã衚瀺ãããŸãããOKããã¯ãªãã¯ããŠéããããšãã§ããŸãã
2çªç®ã®ãã¿ã³ã¯ãã¡ã€ã³ãã©ãŒã ã®ããã¹ããã£ãŒã«ãããã®å€ã®ã³ããŒãå«ãããã¹ããã£ãŒã«ããå«ããã€ã¢ãã°ã衚瀺ããŸãããåéä¿¡ããã¯ãªãã¯ãããæ¬åœã«ããããã§ããïŒããšããèŠåã«ãã¯ãããšçãããšããã®å€ãå€æŽããŠãã©ãŒã ã«éãè¿ãããšãã§ããŸãã
èšç®æ©ã®äŸ
次ã«ããã¹ããã¡ã€ã«ãproject.lããäžæçã«å»¶æããããå®è³ªçã§å®çšçãªã¹ã¿ã³ãã¢ãã³ã®äŸã«é²ã¿ãŸããåŠãã ããšã䜿çšããŠãåçŽãªbignumé»åãäœæããŸããïŒPicoLispã«ã¯1çš®é¡ã®æ°åïŒbignumsïŒç¡å¶éã®æŽæ°ïŒïŒãããªãããããBignumãïŒ
1ã€ã®ãã©ãŒã ã1ã€ã®æ°å€å ¥åãã£ãŒã«ããããã³å€ãã®ãã¿ã³ã䜿çšããŸããèšç®æ©ã®ãœãŒã¹ã³ãŒãã¯ãçŽæ¥å®è¡ãããã¹ã¯ãªããã©ãããŒãmisc / calcããšãšãã«ãPicoLispãã£ã¹ããªãã¥ãŒã·ã§ã³ïŒããšãã°ãã/ usr / share / picolisp / misc / calc.lãïŒã«ãããŸãã
calc.l
# 14may11abu # (c) Software Lab. Alexander Burger # *Init *Accu *Stack (allowed NIL "!calculator" "@lib.css") (load "@lib/http.l" "@lib/xhtml.l" "@lib/form.l") # Calculator logic (de digit (N) (when *Init (zero *Accu) (off *Init)) (setq *Accu (+ N (* 10 *Accu))) ) (de calc () (let (Fun (caar *Stack) Val (cddr (pop '*Stack))) (setq *Accu (if (and (== '/ Fun) (=0 *Accu)) (alert "Div / 0") (Fun Val *Accu) ) ) ) ) (de operand (Fun Prio) (when (>= (cadar *Stack) Prio) (calc)) (push '*Stack (cons Fun Prio *Accu)) (on *Init) ) (de finish () (while *Stack (calc)) (on *Init) ) # Calculator GUI (de calculator () (app) (action (html 0 "Bignum Calculator" "@lib.css" NIL (<h2> NIL "Bignum Calculator") (form NIL (<br> (gui '(+Var +NumField) '*Accu 60)) (<grid> 4 (gui '(+JS +Button) "±" '(setq *Accu (- *Accu))) (gui '(+Able +JS +Button) '(ge0 *Accu) (char 8730) '(setq *Accu (sqrt *Accu)) ) (gui '(+JS +Button) "\^" '(operand '** 3)) (gui '(+JS +Button) "/" '(operand '/ 2)) (gui '(+JS +Button) "7" '(digit 7)) (gui '(+JS +Button) "8" '(digit 8)) (gui '(+JS +Button) "9" '(digit 9)) (gui '(+JS +Button) "*" '(operand '* 2)) (gui '(+JS +Button) "4" '(digit 4)) (gui '(+JS +Button) "5" '(digit 5)) (gui '(+JS +Button) "6" '(digit 6)) (gui '(+JS +Button) "-" '(operand '- 1)) (gui '(+JS +Button) "1" '(digit 1)) (gui '(+JS +Button) "2" '(digit 2)) (gui '(+JS +Button) "3" '(digit 3)) (gui '(+JS +Button) "+" '(operand '+ 1)) (gui '(+JS +Button) "0" '(digit 0)) (gui '(+JS +Button) "C" '(zero *Accu)) (gui '(+JS +Button) "A" '(main)) (gui '(+JS +Button) "=" '(finish)) ) ) ) ) ) # Initialize (de main () (on *Init) (zero *Accu) (off *Stack) ) # Start server (de go () (server 8080 "!calculator") )
䜿çšããã«ã¯ãPicoLispã€ã³ã¹ããŒã«ãã£ã¬ã¯ããªã«ç§»åãã次ã®ããã«å®è¡ããŸãã
$ misc/calc
ãŸãã¯æ¬¡ã®ãããªçµ¶å¯Ÿãã¹ã§åŒã³åºããŸã
$ /usr/share/picolisp/misc/calc
ã€ã³ã¿ã©ã¯ãã£ããªPicoLispã»ãã·ã§ã³ã«ã¢ã¯ã»ã¹ããå Žåã¯ã代ããã«æ¬¡ã®ããã«éå§ããŸãã
$ pil misc/calc.l -main -go +
éåžžã©ãããããŒãžãhttpïŒ// localhostïŒ8080ããéããŸãã
é»åã®ããžãã¯ãšGUIã®ã³ãŒãã¯éåžžã«åçŽã§ãããšã³ããªãã€ã³ãã¯é¢æ°
calculator
ã§ããããã¯ïŒURLæ§æã§èª¬æãããŠããããã«ïŒæåã«ããã©ã«ãã®ãµãŒããŒURLãšããŠã次ã«POSTãªã¯ãšã¹ãã«ãã£ãŠæé»çã«åŒã³åºãããŸããèšç®æ©ãèµ·åããåŸããã¡ã€ã«ã«ã¢ã¯ã»ã¹ããå¿ èŠã¯ãããŸããã
ãããã¯ã·ã§ã³ããŒãžã§ã³ã§ã¯ããmisc / calc.lãã®å é ã«èš±å¯ãããã¹ããŒãã¡ã³ããæ¿å ¥ããããšã«æ³šæããŠãã ããïŒã»ãã¥ãªãã£ã®ç« ã§æšå¥šãããŠããŸãïŒ
(allowed NIL "!calculator" "@lib.css")
ããã«ãããåäžã®æ©èœãžã®å€éšã¢ã¯ã»ã¹ãå¶éãããŸã
calculator
ã
é»åã¯ã3ã€ã®ã°ããŒãã«å€æ°ã䜿çšã
*Init
ã
*Accu
ãããŠ
*Stack
ã
*Init
-次ã®æ°åãæŒããšããããªãŒããŒãã«ãªã»ãããããããšã瀺ãããã«ããªãã¬ãŒã¿ãã¿ã³ã«ãã£ãŠèšå®ãããããŒã«ãã©ã°ã
*Accu
-ããããªãŒïŒçŽ¯ç©å ç®åšïŒããã®å€ã¯æ°å€å ¥åãã£ãŒã«ãã«è¡šç€ºããããŠãŒã¶ãŒå ¥åãåãå ¥ããèšç®çµæãä¿åããŸãã
*Stack
ããã¯ãä¿çäžã®èšç®ïŒæŒç®åãåªå 床ãããã³äžéçµæïŒãåªå 床ã®äœãæŒç®åã§ä¿åããåªå 床ã®é«ãèšç®ãå®è¡ããããã®ã¹ãã¢ã¹ã¿ãã¯ã§ãã
ãã®æ©èœ
digit
ã¯æ°åãã¿ã³ã«ãã£ãŠåŒã³åºãããå¥ã®æ°åãããããªãŒã«è¿œå ããŸãã
ãã®é¢æ°
calc
ã¯å®éã®èšç®ã¹ããããåããŸããã¹ã¿ãã¯ããããŒã¿ãååŸãããŒãé€ç®ã確èªããå¿ èŠã«å¿ããŠãšã©ãŒã¡ãã»ãŒãžã衚瀺ããŸãã
operand
ãªãã©ã³ãã®ãã¿ã³ãåŠçããé¢æ°ãšåªå 床ãåŒæ°ãšããŠåãå ¥ããŸããåªå é äœãã¹ã¿ãã¯ã®æäžäœã®å€ãšæ¯èŒããããããå°ããå Žåã¯èšç®ã延æããŸãã
finish
æçµçµæã®èšç®ã«äœ¿çšãããŸãã
ãã®é¢æ°ã«ã¯
calculator
ãå¹ 60æåã®æ°å€å ¥åãã£ãŒã«ãã1ã€ãããŸã
(gui '(+Var +NumField) '*Accu 60)
ãã¬ãã£ãã¯ã¹ã¯ã©ã¹
+Var
ã¯ããã®ãã£ãŒã«ããã°ããŒãã«å€æ°ã«é¢é£ä»ããŸã
*Accu
ããã£ãŒã«ãå ã®ãã¹ãŠã®å€æŽããã®å€æ°ã«è¡šç€ºããããã®å€æ°ã®å€ã®å€æŽããã£ãŒã«ãã«è¡šç€ºãããŸãã
å¹³æ¹æ ¹ãã¿ã³ã«ã¯ãã¬ãã£ãã¯ã¹ã¯ã©ã¹ããããŸã
+Able
(gui '(+Able +JS +Button) '(ge0 *Accu) (char 8730) '(setq *Accu (sqrt *Accu)) )
ããããªã®çŸåšã®å€ããŒããã倧ããããšã確èªããåŒã®åœ¢åŒã®åŒæ°ã䜿çšãããšããã¿ã³ã¯ãªãã«ãªããŸãã
ãã©ãŒã ã®æ®ãã®éšåã¯ãé»åã®ãã¹ãŠã®æ©èœãã«ãã»ã«åãããã¿ã³ã®é åïŒGRIDïŒã§ãããŠãŒã¶ãŒã¯ãæ°å€ãã¿ã³ã䜿çšããããçŽæ¥å ¥åããããšã§ãå ¥åãã£ãŒã«ãã«æ°å€ãå ¥åããæŒç®åãã¿ã³ããèšç®ãå®è¡ã§ããŸãããµããŒããããŠããæŒç®ã¯ãå ç®ãæžç®ãä¹ç®ãé€ç®ã笊å·å転ãå¹³æ¹æ ¹ãææ°ã§ãïŒãã¹ãŠã®æŒç®ã¯é·æŽæ°æŒç®ã§ãïŒããã¿ã³ `
C
`ã¯ããããªãŒã®ã¿ãã¯ãªã¢ãããã¿ã³ '
A
'ã¯ä¿çäžã®èšç®ããã¹ãŠã¯ãªã¢ããŸãã
ãããŠãããããã¹ãŠã53è¡ã®ã³ãŒãã§ïŒ
ããŒãã«ïŒãã£ãŒãïŒ
ãã£ãŒã-衚圢åŒããŒã¿ã®å éšè¡šç€ºçšã®ä»®æ³ã³ã³ããŒãã³ãã
éåžžããã®ããŒã¿ã¯ãã¹ãããããªã¹ããããŒã¿ããŒã¹ã®éžæããŸãã¯åçã«çæãããããŒãã«æ å ±ã§ããã°ã©ãã䜿çšãããšãããŒã¿ãè¡ãšåïŒéåžžã¯HTML ããŒãã«ïŒã§è¡šç€ºããäžäžã«ã¹ã¯ããŒã«ããŠã察å¿ãã衚瀺GUIã³ã³ããŒãã³ãã«ãªã³ã¯ã§ããŸãã
å®éããã£ãŒããåŠçããããã®ããžãã¯ã¯ãã¬ãŒã ã¯ãŒã¯å šäœã®éèŠãªéšåã§ããããã¹ãŠã®å éšã¡ã«ããºã ã«å€§ããªåœ±é¿ãåãŒããŸããåGUIã³ã³ããŒãã³ãã¯ãæŽæ°ããã³ãŠãŒã¶ãŒã€ã³ã¿ã©ã¯ã·ã§ã³äžã«ãã®ã³ã³ãã³ããæ£ããåŠçã§ããããã«ããã£ãŒãã®äžéšã§ãããã©ãããç¥ãå¿ èŠããããŸãã
ããã¹ãããŒã¿ãšæ°å€ããŒã¿ãåéãããšããŸããããŒãã«ãäœæã§ããŸã
######################################################################## (app) (action (html 0 "Table" "@lib.css" NIL (form NIL (<table> NIL NIL '((NIL "Text") (NIL "Number")) (do 4 (<row> NIL (gui '(+TextField) 20) (gui '(+NumField) 10) ) ) ) (<submit> "Save") ) ) ) ########################################################################
2å«ããã¹ã»ãšÂ«ãã³ããŒÂ»4è¡ãããããã®åãããš
+TextField
ãš
+NumField
ã
æåã®åã«ããã¹ããå ¥åãã2çªç®ã®åã«æ°åãå ¥åã§ããŸãã[ä¿å]ãã¿ã³ãã¯ãªãã¯ãããšããããã®å€ããµãŒããŒäžã®ã³ã³ããŒãã³ãã«ä¿åãããŸãïŒãŸãã¯ã2çªç®ã®åã®è¡ãæ°å€ã§ãªãå Žåã¯ãšã©ãŒã¡ãã»ãŒãžã衚瀺ãããŸãïŒã
ãã®ãœãªã¥ãŒã·ã§ã³ã«ã¯2ã€ã®åé¡ããããŸãã
- åã
ã®ãã£ãŒã«ãã®å
¥åãååŸã§ããŸãããããšãã°
: (val> (get *Top 'gui 2)) # Value in the first row, second column -> 123
ããŒã¿æ§é å šäœãåäžã®ãªã¹ããšããŠååŸããçŽæ¥çãªæ¹æ³ã¯ãããŸããã代ããã«ããã¹ãŠã®GUIã³ã³ããŒãã³ãã調ã¹ãŠããŒã¿ãåéããå¿ èŠããããŸãã - ãŠãŒã¶ãŒã¯ã4è¡ãè¶ ããããŒã¿ãå ¥åããããšã¯ã§ããŸãããããã¯ãããã«ããŒã¿ãå ¥åããããã®ã¹ããŒã¹ãã¹ã¯ããŒã«ããŠæ¡å€§ããç°¡åãªæ¹æ³ããªãããã§ãã
ãã£ãŒãã¯æ¬¡ã®ããšãåŠçã§ããŸãã
######################################################################## (app) (action (html 0 "Chart" "@lib.css" NIL (form NIL (gui '(+Chart) 2) # Inserted a +Chart (<table> NIL NIL '((NIL "Text") (NIL "Number")) (do 4 (<row> NIL (gui 1 '(+TextField) 20) # Inserted '1' (gui 2 '(+NumField) 10) ) ) ) # Inserted '2' (<submit> "Save") ) ) ) ########################################################################
+Chart
Chartã䜿çšããŠå¶åŸ¡ããå¿ èŠãããGUIã³ã³ããŒãã³ãã®åã«ã³ã³ããŒãã³ããæ¿å ¥ããŠããããšã«æ³šæããŠãã ãããåŒæ°ã2ãã¯ãChartã2åã®ããŒã¿ãäºæããããšãæå³ããŸãã
åã³ã³ããŒãã³ãã¯ãæåã®åŒæ°ãšããŠã€ã³ããã¯ã¹çªå·ïŒããã§ã¯ã1ãããã³ã2ãïŒãåãåãã
gui
ãã®ã³ã³ããŒãã³ãããã£ãŒãå ã«å ¥ãåã瀺ããŸãã
ããã§ãæåã®åã«ãaãããbãããcãã2çªç®ã®åã«1ã2ã3ãå ¥åããå Žåãã¡ãã»ãŒãžãéä¿¡ããããšã§ããŒãã«ã®å®å šãªå 容ãååŸã§ããŸãã
val>
: (val> (get *Top 'chart 1)) # Retrieve the value of the first chart -> (("a" 1) ("b" 2) ("c" 3))
ãšããã§ããã£ãšäŸ¿å©ãªé¢æ°ã¯
chart
: (val> (chart)) # Retrieve the value of the current chart -> (("a" 1) ("b" 2) ("c" 3))
chart
ãçŸåšã®ãããŒãã«ãã€ãŸãçŸåšã®ãã©ãŒã ã§æåŸã«äœ¿çšãããæåŸã®ããŒãã«ã«ã¢ã¯ã»ã¹ããå Žåã¯ãäžèšã®æ§é ã®ä»£ããã«äœ¿çšã§ããŸãã
ã¹ã¯ããŒã«
ã¹ã¯ããŒã«ãæå¹ã«ããã«ã¯ã2ã€ã®ãã¿ã³ãè¿œå ããŸããããå®çŸ©æžã¿ã®ã¯ã©ã¹
+UpButton
ãš
+DnButton
######################################################################## (app) (action (html 0 "Scrollable Chart" "@lib.css" NIL (form NIL (gui '(+Chart) 2) (<table> NIL NIL '((NIL "Text") (NIL "Number")) (do 4 (<row> NIL (gui 1 '(+TextField) 20) (gui 2 '(+NumField) 10) ) ) ) (gui '(+UpButton) 1) # Inserted two buttons (gui '(+DnButton) 1) (----) (<submit> "Save") ) ) ) ########################################################################
äžåºŠã«1è¡ãã€äžäžã«ã¹ã¯ããŒã«ããŸãïŒåŒæ°ã1ãïŒã
ããã§ãè€æ°è¡ã®ããŒã¿ãå ¥åããäžã«ã¹ã¯ããŒã«ããŠããã«ããŒã¿ãå ¥åã§ããŸããã®ã§ããã¿ã³ïŒã¹ã¯ããŒã«ãã¿ã³ãç¡å¹ã«ãªã£ãŠãããšãã«ãéåžžã«ãéå§ãé€ãïŒÂ«ä¿å»ãæŒãå¿ èŠã¯ãããŸããä»»æã®åœ¢åŒã®ãã¿ã³ã¯ä»»æã®ã¢ã¯ã·ã§ã³ãå®è¡ããåã«ããµãŒããŒã«å€æŽãéä¿¡ããŸãã
Geté¢æ°ãšPuté¢æ°
åè¿°ããããã«ãChartã¯è¡šåœ¢åŒã®ããŒã¿ãç·šéããããã®ä»®æ³ã³ã³ããŒãã³ãã§ãããããã£ãŠãChartç¬èªã®ããŒã¿åœ¢åŒã¯ãªã¹ãã®ãªã¹ãã§ããåãµããªã¹ãã¯1è¡ã®ããŒã¿ãè¡šããåè¡èŠçŽ ã¯1ã€ã®GUIã³ã³ããŒãã³ãã«å¯Ÿå¿ããŸãã
äžèšã®äŸã§ã¯ã次ã®ãããªäžé£ã®
("a" 1)
䞊眮
(gui 1 '(+TextField) 20) (gui 2 '(+NumField) 10)
ãã ãããã®ãããª1察1ã®é¢ä¿ã¯æãŸãããªãããšããããããŸãããŠãŒã¶ãŒã«ããŸããŸãªåœ¢åŒã®å éšããŒã¿æ§é ãæ瀺ããå¿ èŠãããããŠãŒã¶ãŒå ¥åã«ã¯å éšåœ¢åŒãžã®å€æãå¿ èŠã«ãªãå ŽåããããŸãã
ãããè¡ãããã«ãChartã¯ããåæ°ãåŒæ°ã«å ããŠã2ã€ã®è¿œå ã®é¢æ°åŒæ°ãåãå ¥ããŸããæåã®é¢æ°ã¯GUIã³ã³ããŒãã³ãã«å éšè¡šçŸãé 眮ããããã«åŒã³åºããã2çªç®ã®é¢æ°ã¯GUIããå éšè¡šçŸã«ããŒã¿ãååŸããããã«åŒã³åºãããŸãã
å žåçãªäŸã¯ãããŒã¿ããŒã¹å ã®ã¯ã©ã€ã¢ã³ãã衚瀺ããããã®ããŒãã«ã§ããå éšè¡šçŸã¯é¡§å®¢ãªããžã§ã¯ãã®1次å ã®ãªã¹ãã§ããããputãã¯åãªããžã§ã¯ãããªã¹ãã«å±éããŸãïŒå§ãåãé»è©±çªå·ãäœæãªã©ïŒããŠãŒã¶ãŒãã¯ã©ã€ã¢ã³ãåãå ¥åãããšããgetãã¯ããŒã¿ããŒã¹å ã®å¯Ÿå¿ãããªããžã§ã¯ããèŠã€ããå éšè¡šçŸã«ä¿åããŸãã次ã«ãputã¯GUIã«ãããã€ããŸãã
次ã«ãããç°¡åãªäŸãèŠãŠã¿ãŸããããã°ã©ãã«ã¯ãæ°åã®ãªã¹ãã®ã¿ãå«ãŸããŠããŸãããGUIã«ã¯åæ°åã®ããã¹ã圢åŒïŒãã€ãèªïŒã衚瀺ãããŸãã
######################################################################## (app) (load "@lib/zahlwort.l") (action (html 0 "Numerals" "@lib.css" NIL (form NIL (gui '(+Init +Chart) (1 5 7) 2 '((N) (list N (zahlwort N))) car ) (<table> NIL NIL '((NIL "Numeral") (NIL "German")) (do 4 (<row> NIL (gui 1 '(+NumField) 9) (gui 2 '(+Lock +TextField) 90) ) ) ) (gui '(+UpButton) 1) (gui '(+DnButton) 1) (----) (<submit> "Save") ) ) ) ########################################################################
ã@ Lib / zahlwort.lãã¯ãã«ããŒé¢æ°ãå®çŸ©ããŸã
zahlwort
ããã®é¢æ°ã¯ãåŸã§ãputãé¢æ°ã§åœ¹ç«ã¡ãŸãã
zahlwort
çªå·ãåãããã®ååããã€ãèªã§è¿ããŸãã
ä»ãã³ãŒããèŠãŠãã ãã
(gui '(+Init +Chart) (1 5 7) 2 '((N) (list N (zahlwort N))) car )
ç§ãã¡ã¯ãæ¥é èŸã¯ã©ã¹ãdobavlaem
+Init
ã«
+Chart
ã圌ã«äžãããªã¹ãã®
(1 5 7)
åæå€ãã£ãŒãã®ãã次ã«ãã2ãïŒãã£ãŒãã«ã¯2ã€ã®åããããŸãïŒã®åŸã«ãputé¢æ°ãæž¡ããŸãã
'((N) (list N (zahlwort N)))
çªå·ãåãåãããã®çªå·ãšãã®ååã®ãªã¹ããããã³geté¢æ°ãè¿ããŸã
car )
é çªã«ãã®ãããªãªã¹ããåãããªã¹ãã®æåã®èŠçŽ ã«ãªããŸãçªå·ãè¿ããŸãã
ãã®äŸã§ã¯ããgetãã¯ãputãé¢æ°ã®éã§ããããšãããããŸãããã£ãŒããèªã¿åãå°çšïŒå ¥åãã£ãŒã«ããå«ãŸãªãïŒãŸãã¯ããã¯ã®ã¿ãå«ãïŒå ŽåïŒãGetãã¯çç¥ã§ããŸãã
2åç®ã®ãã£ãŒã«ã
(gui 2 '(+Lock +TextField) 90) ) ) )
puté¢æ°ã«ãã£ãŠäœæãããããã¹ãã衚瀺ãããŠãŒã¶ãŒå ¥åãåãå ¥ããã€ããããªãããããããã¯ãããŠããŸãã
ãã©ãŠã¶ã§ãã®ãã©ãŒã ãéããšã
(1 5 7)
ã¯ã©ã¹åŒæ°ã«åŸã£ãŠãã1 / einsããã5 /fÃŒnfããã7 / siebenãã®3ã€ã®äºåå ¥åè¡ã衚瀺ãããŸã
+Init
ãæåã®åã«æ°åãå ¥åããENTERããŒãŸãã¯ãã¿ã³ã®1ã€ãæŒããšã2çªç®ã®åã«å¯Ÿå¿ããããã¹ãã衚瀺ãããŸãã
GUIã¯ã©ã¹
åã®ç« ã§ã¯ãæã ã®ãããªGUI-ã¯ã©ã¹ã®äŸããèŠãŠãã
+TextField
ã
+NumField
ãŸãã¯
+Button
ããã°ãã°çµã¿åãããŠãæ¥é ã¯ã©ã¹ã§
+Lock
ã
+Init
ãŸãã¯
+Able
ã次ã«ãéå±€å šäœãããåºãèŠãŠãããã«äŸãè©ŠããŠã¿ãŸãã
æœè±¡ã¯ã©ã¹
+gui
ã¯ããã¹ãŠã®GUIã¯ã©ã¹ã®åºç€ã§ããdepé¢æ°ïŒãäŸåé¢ä¿ãïŒã䜿çšããŠãã¯ã©ã¹éå±€ãã©ã€ãã§ç¢ºèªã§ããŸãã
guiã¯ã©ã¹éå±€
: (dep '+gui) +gui +JsField +Button +UpButton +PickButton +DstButton +ClrButton +ChoButton +Choice +GoButton +BubbleButton +DelRowButton +ShowButton +DnButton +Img +field +Checkbox +TextField +FileField +ClassField +numField +NumField +FixField +BlobField +DateField +SymField +UpField +MailField +SexField +AtomField +PwField +ListTextField +LinesField +TelField +TimeField +HttpField +Radio -> +gui
ããšãã°
+DnButton
ããµãã¯ã©ã¹
+Button
ãšã¯äœã§ãããã確èªãããµãã¯ã©ã¹ã¯ãµãã¯ã©ã¹
+gui
ã§ããçŽæ¥æ€æ»ãã
+DnButton
: (dep '+DnButton) +Tiny +Rid +JS +Able +gui +Button +DnButton -> +DnButton
ç§ãã¡ã¯ããã®åç §
+DnButton
ããç¶æ¿ã
+Tiny
ã
+Rid
ã
+Able
ãš
+Button
ãå®éã®å®çŸ©
+DnButton
ã¯ã@ lib / form.lãã«ãããŸã
(class +DnButton +Tiny +Rid +JS +Able +Button) ...
äžè¬ã«ãã@ lib / form.lãã¯GUIãã¬ãŒã ã¯ãŒã¯ãžã®å æ¬çãªãªãã¡ã¬ã³ã¹ã§ãããæ £ããããã«æšå¥šãããŸãã
å ¥åæ¬
å ¥åãã£ãŒã«ãã¯ãã¢ããªã±ãŒã·ã§ã³ããŒã¿ã®èŠèŠçãªè¡šç€ºãæäŸããæå¹ã«ãããšããã®ããŒã¿ã®å ¥åãšå€æŽãèš±å¯ããŸãã
HTMLã¬ãã«ã§ã¯ã次ã®åœ¢åŒãåãããšãã§ããŸãã
- å ±éã®å ¥åãã£ãŒã«ã
- ããã¹ããšãªã¢
- ãã§ãã¯ããã¯ã¹
- ããããããŠã³ãªã¹ãïŒã³ã³ãããã¯ã¹ïŒ
- ãã¹ã¯ãŒãå ¥åãã£ãŒã«ã
- HTMLãªã³ã¯
- ãã¬ãŒã³HTMLããã¹ã
ã¯ã©ã¹å®è£ ãããŠãããã§ãã¯ããã¯ã¹ãé€ããŠãã§ãã¯ããã¯ã¹ããããããã¹ãŠã®HTMLçæã®è¡šçŸ
+TextField
ãªã©ããã®ããããã®ãµãã¯ã©ã¹
+NumField
ã
+DateField
ç å®éã®å€èŠ³ïŒäžèšã®ãã©ãŒã ã®1ã€ãšããŠïŒã¯ããã®åŒæ°ã«äŸåã
ãŸãããéåžžã®ãããã¹ããã£ãŒã«ãã¯æ¢ã«èŠãŸããããããã¯ãåäžã®æ°å€åŒæ°ã«ãã£ãŠäœæãããŸãããã®äŸã§ã¯ãå¹ ã10æåã®ã«ã¹ã¿ã ãã£ãŒã«ããäœæããŸãã
(gui '(+TextField) 10)
è¡æ°ã«2çªç®ã®æ°å€åŒæ°ãæå®ãããŠããå ŽåïŒãã®å Žåã¯ã4ãïŒãtextareaã衚瀺ãããŸãã
(gui '(+TextField) 10 4)
æ°å€ã®ä»£ããã«å€ã®ãªã¹ããæäŸãããšãã³ã³ãããã¯ã¹ãåŸãããŸãïŒ
(gui '(+TextField) '("Value 1" "Value 2" "Value 3"))
ãããã®åŒæ°ã«å ããŠãæååãæž¡ãããšãã§ããŸãããã®å Žåããã£ãŒã«ãã«ã¯æ¬¡ã®ã©ãã«ãä»ããããŸãã
(gui '(+TextField) 10 "Plain") (gui '(+TextField) 10 4 "Text Area") (gui '(+TextField) '("Value 1" "Value 2" "Value 3") "Selection")
æåŸã«ãåŒæ°ãªãã§ããã£ãŒã«ãã¯ãã¬ãŒã³ããã¹ããHTMLãšããŠè¡šç€ºãããŸãã
(gui '(+TextField))
ããã¯ãäž»ã«
+Var
ããã³ãªã©ã®ãã¬ãã£ãã¯ã¹ã¯ã©ã¹ãšçµã¿åãããŠ
+Obj
ããããã®ãã£ãŒã«ãã®ã³ã³ãã³ãã管çãããããããã³HTMLãªã³ã¯ãã¹ã¯ããŒã«ããŒãã«å€ãªã©ã®ç¹å¥ãªåäœã®ããã«æå³ããªããŸãã
æ°å€å ¥åãã£ãŒã«ã
+NumField
ã¡ãœããã§æ°å€ãè¿ããã¡ãœãã
val>
ã§æ°å€ãååŸã
set>
ãŸãããŠãŒã¶ãŒå ¥åãæ°å€ã«å€æã§ããªãå Žåããšã©ãŒã¡ãã»ãŒãžã衚瀺ãããŸãã
çŸåšã®ãã±ãŒã«ã§å®çŸ©ãããŠããããã«ã倧ããæ°åã¯ååäœã®åºåãèšå·ã§è¡šç€ºãããŸãã
######################################################################## (app) (action (html 0 "+NumField" "@lib.css" NIL (form NIL (gui '(+NumField) 10) (gui '(+JS +Button) "Print value" '(msg (val> (: home gui 1))) ) (gui '(+JS +Button) "Set to 123" '(set> (: home gui 1) 123) ) ) ) ) ########################################################################
+FixField
ãªãã·ã§ã³ã®åŒæ°scale-factorãå¿ èŠã§ãã¹ã±ãŒãªã³ã°ãããåºå®å°æ°ç¹æ°ãåãå ¥ã/è¿ããŸãã
å°æ°ç¹èšå·ã¯ãçŸåšã®ãã±ãŒã«ã«ãã£ãŠæ±ºãŸããŸãã
######################################################################## (app) (action (html 0 "+FixField" "@lib.css" NIL (form NIL (gui '(+FixField) 3 10) (gui '(+JS +Button) "Print value" '(msg (format (val> (: home gui 1)) 3)) ) (gui '(+JS +Button) "Set to 123.456" '(set> (: home gui 1) 123456) ) ) ) ) ########################################################################
æ¥æ
+DateField
dateåã®å€ãåãå ¥ããŠè¿ããŸãã
######################################################################## (app) (action (html 0 "+DateField" "@lib.css" NIL (form NIL (gui '(+DateField) 10) (gui '(+JS +Button) "Print value" '(msg (datStr (val> (: home gui 1)))) ) (gui '(+JS +Button) "Set to \"today\"" '(set> (: home gui 1) (date)) ) ) ) ) ########################################################################
æ¥ä»ã®è¡šç€ºããã³å ¥åã®åœ¢åŒã¯ãçŸåšã®ãã±ãŒã«ã«ãã£ãŠç°ãªããŸãïŒdatStrããã³expDatãåç §ïŒããã±ãŒã«ãå€æŽã§ããŸããäŸãã°
: (locale "DE" "de") -> NIL
ãã±ãŒã«ãéžæãããŠããªãå Žåãããã©ã«ãã®åœ¢åŒã¯YYYY-MM-DDã§ããäžéšã®äºåå®çŸ©ããããã±ãŒã«ã¯ãDD.MM.YYYYïŒDEïŒãYYYY / MM / DDïŒJPïŒãDD / MM / YYYYïŒUKïŒããŸãã¯MM / DD / YYYYïŒUSïŒãã¿ãŒã³ã䜿çšããŸãã
ãŠãŒã¶ãŒå ¥åãçŸåšã®ãã±ãŒã«ã®æ¥ä»åœ¢åŒãšäžèŽããªãå Žåããšã©ãŒãã¹ããŒãããŸãã
ãã±ãŒã«ã«é¢ä¿ãªãã
+DateField
ççž®ãŠãŒã¶ãŒå ¥åãæ¡åŒµããããšããŠããŸãïŒ
- ã7ãã¯çŸåšã®æã®7æ¥ç®ã瀺ããŸã
- ã031ããŸãã¯ã0301ãã¯ãçŸåšã®å¹Žã®1æ3æ¥ã瀺ããŸã
- ã311ããŸãã¯ã3101ãã¯çŸåšã®å¹Žã®1æ31æ¥ãè¡šããŸã
- ã0311ãã¯ä»å¹Žã®11æ3æ¥ãäžããŸã
- ã01023ããŸãã¯ã010203ãã¯2003幎2æ1æ¥ã«äžããããŸãã
- ãªã©ãªã©
åæ§ã®ã¯ã©ã¹ã¯
+TimeField
ã§ããæéå€ãåããè¿ããŸãã
######################################################################## (app) (action (html 0 "+TimeField" "@lib.css" NIL (form NIL (gui '(+TimeField) 8) (gui '(+JS +Button) "Print value" '(msg (tim$ (val> (: home gui 1)))) ) (gui '(+JS +Button) "Set to \"now\"" '(set> (: home gui 1) (time)) ) ) ) ) ########################################################################
ãã®äŸã®ããã«ãã£ãŒã«ãå¹ ãã8ãã®å Žåãæå»ã¯åœ¢åŒã§è¡šç€ºãããŸã
HH:MM:SS
ãå¥ã®å¯èœãªå€-ã5ãã¯
+TimeField
ãå€ããã©ãŒã ã«è¡šç€ºããŸã
HH:MM
ã
ãŠãŒã¶ãŒå ¥åãæéå€ã«å€æã§ããªãå Žåããšã©ãŒãã¹ããŒãããŸãã
ãŠãŒã¶ãŒã¯ã³ãã³ãçç¥ã§ããŸããæ¥ä»ãšåæ§ã«ãäžå®å šãªå ¥åãå€æãããŸããã125ãã¯ã12:05ãã«ãã124517ãã¯ã12:45:17ããªã©ã«å€æãããŸãã
é»è©±çªå·
é»è©±çªå·ã®å éšè¡šçŸïŒåœã³ãŒãïŒå è¡ç¬Šå·ãªãããã©ã¹ãŸãã¯ãŒãïŒãããŒã«ã«é»è©±çªå·ïŒã¹ããŒã¹ã§åºåãã®ãçæ³çïŒããã³è¿œå çªå·ïŒãã€ãã³ã§åºåãã®ãçæ³çïŒãé»è©±çªå·ã®æ£ç¢ºãªåœ¢åŒã¯GUIã«ãã£ãŠåŒ·å¶ããããã®ã§ã¯ãããŸãããããããªãåŠçïŒããŒã¿ããŒã¹ã®æ€çŽ¢ãªã©ïŒã§ã¯ãåçŸæ§ãé«ããããã«éåžžã¯ãã©ãŒã«ãã䜿çšãããŸãã
é»è©±çªå·ã衚瀺ãã
+TelField
ã«ã¯ãçŸåšã®ãã±ãŒã«ã®åœã³ãŒãã®å Žåã¯åœã³ãŒãããŒãã«çœ®ãæããŸããå€åœã³ãŒãã®å Žåã¯ãã®åã«ãã©ã¹èšå·ãä»ããŸãïŒtelStrãåç §ïŒã
ãŠãŒã¶ãŒãå ¥åããçªå·ã«ã€ããŠã¯ããã©ã¹èšå·ãŸãã¯äºéãŒãã¯åã«ç Žæ£ãããŸãããå è¡ãŒãã®1ã€ã¯çŸåšã®ãã±ãŒã«ã®åœã³ãŒãã«çœ®ãæããããŸãïŒexpTel ïŒ
######################################################################## (app) (locale "DE" "de") (action (html 0 "+TelField" "@lib.css" NIL (form NIL (gui '(+TelField) 20) (gui '(+JS +Button) "Print value" '(msg (val> (: home gui 1))) ) (gui '(+JS +Button) "Set to \"49 1234 5678-0\"" '(set> (: home gui 1) "49 1234 5678-0") ) ) ) ) ########################################################################
ãã§ãã¯ããã¯ã¹
ã¯ã©ã¹
+Checkbox
ã¯åçŽã§ãããŠãŒã¶ãŒã®æäœã¯ããªã³ãšãªãã®åãæ¿ãã«å¶éãããŠããŸããããã¯ãè«çå€ïŒãšã
NIL
ãŸãã¯é
NIL
ïŒãåã³ãªã¿ãŒã³
T
ãŸãã¯
NIL
ã
######################################################################## (app) (action (html 0 "+Checkbox" "@lib.css" NIL (form NIL (gui '(+Checkbox)) (gui '(+JS +Button) "Print value" '(msg (val> (: home gui 1))) ) (gui '(+JS +Button) "On" '(set> (: home gui 1) T) ) (gui '(+JS +Button) "Off" '(set> (: home gui 1) NIL) ) ) ) ) ########################################################################
ãã£ãŒã«ããã¬ãã£ãã¯ã¹ã¯ã©ã¹
ãã¬ãŒã ã¯ãŒã¯ã®æ©èœã®ã»ãšãã©ã¯ãGUIããã³ããŒã¿ããŒã¹ãªããžã§ã¯ãã®ã¯ã©ã¹ãã¬ãã£ãã¯ã¹ã®çµã¿åããã®æè»æ§ã«ãã£ãŠèª¬æãããŸãããããã䜿çšãããšãç¶æ¿ããªãŒå ã®åã ã®ã¡ãœããããæäœæ¹æ³ãã§ããªãŒããŒã©ã€ããã§ããããŸããŸãªæ¹æ³ã§çµã¿åãããŠä»»æã®åäœãå®çŸã§ããŸãã
æè¡çã«ã¯ããã¬ãã£ãã¯ã¹ã¯ã©ã¹ã«ã€ããŠç¹å¥ãªããšã¯ãããŸããããããã¯æ®éã®ã¯ã©ã¹ã§ãããªããžã§ã¯ããŸãã¯ã¯ã©ã¹ã®ã¹ãŒããŒã¯ã©ã¹ãªã¹ãå ã®ä»ã®ã¯ã©ã¹ã®åã«æ¿å ¥ãããããšãæå³ããŠãããããããã¬ãã£ãã¯ã¹ããšåŒã°ããŸãã
éåžžãããã
T
ã¯åŒæ°ãªã¹ãããé¢æ°ãžã®ã¡ãœããã®åŒæ°ãåãå ¥ããŸã
gui
ïŒã¡ãœãã
T
ã¯ã³ã³ã¹ãã©ã¯ã¿ãŒïŒç¿»èš³è ã«ããã³ã¡ã³ãïŒã§ãïŒã
åæå
+Init
init>
ãã®ã³ã³ããŒãã³ãã®ã¡ãœããããªãŒããŒã©ã€ãããŸããããŒãžãæåã«ããŒãããããšãã«ïŒGETèŠæ±ã®éã«ïŒã¡ãã»ãŒãžãã³ã³ããŒãã³ãã«
init>
éä¿¡ãããŸã
+gui
ã
+Init
ãã®ãã£ãŒã«ãã®åæå€ã®åŒãåããŸãã
(gui '(+Init +TextField) "This is the initial text" 30)
ãã£ãŒã«ãã®å€ãèªåçã«èšå®ããä»ã®ã¯ã©ã¹ã¯ã
+Var
ïŒãã£ãŒã«ããå€æ°ã«
+E/R
ãªã³ã¯ããïŒãšïŒãã£ãŒã«ããããŒã¿ããŒã¹ã«ãªã³ã¯ããïŒã§ãã
+Cue
ããšãã°ããå¿ é ããã£ãŒã«ãã§äœ¿çšããŠãå ¥åããå 容ããŠãŒã¶ãŒã«ä¿ãããšãã§ããŸãããã®å€ã衚瀺ããããšããäºå®ã«ããããããããã£ãŒã«ãå€ãçãã
NIL
ãã¡ãœãã
val>
ããè¿ãå Žåã«ã®ã¿ãåŒæ°ã®å€ãå±±æ¬åŒ§
NIL
ã§è¡šç€ºããŸãã
空ã®ãã£ãŒã«ããåŒã³åºããŠã<ããã«ããã¹ããå ¥å>ãã衚瀺ããŸãã
(gui '(+Cue +TextField) "Please enter some text here" 30)
æå¹åããã³ç¡å¹å
GUIã®éèŠãªæ©èœã¯ãåã ã®ã³ã³ããŒãã³ããŸãã¯ãã©ãŒã å šäœã®ç¶æ³äŸåã®ç¡å¹åãšæå¹åã§ãã
+Able
ã¯ã©ã¹ã®ãã¬ãã£ãã¯ã¹ã¯åŒæ°åŒæ°ãåãããã®åŒãã«è©äŸ¡ãããå Žåãã³ã³ããŒãã³ããç¡å¹ã«ããŸã
NIL
ãé»åã®å¹³æ¹æ ¹ãã¿ã³ã§ã®äœ¿çšäŸãèŠãŸããããŸãã¯ãã¯ãªã¹ãã¹åŸã«ã®ã¿ãªã³ã«ãããã¿ã³ãæ³åããŠãã ãã
(gui '(+Able +Button) '(>= (cdr (date (date))) (12 24)) "Close this year" '(endOfYearProcessing) )
ãŸãã¯ãã¹ã¯ãŒãå ¥åãã£ãŒã«ãããã°ã€ã³åŸã«ç¡å¹ã«ãªããŸã
(gui '(+Able +PwField) '(not *Login) 10 "Password")
ç¹å¥ãªã±ãŒã¹ã¯prefixã§
+Lock
ãããã¯ç¡æ¡ä»¶ã«ã³ã³ããŒãã³ããç¡å¹ã«ããŸãã圌ã¯è°è«ãåãå ¥ããªã
(gui '(+Lock +NumField) 10 "Count")
ïŒã10ããšãCountãã¯ã®åŒæ°ã§ã
+NumField
ïŒãèªã¿åãå°çšãã£ãŒã«ããäœæããŸããåŒæ°ãªãã§
åŒã³åºã
disable
ãšããã©ãŒã å šäœãç¡å¹ã«ã§ã
NIL
ãŸããããã¯ããã®ãã©ãŒã ã®ãã¹ãŠã®ã³ã³ããŒãã³ãã«åœ±é¿ããŸããäžèšã®äŸã䜿çšããŠãã¯ãªã¹ãã¹åã«èªã¿åãå°çšãã©ãŒã ãäœæã§ããŸã
(form NIL (disable (> (12 24) (cdr (date (date))))) # Disable whole form (gui ..) .. )
ãã ããå®å šã«ããã¯ããããã©ãŒã ã§ãã£ãŠãããã©ãŒã ã®ã³ã³ãã³ãã«åœ±é¿ãäžããªãããã²ãŒã·ã§ã³ãã¹ã¯ããŒã«ããŸãã¯ãã®ä»ã®ã¢ã¯ã·ã§ã³ã«å¿ èŠãªãããç¹å®ã®ã³ã³ããŒãã³ããå«ããå¿ èŠããããŸããããã¯ããã¬ãã£ãã¯ã¹ãæå®ããããšã§è¡ãããŸã
+Rid
ã
(form NIL (disable (> (12 24) (cdr (date (date))))) (gui ..) .. (gui '(+Rid +Button) ..) # Button is enabled despite the disabled form .. )
æžåŒèšå®
GUIãã¬ãã£ãã¯ã¹ã¯ã©ã¹ã䜿çšãããšãã³ã³ããŒãã³ãã«å€ãä¿åããã³ååŸããæ¹æ³ã现ããå¶åŸ¡ã§ããŸãããªã©ã®ãããªã¯ã©ã¹ãå®çŸ©æžã¿ã®
+NumField
ã
+DateField
ã圌ãã¯ã¡ãœããããªãŒããŒã©ã€ãããŸã
set>
ã
val>
ã
+Set
ãã£ãŒã«ãã«å€ãå²ãåœãŠããããã³ã«åŒã³åºãããåŒæ°é¢æ°ãåãå ¥ããŸãããã¹ãŠã®ãŠãŒã¶ãŒå ¥åã倧æåã«å€æããã«ã¯
(gui '(+Set +TextField) uppc 30)
+Val
ã¯ã«è¿œå ãã
+Set
ãŸãããã£ãŒã«ãå€ãååŸããããã³ã«åŒã³åºãããé¢æ°ãåããŸãããã£ãŒã«ãå€ã®äºä¹ãè¿ãã«ã¯
(gui '(+Val +NumField) '((N) (* NN)) 10)
+Fmt
-ããã¯åãªãçµã¿åããã§
+Set
ãã
+Val
ã2ã€ã®æ©èœçãªåŒæ°ãåããŸãããã®äŸã§ã¯ãããã¹ãã¯å€§æåã§è¡šç€ºãããå°æåã§è¿ãããŸã
(gui '(+Fmt +TextField) uppc lowc 30)
+Map
ïŒãªã©
+Fmt
ïŒã¯åæ¹åãããŒããã£ã¹ããçæããŸããç·åœ¢æ€çŽ¢ã«ã³ã³ã¹ãã¢ãªã¹ãã䜿çšããŸããCARã¯ãCDRã®å€ã«å éšçã«ãããã³ã°ããããããã³ã°å€ãè¡šããŸããããã»ã¹
set>
ãŸãã¯ã®ãã®ãªã¹ãã«å€ãèŠã€ãããªãå Žåã
val>
ããã®ãŸãŸãéä¿¡ãããŸãã
éåžž
+Map
ãã³ã³ãããã¯ã¹ãšçµã¿åãããŠäœ¿çšââãããŸãïŒå ¥åãã£ãŒã«ããåç §ïŒããã®äŸã§ã¯ããŠãŒã¶ãŒOneãTwoãããã³Threeã衚瀺ããŸãããæ°å€1ã2ããŸãã¯3ãè¿ããŸã
######################################################################## (app) (action (html 0 "+Map" "@lib.css" NIL (form NIL (gui '(+Map +TextField) '(("One" . 1) ("Two" . 2) ("Three" . 3)) '("One" "Two" "Three") ) (gui '(+Button) "Print" '(msg (val> (field -1))) ) ) ) ) ########################################################################
å¯äœçš
GUIã§ãã¿ã³ãæŒããããã³
action
ã«ãçŸåšã®ç°å¢ã§çºçããå€æŽïŒããŒã¿ããŒã¹ãŸãã¯ã¢ããªã±ãŒã·ã§ã³ã®ç¶æ ãªã©ïŒã¯ãGUIã®å¯Ÿå¿ãããã£ãŒã«ãã«åæ ãããå¿ èŠããããŸãããããè¡ãã«ã¯ããã¹ãŠã®ã³ã³ããŒãã³ãïŒãµãŒããŒåŽïŒã«ã¡ãã»ãŒãžãéä¿¡ãããŸã
upd>
ã次ã«ãåã³ã³ããŒãã³ãã¯é©åãªæ段ïŒããŒã¿ããŒã¹ãªããžã§ã¯ãããã®æŽæ°ãå€æ°ããã®å€ã®ããŒããæ°ããå€ã®èšç®ãªã©ïŒãå®è¡ããŠããã®å€ãæŽæ°ããŸãã
ãã®ã¡ãœãã
upd>
ã¯äž»ã«ãã¬ãŒã ã¯ãŒã¯èªäœã§äœ¿çšãããŸãããæ¢åã®ã¯ã©ã¹ã§ã¯ãã¬ãã£ãã¯ã¹classã䜿çšããŠãªãŒããŒã©ã€ãã§ããŸã
+Upd
ãSTDERRã§æŽæ°ãããå€ãååŸããŸããã
######################################################################## (app) (default *Number 0) (action (html 0 "+Upd" "@lib.css" NIL (form NIL (gui '(+Upd +Var +NumField) '(prog (extra) (msg *Number)) '*Number 8 ) (gui '(+JS +Button) "Increment" '(inc '*Number) ) ) ) ) ########################################################################
æ€èšŒ
å ¥åããããŒã¿ã®èªåæ€èšŒãæå¹ã«ããããã«ãé©åãªã¿ã€ãã³ã°ã§ãã¹ãŠã®ã³ã³ããŒãã³ãã«ã¡ãã»ãŒãžãéä¿¡ãããŸã
chk>
ãå€ãæå¹ãªå Žåã察å¿ããã¡ãœããã¯
NIL
; ãè¿ãå¿ èŠããããŸããããã§ãªãå Žåããšã©ãŒã説æããæååã
å€ãã®çµã¿èŸŒã¿ã¯ã©ã¹ã«ã¯methodããã
chk>
ãŸãããã®ã¯ã©ã¹
+NumField
ã¯ãæ°å€å ¥å
+DateField
ã®æ£ç¢ºããã€ãŸãã«ã¬ã³ããŒã®æ¥ä»ã®æ£ç¢ºãããã§ãã¯ããŸãã
ãªã³ã¶ãã©ã€æ€èšŒã¯ããã¬ãã£ãã¯ã¹ã¯ã©ã¹ã䜿çšããŠå®è¡ã§ããŸã
+Chk
ã次ã®ã³ãŒãã¯ã9以äžã®æ°åã®ã¿ãåãå ¥ããŸããåŒã¯
or
æåã«æ€èšŒãã¡ã€ã³ã¯ã©ã¹ã«å§ä»»ã
+NumField
ããšã©ãŒãè¿ãããªãå Žåã¯ãçŸåšã®å€ã9ãã倧ããå Žåã«ãšã©ãŒæååãè¿ããŸãã
######################################################################## (app) (action (html 0 "+Chk" "@lib.css" NIL (form NIL (gui '(+Chk +NumField) '(or (extra) (and (> (val> This) 9) "Number too big") ) 12 ) (gui '(+JS +Button) "Print" '(msg (val> (field -1))) ) ) ) ) ########################################################################
ããç°¡åãªæ€èšŒã¯ãçµã¿èŸŒã¿ã¯ã©ã¹ã«ãã£ãŠè¡ãã
+Limit
ãŸãã
maxlength
çæãããHTMLå ¥åãã£ãŒã«ãã®å±æ§ãå¶åŸ¡ããŸãããããã£ãŠããã£ãŒã«ãã§èš±å¯ãããŠãã以äžã®æåãå ¥åããããšã¯ã§ããŸããã
######################################################################## (app) (action (html 0 "+Limit" "@lib.css" NIL (form NIL (gui '(+Limit +TextField) 4 8) (gui '(+JS +Button) "Print" '(msg (val> (field -1))) ) ) ) ) ########################################################################
ããŒã¿ãªã³ã¯
äžæ¹ã§
set>
ãš
val>
- GUIã³ã³ããŒãã³ãã®å€ãååŸããããã®æ£åŒãªæ¹æ³ãã圌ãã¯éåžžã«å€ãã®å Žåãæ瀺çã«äœ¿çšãããŠããŸããã代ããã«ãã³ã³ããŒãã³ãã¯Lispå éšããŒã¿æ§é ã«çŽæ¥é¢é£ããŠããŸããããã¯éåžžãããŒã¿ããŒã¹å€æ°ãŸãã¯ãªããžã§ã¯ãã§ãã
æ¥é èŸã¯ã©ã¹
+Var
ã¯å€æ°ãåãå ¥ããŸãïŒé¢æ°ãã£ã¬ã¯ããªã«ããŒã¿åãšããŠèšè¿°
var
-ã·ã³ãã«ãŸãã¯ã³ã³ã¹ã®ãã¢ïŒã次ã®äŸã§ã¯ãã°ããŒãã«å€æ°ãå€ãabcãã§åæåãããã£ãŒã«ã
+TextField
ããããæäœã§ããããã«ããŸãã [å°å·]ãã¿ã³ã䜿çšããŠãçŸåšã®å€ã衚瀺ã§ããŸãã
######################################################################## (app) (setq *TextVariable "abc") (action (html 0 "+Var" "@lib.css" NIL (form NIL (gui '(+Var +TextField) '*TextVariable 8) (gui '(+JS +Button) "Print" '(msg *TextVariable) ) ) ) ) ########################################################################
+E/R
ãšã³ãã£ãã£/é¢ä¿ã®æå®ãåãå ¥ããŸããããã¯ãCARã®ãªã¬ãŒã·ã§ã³ïŒããšãã°
nm
ããªããžã§ã¯ãã®ååïŒãšCDRã®åŒïŒéåžž
(: home obj)
ã
obj
çŸåšã®ãã©ãŒã ã®ããããã£ã«æ ŒçŽãããŠãããªããžã§ã¯ãïŒãšã®ã³ã³ã¹ãã¢ã§ãã
次ã®å€ç«ããåçŽãªäŸã§ã¯ãäžæããŒã¿ããŒã¹ãäœæããã°ããŒãã«å€æ°ã«ä¿åãããŠããããããã£
nr
ãš
nm
ãªããžã§ã¯ãã«ã¢ã¯ã»ã¹ããŸã
*Obj
ã
######################################################################## (when (app) # On start of session (class +Tst +Entity) # Define data model (rel nr (+Number)) # with a number (rel nm (+String)) # and a string (pool (tmp "db")) # Create temporary DB (setq *Obj # and a single object (new! '(+Tst) 'nr 1 'nm "New Object") ) ) (action (html 0 "+E/R" "@lib.css" NIL (form NIL (gui '(+E/R +NumField) '(nr . *Obj) 8) # Linkage to 'nr' (gui '(+E/R +TextField) '(nm . *Obj) 20) # Linkage to 'nm' (gui '(+JS +Button) "Show" # Show the object '(out 2 (show *Obj)) ) ) ) ) # on standard error ########################################################################
ãã¿ã³
ãã¿ã³ã¯ãã³ã³ãããŒã«ãããŒã§èª¬æãããŠããããã«ãã¢ããªã±ãŒã·ã§ã³ãµãŒããŒãšïŒPOSTèŠæ±ãä»ããŠïŒå¯Ÿè©±ããå¯äžã®æ¹æ³ã§ãã
åºæ¬çã«
+Button
åãå ¥ããŸã
- ååãæååãŸãã¯ç»åãã¡ã€ã«åã®å ŽåããããŸã
- ãã¿ã³ãç¡å¹ãªãšãã«è¡šç€ºã§ãããªãã·ã§ã³ã®ä»£æ¿å
- ããã³å®è¡å¯èœåŒã
以äžã¯ãååãšåŒãå«ãæå°éã®ãã¿ã³ã®äŸã§ãã
(gui '(+Button) "Label" '(doSomething))
ãããŠãããã¯ãã¿ã³ã®ç¶æ ã«å¿ããŠãããŸããŸãªååã®è¡šç€ºã§ãã
(gui '(+Button) "Enabled" "Disabled" '(doSomething))
ãã¬ãŒã³ããã¹ãã®ä»£ããã«ç»åã衚瀺ããã«ã¯ãã©ãã«ã®åã«èšå·ãä»ããå¿ èŠããããŸã
T
ã
(gui '(+Button) T "img/enabled.png" "img/disabled.png" '(doSomething))
ãã®ãã¿ã³ãã¯ãªãã¯ãããšãåŠçäžã«åŒãå®è¡ãããŸã
action
ïŒãã©ãŒã ãåç §ïŒã
ä»ã®ã³ã³ããŒãã³ããšåæ§ã«ããã¿ã³ãå±éãããã¬ãã£ãã¯ã¹ã¯ã©ã¹ãšçµã¿åãããããšãã§ããŸããããã«ã¯ãå€æ°ã®å®çŸ©æžã¿ã¯ã©ã¹ãšãããã®çµã¿åããã䜿çšã§ããŸãã
ãã€ã¢ãã°ãã¿ã³
ãã¿ã³ã¯ãã¢ã©ãŒããšãã€ã¢ãã°ããã¯ã¹ãåŠçããããã«äžå¯æ¬ ã§ããè¡šã®ã¹ã¯ããŒã«ããã®ä»ã®å¯äœçšãªã©ã®éåžžã®æ©èœã®ãã¿ã³ã«å ããŠãäž»ãªæ©èœã«å ããŠéç¥ãŸãã¯ãã€ã¢ãã°ããã¯ã¹ãéããããšãã§ããç¹å¥ãªãã¿ã³ããããŸãã
ãã®ãããªãã¿ã³ã¯éåžžããµãã¯ã©ã¹ã§ãã
+Close
ããããŠãããã®ã»ãšãã©ã¯ç°¡åã«ãã¬ããåã®é¢æ°ã䜿çšããŠçºçããããšãã§ã
closeButton
ã
cancelButton
ã
yesButton
ãŸãã¯
noButton
ãã¢ã©ãŒããšãã€ã¢ãã°ã§ããã€ãã®äŸãã¿ãŸããã
ã¢ã¯ãã£ããªJavaScript
ãã¿ã³ãã¯ã©ã¹ããç¶æ¿ãããŠãã
+JS
ïŒããã³ãã©ãŠã¶ãŒã§JavaScriptãæå¹ã«ãªã£ãŠããïŒå Žåãã¯ãªãã¯ã«å¯Ÿãããã¿ã³ã®å¿çãã¯ããã«éããªãå¯èœæ§ããããŸãã
ããã¯
+JS
ãéåžžã®POSTã®ä»£ããã«ãæåã«ãã¹ãŠã®GUIã³ã³ããŒãã³ãã®ã³ã³ãã³ãã®ã¿ãXMLHttpRequestãä»ããŠãµãŒããŒã«éä¿¡ããããã«å¿ããŠæŽæ°ãããå€ãååŸããããšããããã§ããããã«ãããããŒãžå šäœã®åèªã¿èŸŒã¿ãšã¬ã³ããªã³ã°ã«ããã¡ãã€ããåé¿ãããã¯ããã«é«éã«ãªããŸãããŸãããã©ãŠã¶ãŠã£ã³ããŠããã倧ããå Žåã«ããŒãžã®äžéšã«ã¹ã¯ããŒã«ããããšããããŸãããããã¯ãããŒãã«ãã¹ã¯ããŒã«ãããšãã«ç¹ã«é¡èã§ãã
ããã倱æããå Žåã®ã¿ããã©ãŒã ã¯éåžžã®POSTãªã¯ãšã¹ãã§éä¿¡ãããŸãã
ãããã£ãŠããã¬ãã£ãã¯ã¹ã䜿çšããæå³ã¯ãããŸãã
+JS
HTMLã³ãŒããå€æŽãããã¿ã³ã®å Žåã¯ããã€ã¢ãã°ããã¯ã¹ãéãããå¥ã®ããŒãžã«ç§»åããŸãããã®ãããªå ŽåãXMLHttpRequestãæåã«åŒã³åºããããããå šäœçãªããã©ãŒãã³ã¹ã¯ããã«äœäžããŸãã
ãã©ãŠã¶ã§JavaScriptãç¡å¹ã«ãªã£ãŠããå ŽåãXMLHttpRequestã¯ãŸã£ãã䜿çšãããŸããããã©ãŒã ã¯å®å šã«äœ¿çšå¯èœã§ããŸã£ããåãæ©èœãåããŠããŸãããå°ãé ããªããŸãããããã»ã©ã¹ã ãŒãºã§ã¯ãããŸããã
æäœéå¿ èŠãªç³è«
PicoLispãã£ã¹ããªãã¥ãŒã·ã§ã³ã«ã¯ãæå°éã®å®å šãªã¢ããªã±ãŒã·ã§ã³ãapp /ãã£ã¬ã¯ããªã«å«ãŸããŠããŸãããã®ã¢ããªã±ãŒã·ã§ã³ã¯ããã®ããã¥ã¡ã³ãã§èª¬æãããŠããå€ãã®ã¡ãœãããå®è£ ããç°¡åã«å€æŽããã³æ¡åŒµã§ãããšããæå³ã§å žåçã§ããå®éã«ã¯ãç¬èªã®ã¢ããªã±ãŒã·ã§ã³ãéçºããããã®ãã³ãã¬ãŒããšããŠäœ¿çšããŸãã
ããã¯ã顧客/ä»å ¥å ãååïŒããžã·ã§ã³ïŒã泚æããã®ä»ã®ããŒã¿ãå«ãäžçš®ã®ç°¡æERPã·ã¹ãã ã§ãã泚æå ¥åãã©ãŒã ã¯ã顧客ãšè£œåã®éžæãäŸ¡æ Œãåšåº«ãããã³ç·ã³ã¹ãã®èšç®ã®ã©ã€ãæŽæ°ãå®è¡ãããã®å Žã§PDFããã¥ã¡ã³ããäœæããŸããã¢ã¯ã»ã¹ã®åŸ®èª¿æŽã¯ããŠãŒã¶ãŒãããŒã«ãããã³èš±å¯ãéããŠè¡ãããŸããã¢ããªã±ãŒã·ã§ã³ã¯6ã€ã®èšèªïŒè±èªãã¹ãã€ã³èªããã€ãèªããã«ãŠã§ãŒèªããã·ã¢èªãæ¥æ¬èªïŒã«ããŒã«ã©ã€ãºãããŠãããåæããŒã¿ãš2ã€ã®ãµã³ãã«ã¬ããŒãããããŸãã
ã¯ããã«
ã°ããŒãã«ã€ã³ã¹ããŒã«ã®å ŽåïŒã€ã³ã¹ããŒã«ãåç §ïŒãããã°ã©ã ãã¡ã€ã«ãã€ã³ã¹ããŒã«ãããŠããå Žæãžã®ã·ã³ããªãã¯ãªã³ã¯ãäœæããŸããããã¯ãã¢ããªã±ãŒã·ã§ã³ãçŸåšã®äœæ¥ãã£ã¬ã¯ããªïŒå®è¡æã®ããŒã¿ããŒã¹ããã³ãã®ä»ã®ããŒã¿çšïŒãžã®èªã¿åãããã³æžã蟌ã¿ã¢ã¯ã»ã¹ãå¿ èŠãšããããã«å¿ èŠã§ãã
$ ln -s /usr/share/picolisp/app
ãã€ãã®ããã«ããããã°ã¢ãŒãã§ã¢ããªã±ãŒã·ã§ã³ãå®è¡ã§ããŸãã
$ pil app/main.l -main -go +
ãŸãã¯å®åã¢ãŒãïŒéãããã°ïŒ
$ pil app/main.l -main -go -wait
ãããŠããã©ãŠã¶ã§ãhttpïŒ// localhostïŒ8080ãã«ç§»åããŸãããŠãŒã¶ãŒãadminãããã¹ã¯ãŒããadminããšããŠãã°ã€ã³ã§ããŸãããµã³ãã«ããŒã¿ã«ã¯ä»ã®è€æ°ã®ãŠãŒã¶ãŒãå«ãŸããŠããŸããããã®åœ¹å²ã¯æš©éã«ããå¶éãããŠããŸãã
å¥ã®å¯èœæ§ã¯ãapp.7fach.de Webãµã€ãã§ãã®ã¢ããªã±ãŒã·ã§ã³ã®ãªã³ã©ã€ã³ããŒãžã§ã³ãè©Šãããšã§ãã
ããŒã«ãªãŒãŒã·ã§ã³
ãã°ã€ã³ããåãŸãã¯åŸã«ãå¥ã®èšèªãéžæããŠãå€æŽããã¿ã³ãã¯ãªãã¯ã§ããŸããããã¯ãæ°å€åœ¢åŒãæ¥ä»ãé»è©±çªå·ãšåæ§ã«ããã¹ãŠã®GUIã³ã³ããŒãã³ãïŒããŒã¿ããŒã¹ã®ããã¹ãã«ã¯åœ±é¿ããŸããïŒã«åœ±é¿ããŸãã
ããã²ãŒã·ã§ã³
å·ŠåŽã®ããã²ãŒã·ã§ã³ã¡ãã¥ãŒã«ã¯ããããŒã ããšããã°ã¢ãŠããã®2ã€ã®é ç®ãšããããŒã¿ãããã¬ããŒããããã·ã¹ãã ãã®3ã€ã®ãµãã¡ãã¥ãŒã衚瀺ãããŸãã
ãããŒã ããšããã°ã¢ãŠããã®äž¡æ¹ã§ãæåã®ãã°ã€ã³ãã©ãŒã ã«æ»ããŸããå¥ã®ãŠãŒã¶ãŒã«åãæ¿ããå ŽåïŒããšãã°ãå¥ã®åœ¹å²ã®å ŽåïŒããã©ãŠã¶ãŒãéããåã«ããã°ã¢ãŠããã䜿çšããããã«éèŠãªããšãšããŠãã°ã¢ãŠãããŠããµãŒããŒã®ãããã¯ãé²ããŸãã
ãããŒã¿ããµãã¡ãã¥ãŒã§ã¯ã泚æãååã顧客ããµãã©ã€ã€ãªã©ã®ã¢ããªã±ãŒã·ã§ã³ããŒã¿ãšã¡ã³ããã³ã¹ã«ã¢ã¯ã»ã¹ã§ããŸãã [ã¬ããŒã]ãµãã¡ãã¥ãŒã«ã¯ãåšåº«ãšè²©å£²ã«é¢ãã2ã€ã®ç°¡åãªã¬ããŒããå«ãŸããŠããŸãã ãã·ã¹ãã ããµãã¡ãã¥ãŒã§ã¯ããŠãŒã¶ãŒæš©éãšãã®åœ¹å²ã管çã§ããŸãã
åãµãã¡ãã¥ãŒã¯åå¥ã«éãããéãããã§ããŸããè€æ°ã®ãµãã¡ãã¥ãŒãåæã«éããŠãããããã¢ããªã±ãŒã·ã§ã³ã®ããŸããŸãªéšåããã°ããåãæ¿ããããšãã§ããŸãã
ã¢ã¯ãã£ããªã¡ãã¥ãŒé ç®ã¯ãç°ãªããªã¹ãããŒã«ãŒã¹ã¿ã€ã«ã§ç€ºãããŸãã
ãªããžã§ã¯ãéžæ
[ããŒã¿]ãŸãã¯[ã·ã¹ãã ]ãµãã¡ãã¥ãŒã®åã¢ã€ãã ã¯ããã®ãšã³ãã£ãã£ã¯ã©ã¹ã®æ€çŽ¢ãã€ã¢ãã°ããã¯ã¹ãéããŸããæ€çŽ¢ãã³ãã¬ãŒããæå®ãã[æ€çŽ¢]ãã¿ã³ïŒãŸãã¯åã«ENTERïŒãã¯ãªãã¯ããŠãçµæã®ãªã¹ããã¹ã¯ããŒã«ã§ããŸãã
ãããŒã«ãããã³ããŠãŒã¶ãŒãã§ã¯ããšã³ãã£ãã£ã«å¯ŸããŠåçŽãªãã€ã¢ãã°ãæäŸãããŸããïŒååã«ããæ€çŽ¢ã®ã¿ïŒãä»ã®ã¿ã€ãã®ãšã³ãã£ãã£ã¯ããŸããŸãªåºæºã§èŠã€ããããšãã§ããŸãããããã®å Žåããªã»ãããã¿ã³ã¯ãã€ã¢ãã°ããã¯ã¹å šäœã®å 容ãæ¶å»ããŸããå³äžã®ãã¿ã³ãæ°èŠãã䜿çšããŠãæ°ãããªããžã§ã¯ããäœæã§ããŸãã
ãããã®å Žåã§ããæåã®åã«ã¯ã@ããªã³ã¯ïŒãã®ãªããžã§ã¯ãã«ç§»åããïŒãŸãã¯ã@ããã¿ã³ïŒãã®ãªããžã§ã¯ããžã®ãªã³ã¯ãçŸåšã®ãã©ãŒã ã«æ¿å ¥ããïŒãå«ãŸããŸãã
ããã©ã«ãã§ã¯ãæ€çŽ¢ã¯ãå±æ§å€ã以äžã®ãã¹ãŠã®ããŒã¿ããŒã¹ãªããžã§ã¯ããè¿ããŸãæ€çŽ¢æ¡ä»¶ãæ¯èŒã¯ãæ°å€ã®å Žåã¯ç®è¡çã«ãããã¹ãã®å Žåã¯ã¢ã«ãã¡ãããé ã«ïŒå€§æåãšå°æåãåºå¥ãããŸãïŒïŒå®è¡ãããŸããããã¯ããCustomer / Supplierããã€ã¢ãã°ã®ãCityããã£ãŒã«ãã«ãFreeããšå ¥åãããšãå€ãFreetownããæ€çŽ¢æ¡ä»¶ã«äžèŽããããšãæå³ããŸããäžæ¹ããç¡æããŸãã¯ãçºããšå ¥åããŠããç¡æçºãã¯èŠã€ãããŸããã
ãã ããäžéšã®æ€çŽ¢ãã£ãŒã«ãã¯ãã¢ããªã±ãŒã·ã§ã³ã«å¿ããŠç°ãªãåäœã瀺ããŸãã
- å人ãäŒç€ŸããŸãã¯è£œåã®ååã¯ãããããªã¹ãã«ã®ååïŒããã©ãŒãã§ã¯ãªãããã¥ãŒã©ãŒãïŒãŸãã¯ãµãã¹ããªã³ã°ïŒããªãŒã¯ãã¯ãã»ãã³ãªãŒã¯ãªãããããã«äžèŽïŒã«äžèŽããå¯å®¹ãªæ€çŽ¢ãèš±å¯ããŸãã
- æ€çŽ¢ãã£ãŒã«ãã«ã¯ãäžéã§ã¯ãªãäžéãå«ãŸããå ŽåããããŸããããã«ãããæ€çŽ¢æ¡ä»¶ä»¥äžã®å±æ§å€ãæã€ããŒã¿ããŒã¹ãªããžã§ã¯ããæ€çŽ¢ãããŸããããã¯ãããšãã°ã[泚æ]ãã€ã¢ãã°ããã¯ã¹ã§ãææ°ã®æ³šæããçªå·ãŸãã¯æ¥ä»ã«åŸã£ãŠæ³šæã®ãªã¹ãã衚瀺ããå Žåã«äŸ¿å©ã§ãã
ã¹ã¯ããŒã«ãã¿ã³ã䜿çšãããšãå¶éãªãã§çµæã®ãªã¹ããã¹ã¯ããŒã«ã§ããŸãããªã³ã¯ãã¯ãªãã¯ãããšã察å¿ãããªããžã§ã¯ãã衚瀺ãããŸããç®çã®åãéžæããããã«æ³šæããŠãã ãããäžéšã®ãã€ã¢ãã°ïŒãã¢ã€ãã ãããã³ã泚æãïŒã¯ãé¢é£ãããšã³ãã£ãã£ïŒããµãã©ã€ã€ãŒããªã©ïŒãžã®ãªã³ã¯ãæäŸããŸãã
ç·šéäž
éåžžãããŒã¿ããŒã¹ãªããžã§ã¯ãã¯ããšã³ãã£ãã£ã¯ã©ã¹ã«ãã£ãŠæ±ºå®ãããç¬èªã®åå¥ã®åœ¢åŒã§è¡šç€ºãããŸãã
åºæ¬ã¬ã€ã¢ãŠãã¯ãã¹ãŠã®ã¯ã©ã¹ã§äžè²«ããŠããå¿ èŠããããŸããèŠåºãïŒéåžžã¯ã¡ãã¥ãŒé ç®ãšäžèŽïŒã®äžã«ãªããžã§ã¯ãIDïŒååãçªå·ãªã©ïŒãããã次ã«å·ŠåŽã®[ç·šé]ãã¿ã³ãš[åé€]ãã¿ã³ãããè¡ãéžæããšå³åŽã®2ã€ã®ããã²ãŒã·ã§ã³ãªã³ã¯ã
ãã©ãŒã ã¯æåã¯èªã¿åãå°çšã¢ãŒãã§è¡šç€ºãããŸããããã¯ãè€æ°ã®ãŠãŒã¶ãŒãåæã«ãªããžã§ã¯ããå€æŽããªãããã«ããããã«å¿ èŠã§ãïŒä»¥åã®PicoLisp Javaãã¬ãŒã ã¯ãŒã¯ãšã¯ç°ãªããããã¯åé¡ã§ã¯ãããŸããã§ããããã¹ãŠã®å€æŽã¯ä»ã®ãŠãŒã¶ãŒã®GUIã«ããã«åæ ãããŠããããã§ãïŒã
ãããã£ãŠããªããžã§ã¯ããå€æŽããå Žåã¯ã[ç·šé]ãã¿ã³ãã¯ãªãã¯ããŠæä»çã«ã¢ã¯ã»ã¹ããå¿ èŠããããŸãããã©ãŒã ã®ããã¯ã解é€ããã[ç·šé]ãã¿ã³ã[å®äº]ã«å€ãããŸããå¥ã®ãŠãŒã¶ãŒããã§ã«ãã®ãªããžã§ã¯ãããããã¯ããŠããå Žåãååãšããã»ã¹IDãå«ãã¡ãã»ãŒãžã衚瀺ãããŸãã
äŸå€ã¯ããæ°èŠãã§äœæãããã°ããã®ãªããžã§ã¯ãã§ãããããã¯èªåçã«äºçŽããããç·šéããã¿ã³ã¯ãå®äºããšè¡šç€ºãããŸãã
[åé€]ãã¿ã³ãã¯ãªãã¯ãããšã確èªãæ±ãããã€ã¢ãã°ã衚瀺ãããŸãããªããžã§ã¯ããæ¬åœã«åé€ãããå Žåããã®ãã¿ã³ã¯ã埩å ãã«å€ããããªããžã§ã¯ãã埩å ã§ããŸãããªããžã§ã¯ãã¯ãä»ã®ãªããžã§ã¯ãããåç §ãããŠããéã¯ããŒã¿ããŒã¹ããå®å šã«åé€ãããããšã¯ãããŸããã ãåé€ãããããªããžã§ã¯ãã衚瀺ããããšãããã®èå¥åã¯è§æ¬åŒ§ã§è¡šç€ºãããŸãã
[éžæ]ãã¿ã³ã¯ãïŒç¹°ãè¿ãïŒãã®ãšã³ãã£ãã£ã¯ã©ã¹ã®æ€çŽ¢ãã€ã¢ãã°ããã¯ã¹ã衚瀺ããŸããæ€çŽ¢æ¡ä»¶ã¯ãæ€çŽ¢ãã€ã¢ãã°ã®åŒã³åºãéã§ä¿åãããŸãã
å·Šå³ãæãããã²ãŒã·ã§ã³ãªã³ã¯ãåæ§ã®ç®çãæãããŸãããããã䜿çšãããšãç¹å®ã®ã¯ã©ã¹ã®ãã¹ãŠã®ãªããžã§ã¯ããã€ã³ããã¯ã¹é ã«ã¹ãããã¹ã«ãŒã§ããŸãã
ãã®ä»ã®ãã¿ã³ã¯ãæ§è³ªã«å¿ããŠãéåžžãã©ãŒã ã®äžéšã«é 眮ãããŸããå³äžã«ã¯ãåžžã«å¥ã®ãç·šéã/ãå®äºããã¿ã³ããããŸããã¹ã¯ããŒã«
ã®ç« ã§è¿°ã¹ãããã«ããã©ãŒã äžã®ãã¿ã³ã¯ãåºã«ãªãããŒã¿ã¢ãã«ãžã®å€æŽãä¿åããŸãããã ããç¹å¥ãªå ŽåãšããŠããå®äºããã¿ã³ã¯ãªããžã§ã¯ãã解æŸããç·šéã«æ»ããŸããããã«ããªããžã§ã¯ããªã³ã¯ïŒéçã¢ã€ã³ã³ïŒãå³äžã®ããã²ãŒã·ã§ã³ãªã³ã¯ããŸãã¯æ€çŽ¢ãã€ã¢ãã°ããã¯ã¹ã®ãªã³ã¯ãã¯ãªãã¯ãããšãå¥ã®ãªããžã§ã¯ãã衚瀺ããããšããã«ç·šéã¢ãŒããäžæãããŸãã
ãã¿ã³ãšãªã³ã¯
HTTPããŒã¹ã®ã¢ããªã±ãŒã·ã§ã³ãµãŒããŒãšå¯Ÿè©±ããå¯äžã®æ¹æ³ã¯ãHTMLãªã³ã¯ãŸãã¯éä¿¡ãã¿ã³ãã¯ãªãã¯ããããšã§ãïŒå¶åŸ¡ãããŒãåç §ïŒãçŸåšã®ãã©ãŒã ã§å ¥åãŸãã¯å€æŽãããããŒã¿ã«å¯Ÿãããã®ãããªã¯ãªãã¯ã®ããŸããŸãªå¹æãç解ããããšãéèŠã§ãã
- ãªã³ã¯ãã¯ãªãã¯ããããšã§ãããŒãžãé¢ãããåèªã¿èŸŒã¿ããŸããå€æŽã¯ç Žæ£ãããŸãã
- ãã¿ã³ãã¯ãªãã¯ããããšã«ãããå€æŽãé©çšããé©åãªã¢ã¯ã·ã§ã³ãå®è¡ããŸãã
ãã®ãããæ§é ã®ã¬ã€ã¢ãŠãã§ã¯ãªã³ã¯ãšãã¿ã³ãæ確ã«åºå¥ããå¿ èŠããããŸããä»ã®å Žæã§ç»åããªã³ã¯ã«äœ¿çšãããŠããå Žåãç»åã®åœ¢ã®ãã¿ã³ã¯ãå§ãã§ããŸãããæšæºã®ãã¿ã³ãæšå¥šãããŸãããããã¯éåžžããã©ãŠã¶ã«ãã£ãŠæ確ãª3次å 圢åŒã§è¡šç€ºãããŸãã
ãã©ãŠã¶ã§JavaScriptãæå¹ã«ãªã£ãŠããå Žåãå€æŽã¯èªåçã«ãµãŒããŒã«éä¿¡ãããããšã«æ³šæããŠãã ããã
ãã¿ã³ã®ãªã³ãŸãã¯ãªãç¶æ ã¯ãã¢ããªã±ãŒã·ã§ã³ããžãã¯ã®äžå¯æ¬ ãªéšåã§ããããã¯ãé©åãªã¹ã¿ã€ã«ã§ãŠãŒã¶ãŒã«ç€ºãããå¿ èŠããããŸãã
ããŒã¿ã¢ãã«
ãã®ã¬ãžã§ããã®ããŒã¿ã¢ãã«ã¯ã6ã€ã®ãšã³ãã£ãã£ã¯ã©ã¹ã®ã¿ã§æ§æãããŠããŸãïŒãapp / er.lãã®åé ã®å³E / Rãåç §ïŒã
###ãšã³ãã£ãã£/é¢ä¿### ïŒ ïŒnr nm nr nm nm ïŒ| | | | | ïŒ+-* ---- *-+ +-* ---- *-+ +-* ----- + ïŒ| | sup | | | | # str --* CuSu O-----------------* Item *-- inv | Role @-- perm # | | | | | | # +-*-*--O-+ +----O---+ +----@---+ # | | | | | usr # nm tel -+ | | | | # | | | | itm | role # +-*-----+ | | +-------+ +---*---+ +----*---+ # | | | | | | ord | | | | # | Sal +---+ +---* Ord @--------* Pos | nm --* User *-- pw # | | cus | | pos | | | | # +-*---*-+ +-*---*-+ +-*---*-+ +--------+ # | | | | | | # hi sex nr dat pr cnt
- â
+CuSu
(/),+Item
()+Ord
(). -
+Pos
. -
+Role
+User
.
ã¯ã©ã¹
+Role
ãšã¯
+User
ã@ lib / adm.lãã§å®çŸ©ãããŠããŸãã
+Role
ååãæš©éã®ãªã¹ããããã³ãã®ããŒã«ã«å²ãåœãŠããããŠãŒã¶ãŒã®ãªã¹ãããããŸãã
+User
ååããã¹ã¯ãŒãã圹å²ããããŸãã
ãapp / er.lãã§ã¯ãã¯ã©ã¹ã
+Role
å±éãããŠãã®ã¡ãœãããå®çŸ©ãããŸã
url>
ãã¯ã©ã¹ã«ãã®ãããªã¡ãœããããããªããžã§ã¯ãã¯ãããèªäœãGUIã«ãããã§ããŸãããã®å Žåã
*ID
ãã®ãªããžã§ã¯ããžã®HTMLãªã³ã¯ãã¢ã¯ãã£ãåããããã³ã«ããã¡ã€ã«ãapp / role.lããããŒããããŸãïŒã°ããŒãã«å€æ°ããããæãïŒã
ã¯ã©ã¹
+User
ãæ¡åŒµãããŠããŸãããã°ã€ã³ã«å ããŠãæ°åãé»åã¡ãŒã«ãããã³é»è©±çªå·ãè¿œå ãããŸãããããŠããã¡ããããŠããã¿ã¹ãªæ¹æ³
url>
ã§ãã
ã¢ããªã±ãŒã·ã§ã³ããžãã¯ã¯æ³šæãäžå¿ã«å±éããŸãã泚æã«ã¯çªå·ãæ¥ä»ã顧客ïŒã³ããŒ
+CuSu
ïŒããã³äœçœ®ã®ãªã¹ãïŒãªããžã§ã¯ã
+Pos
ïŒãã¡ãœãã
sum>
ã¯ããã®æ³šæã®åèšå€ãèšç®ããŸãã
åã¢ã€ãã ã«ã¯ããªããžã§ã¯ã
+Item
ïŒè£œåïŒãäŸ¡æ Œãæ°éãžã®ãªã³ã¯ããããŸããã©ã€ã³ã¢ã€ãã ã®äŸ¡æ Œã¯ã察å¿ãã補åã®ããã©ã«ãäŸ¡æ ŒãäžæžãããŸãã
å補åã«ã¯ãçªå·ã説æããµãã©ã€ã€ãŒïŒã³ããŒã
+CuSu
ïŒãåšåº«ïŒæåŸã®åšåº«ããã®ã¢ã€ãã ã®æ°ïŒãããã³äŸ¡æ ŒããããŸãããã®æ¹æ³ã§
cnt>
ã¯ããã®è£œåã®çŸåšã®åšåº«ããåšåº«ãšè²©å£²ãããååã®æ°éãšã®å·®ãšããŠèšç®ãããŸãã
é¢æ°åŒã³åºã
dbs
æåŸã«ããapp / er.lãã¯ããŒã¿ããŒã¹ã®ç©çæ§é ãèšå®ããŸããæäŸãããåãªã¹ãã«ã¯CARã®çªå·ãããã察å¿ããããŒã¿ããŒã¹ãã¡ã€ã«ã®ãããã¯ãµã€ãºã64ã®çŽ¯ä¹ïŒ64 << NïŒã§æ±ºå®ããŸããCDRã¯ãç¹å®ã®ã¯ã©ã¹ã®ã€ã³ã¹ã¿ã³ã¹ïŒèŠçŽ ãã¯ã©ã¹ã·ã³ãã«ã®å ŽåïŒãŸãã¯ããªãŒããŒãïŒèŠçŽ ãã¯ã©ã¹ã·ã³ãã«ãšããããã£åã®ãªã¹ãã®å ŽåïŒããã®ãã¡ã€ã«ã«é 眮ããããšã決å®ããŸããããã«ãããããŒã¿ããŒã¹æ§é ãæé©åã§ããŸãã
# Database sizes (dbs (3 +Role +User +Sal) # 512 Prevalent objects (0 +Pos) # A:64 Tiny objects (1 +Item +Ord) # B:128 Small objects (2 +CuSu) # C:256 Normal objects (2 (+Role nm) (+User nm) (+Sal nm)) # D:256 Small indexes (4 (+CuSu nr plz tel mob)) # E:1024 Normal indexes (4 (+CuSu nm)) # F:1024 (4 (+CuSu ort)) # G:1024 (4 (+Item nr sup pr)) # H:1024 (4 (+Item nm)) # I:1024 (4 (+Ord nr dat cus)) # J:1024 (4 (+Pos itm)) ) # K:1024
䜿çšãã
ã¢ããªã±ãŒã·ã§ã³ã«æ¥ç¶ããåŸïŒãã¯ããã«ããåç §ïŒããå®éã®ãäœæ¥ãè©Šã¿ãããšãã§ããŸãã[ããŒã¿]ã¡ãã¥ãŒïŒããã²ãŒã·ã§ã³ãåç §ïŒã䜿çšããŠã顧客ããµãã©ã€ã€ãŒã補åã泚æãäœæãŸãã¯ç·šéãã[ã¬ããŒã]ã¡ãã¥ãŒããç°¡åãªã¬ããŒããäœæã§ããŸãã
顧客/ãµãã©ã€ã€ãŒ
ãApp / cusu.lã
ã¯ã©ã€ã¢ã³ã/ãã³ããŒæ€çŽ¢ãã€ã¢ãã°ããã¯ã¹ïŒ
choCuSu
ãapp / gui.lãå ïŒã¯ãå€ãã®æ€çŽ¢æ¡ä»¶ããµããŒãããŠããŸããããŒã¿ããŒã¹ã«å€æ°ã®ã¯ã©ã€ã¢ã³ããå«ãŸããŠããå Žåã«å¿ èŠã«ãªããzipãé»è©±çªå·ã®ãã¬ãã£ãã¯ã¹ãªã©ã§ãã£ã«ã¿ãªã³ã°ã§ããŸãã
ã¡ã€ã³ã¬ã€ã¢ãŠãïŒç·šéãåç §ïŒã«å ããŠããã©ãŒã ã¯4ã€ã®åå¥ã®ã¿ãã«åå²ãããŠããŸãããã©ãŒã ãããã€ãã®ã¿ãã«åå²ãããšããã©ãã£ãã¯ãæžãããŠãGUIã®å¿çãé«éåã§ããŸãããã®å Žåã4ã€ã®ã¿ããå¯èœã§ããããã¢ã³ã¹ãã¬ãŒã·ã§ã³ã®ç®çã«ã¯éåžžã«é©ããŠãããæ¡åŒµã®äœå°ããããŸãã
ã¿ããHTMLãªã³ã¯ãšããŠå®è£ ãããŠãããããããããã®ã¿ãã§ããŒã¿ãå€æŽãããå Žåãå¥ã®ã¿ããéžæããåã«ãå®äºããã¿ã³ãæŒãå¿ èŠãããããšã«æ³šæããŠãã ããïŒãã¿ã³ãšãªã³ã¯ãåç §ïŒã
æ°ãã顧客ãŸãã¯ãµãã©ã€ã€ã®å Žåã次ã«å©çšå¯èœãªçªå·ãèªåçã«å²ãåœãŠãããŸããå¥ã®çªå·ãå ¥åã§ããŸãããæ¢åã®çªå·ã䜿çšããããšãããšãšã©ãŒãçºçããŸãããååããã£ãŒã«ãã¯å¿ é ã§ãã
[é£çµ¡å ]ã¿ãã®é»è©±çªå·ãšFAXçªå·ã¯ããã±ãŒã«ã«å¿ããŠæ£ãã圢åŒã§å ¥åããå¿ èŠããããŸãïŒé»è©±çªå·ãåç §ïŒã
[ã¡ã¢]ã¿ãã«ã¯1ã€ã®ããã¹ãé åãå«ãŸããŠããŸããBlobãªããžã§ã¯ãã«æ ŒçŽãããŠããããã倧ããªããã¹ããã£ã³ã¯ã«äœ¿çšã§ããŸãã
補å
ãApp / item.lã
補åã«ã¯ãäžæã®çªå·ãšå¿ é ã®ã説æããã£ãŒã«ãããããŸãã
ãµãã©ã€ã€ãŒãå²ãåœãŠãã«ã¯ãã+ããã¿ã³ãã¯ãªãã¯ããŸãã顧客/ãµãã©ã€ã€ãŒæ€çŽ¢ãã€ã¢ãã°ããã¯ã¹ã衚瀺ãããŸããæåã®åã®ã@ããã¿ã³ãã¯ãªãã¯ããŠãç®çã®ãµãã©ã€ã€ãŒãéžæã§ããŸããããã«ããµãã©ã€ã€åã®æ£ç¢ºãªã¹ãã«ãç¥ã£ãŠããããšã確å®ãªå Žåã¯ãããã¹ãããã¯ã¹ã«çŽæ¥å ¥åããããšãã§ããŸãã
[æ€çŽ¢]ãã€ã¢ãã°ããã¯ã¹ã§ãããšãã°ãªã³ã¯ãã¯ãªãã¯ããŠãå¯èœãªãµãã©ã€ã€ãæ¢çŽ¢ãããã©ãŠã¶ã®[æ»ã]ãã¿ã³ãã¯ãªãã¯ããŠæ€çŽ¢ãŠã£ã³ããŠã«æ»ãããšãã§ããŸããå¥ã®ãªããžã§ã¯ãã«åãæ¿ããããããç·šéãã¢ãŒãã¯ãã¡ãããã£ã³ã»ã«ãããŸãïŒããã¯ç·šéã®æåŸã®éšåã§èª¬æãããŠããŸãïŒã
åšåº«-çŸåšåšåº«ã®ããååã®éãå ¥åã§ããŸãã次ã®ãã£ãŒã«ãã«ã¯ãç¹å®ã®éé¡ã販売ãããåŸã®æ®ãã®ååã®éé¡ãèªåçã«åæ ãããŸãïŒã€ãŸãã泚æååã«ãªã³ã¯ããããŸãïŒããã®å€ã¯æåã§å€æŽã§ããŸããã
çŸåšã®ãã±ãŒã«ã«å¿ããŠãäŸ¡æ Œã¯å°æ°ç¹åºåãæåã§å ¥åããå¿ èŠããããŸããå°æ°ç¹åºåãæåã®åŸã«2æåã§ãã©ãŒããããããŸãã
ã¡ã¢ãã£ãŒã«ãã¯ãäžèšã®ã¯ã©ã€ã¢ã³ã/ãµãã©ã€ã€ãšåæ§ã«ãããŒã¿ããŒã¹ã®blobãªããžã§ã¯ãã«ä¿åãããŸãã
æåŸã«ãJPEGã€ã¡ãŒãžããã®èŠçŽ ã®blobã«ä¿åã§ããŸãããã¡ã€ã«éžæãã€ã¢ãã°ã䜿çšããŠãã¡ã€ã«ãéžæãããã€ã³ã¹ããŒã«ããã¿ã³ãã¯ãªãã¯ããŸããç»åãããŒãžã®äžéšã«è¡šç€ºããããã€ã³ã¹ããŒã«ããã¿ã³ããåé€ãã«å€ãããç»åãåé€ã§ããŸãã
ã泚æ
ãApp / ord.lã
泚æã¯çªå·ãšæ¥ä»ã§èå¥ãããŸãã
çªå·ã¯äžæã§ããå¿ èŠããããŸãããªãŒããŒã®äœææã«å²ãåœãŠãããå€æŽã§ããŸããã
æ°ããäœæããã泚æã®æ¥ä»ã¯ä»æ¥ã«èšå®ãããŸãããæåã§å€æŽã§ããŸããæ¥ä»ã®åœ¢åŒã¯ãã±ãŒã«ã«ãã£ãŠç°ãªããŸãããããã¯ããã©ã«ãã§YYYY-MM-DDïŒISOïŒããã€ãèªã§ã¯DD.MM.YYYYãæ¥æ¬èªã§ã¯YYYY / MM / DDã§ããtimeãšdateã§èª¬æãããŠããããã«ããã®ãã£ãŒã«ãã§ã¯çç¥å ¥åãå¯èœã§ããããšãã°ãæ¥ãå ¥åããã ãã§çŸåšã®æã®å®å šãªæ¥ä»ãååŸã§ããŸãã
ãã®æ³šæã«é¡§å®¢ãå²ãåœãŠãã«ã¯ãã+ããã¿ã³ãã¯ãªãã¯ããŸãããã€ã¢ãã°ããã¯ã¹ã«ã¯ãæ€çŽ¢ã¯ã©ã€ã¢ã³ã/ãããã€ãã衚瀺ãããããªããåžæ顧客ã®ãã¿ã³ãéžæããããšãã§ããã@ãã®æåã®åïŒãŸãã¯ããã¹ãããã¯ã¹ã«çŽæ¥ååãå ¥åããŸãïŒã§ãããã«äžèšã®ãããªååã
次ã«ã泚æé ç®ãå ¥åããŸããã+ããã¿ã³ã䜿çšããŠè£œåãéžæããŸãã ãäŸ¡æ Œããã£ãŒã«ãã«ã¯ããã©ã«ãã®äŸ¡æ ŒããããŸãããæåã§å€æŽã§ããŸãã次ã«ãæ°éãå ¥åããŠãã¿ã³ãæŒããŸãïŒéåžžã次ã®é ç®ãŸãã¯ã¹ã¯ããŒã«ãã¿ã³ãéžæããã«ã¯ã+ããã¿ã³ïŒããã©ãŒã ã¯èªåçã«åéèšãããããžã·ã§ã³ãšæ³šæå šäœã®ç·è²»çšã衚瀺ãããŸãã
ãã¡ãããäžèšã§æšå¥šãããŠããã+ããŸãã¯ã¹ã¯ããŒã«ãã¿ã³ã®ä»£ããã«ããå®äºããã¿ã³ãæŒããŠå€æŽãä¿åããããšãã§ããŸãããã ããããžã·ã§ã³ã®å ¥åãç¶ãããå Žåã¯ãããã«ãããã¿ã³ãããäžåºŠæŒãããŸãïŒçŸåšã¯ãç·šéãïŒã
åã¢ã€ãã ã®å³åŽã«ãããxããã¿ã³ãæŒããšã確èªãªãã§ãã®ã¢ã€ãã ãåé€ãããŸãã泚æããŠäœ¿çšããå¿ èŠããããŸãïŒ
ã^ããã¿ã³ã¯ãçŸåšã®è¡ãäžäœã®è¡ãšäº€æããŸãããããã£ãŠãããŒãã«å ã®ãã¹ãŠã®èŠçŽ ãç®çã®äœçœ®ã«äžããããšã§ããããã®äœçœ®ãå€æŽããããã«äœ¿çšã§ããŸãã
PDF-Printãã¿ã³ã¯ããã®æ³šæã®PDFããã¥ã¡ã³ããäœæããŠè¡šç€ºããŸãããã©ãŠã¶ã¯ãããŠã³ããŒãããPDFããã¥ã¡ã³ããé©åãªãã¥ãŒã¢ã§è¡šç€ºããããã«æ§æããå¿ èŠããããŸãããã¹ãã¹ã¯ãªãããäœæããã¡ãœããã®ãœãŒã¹ã¯ãapp / lib.lãã«ãããŸããäœçœ®ã®æ°ã«å¿ããŠã1ã€ä»¥äžã®A4ããŒãžãçæããŸãã
å ±åæž
ãApp / inventory.lããã³ãapp / sales.lã
2ã€ã®ã¬ããŒãïŒãInventoryãããã³ãSalesãïŒã«ã¯ãããã€ãã®æ€çŽ¢ãã£ãŒã«ããšã衚瀺ããã¿ã³ãå«ãŸããŠããŸãã
æ€çŽ¢æ¡ä»¶ãæå®ãããŠããªãå Žåãã衚瀺ããã¿ã³ã¯ããŒã¿ããŒã¹å šäœã®å¯Ÿå¿ããéšåã®ãªã¹ãã衚瀺ããŸããããã«ã¯æéãããããããŒã¿ããŒã¹ã倧ããå Žåã¯ãã©ãŠã¶ã«å€§ããªè² è·ããããå¯èœæ§ããããŸãã
ãã®ãããéåžžã¯ãçªå·ã®ç¯å²ã説æãã³ãã¬ãŒããããã³/ãŸãã¯åšåº«ã¬ããŒãã®ãµãã©ã€ã€ã泚æã®æ¥ä»ç¯å²ããã³/ãŸãã¯è²©å£²ã¬ããŒãã®é¡§å®¢ãæå®ããããšã«ãããéžæãå¶éããŸãã察å¿ããå€ãçç¥ãããå Žåããã®åºæºã«ãããªããžã§ã¯ãã¯ãã£ã«ã¿ãªã³ã°ãããŸããã
åã¬ããŒãã®æåŸã«ããCSVããªã³ã¯ã衚瀺ãããŸããã¬ããŒãã§çæããããã¡ã€ã«ãããŠã³ããŒãããŸãã