17 lines
389 B
HTML
17 lines
389 B
HTML
#! /usr/bin/gcl -f
|
|
|
|
; examples using when for condition testing
|
|
|
|
; initialize a variable x (just for the sake of the example)
|
|
(defvar x 3)
|
|
|
|
(when
|
|
; condition to test
|
|
(> x 0)
|
|
; series of expressions to evaluate if true
|
|
(format t "x is positive~%")
|
|
(format t "x has value ~A~%" x)
|
|
(format t "going to return negative x~%")
|
|
(- x) ; returns negative x
|
|
)
|
|
|