File: example1.html

package info (click to toggle)
roxen 1.2beta2-3
  • links: PTS
  • area: contrib
  • in suites: slink
  • size: 16,920 kB
  • ctags: 8,589
  • sloc: ansic: 89,632; asm: 8,431; sh: 2,915; makefile: 1,784; cpp: 377
file content (30 lines) | stat: -rw-r--r-- 788 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<gauge>
<lisp once context=foo>
  ; this code is only run _once_.
  ; Define our sub-optimal little fac function..
  (defun fac (x) 
    (if (< x 3)
       x
      (* x (fac (- x 1)))))

  ; .. and a few variables ..
  (define foo 10)
  (define a nil)
</lisp>
</gauge>

<gauge>
  <lisp context=foo>
    (set! foo 9)
    (output "foo is " foo "<br>")
    (output "foo is " (setq foo (* foo foo)) "<br>")
    (output "foo is " (setq foo (* foo foo)) "<br>")
    (set! a  (variable-number "a"))
    (if (< a 200)
        (output a "! is " (fac a) "<br>")
      (output "Try a smaller number<br>"))
    (output "<form>Calculate <input name=a value=" a ">!</form>")
    (output "Your client supports: " )
    (print (id "supports")) ; we must use print to output this list.
  </lisp>
</gauge>