emacs.d/clones/lisp/www.csci.viu.ca/~wesselsd/courses/csci330/code/lisp/when.cl.html
2022-10-07 19:32:11 +02:00

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
)