$SPAD/src/input exit.input

Timothy Daly December 3, 2016

Abstract

Contents

2

1 License

— license —

--Copyright The Numerical Algorithms Group Limited 1991.

———-

— * —

)set break resume
)spool exit.output
)set message test on
)set message auto off
)clear all
--S 1 of 6
n := 0
--R
--R
--R   (1)  0
--R                                                     Type: NonNegativeInteger
--E 1
--S 2 of 6
gasp(): Exit ==
    free n
    n := n + 1
    error "Oh no!"
--R
--R   Function declaration gasp : () -> Exit has been added to workspace.
--R                                                                   Type: Void
--E 2
--S 3 of 6
half(k) ==
  if odd? k then gasp()
  else k quo 2
--R
--R                                                                   Type: Void
--E 3
--S 4 of 6
half 4
--R
--R   Compiling function gasp with type () -> Exit
--R   Compiling function half with type PositiveInteger -> Integer
--R
--R   (4)  2
--R                                                        Type: PositiveInteger

--E 4
--S 5 of 6
half 3
--R
--R
--RDaly Bug
--R   Error signalled from user code in function gasp:
--R      Oh no!
--E 5
--S 6 of 6
n
--R
--R
--R   (5)  1
--R                                                     Type: NonNegativeInteger
--E 6
)spool
)lisp (bye)

———-

References^{[1] nothing}

5