P. 1
PicoLisp by Example

PicoLisp by Example

|Views: 4,232|Likes:
Published by tj64
More than 600 PicoLisp solutions for Rosetta Code programming tasks from a wide range of topics, written by Alexander Burger (the creator of PicoLisp) himself - plus the complete PicoLisp function reference. Learn a fascinating programming language that maximises expressive power while minimizing complexity 'by Example'.
More than 600 PicoLisp solutions for Rosetta Code programming tasks from a wide range of topics, written by Alexander Burger (the creator of PicoLisp) himself - plus the complete PicoLisp function reference. Learn a fascinating programming language that maximises expressive power while minimizing complexity 'by Example'.

More info:

Published by: tj64 on Aug 23, 2012
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

08/09/2014

pdf

text

original

This task asks to create a window with a label that says “There have been no
clicks yet” and a button that says “click me”. Upon clicking the button with
the mouse, the label should change and show the number of times the button
has been clicked.

The standard PicoLisp GUI is HTTP based. Connect your browser to
http://localhost:8080 after starting the following script.

#!/usr/bin/picolisp /usr/lib/picolisp/lib.l

(load "@ext.l" "@lib/http.l" "@lib/xhtml.l" "@lib/form.l")

(zero *Count)

(de start ()
(app)
(action

(html 0 "Clicks" NIL NIL
(form NIL

(gui ’(+Init +TextField) "There have been no clicks yet")
(----)
(gui ’(+JS +Button) "click me"
’(set> (field -1)
(pack "Clicked " (inc ’*Count) " times") ) ) ) ) ) )

(server 8080 "!start")
(wait)

21 Rosetta Code Tasks starting with S

827

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->