diff options
Diffstat (limited to 'ipl/procs/gener.icn')
-rw-r--r-- | ipl/procs/gener.icn | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/ipl/procs/gener.icn b/ipl/procs/gener.icn new file mode 100644 index 0000000..5a06020 --- /dev/null +++ b/ipl/procs/gener.icn @@ -0,0 +1,80 @@ +############################################################################ +# +# File: gener.icn +# +# Subject: Procedures to generate miscellaneous sequences +# +# Author: Ralph E. Griswold +# +# Date: March 25, 2002 +# +############################################################################ +# +# This file is in the public domain. +# +############################################################################ +# +# These procedures generate sequences of results. +# +# days() days of the week. +# +# hex() sequence of hexadecimal codes for numbers +# from 0 to 255 +# +# label(s,i) sequence of labels with prefix s starting at i +# +# multii(i, j) sequence of i * j i's +# +# months() months of the year +# +# octal() sequence of octal codes for numbers from 0 to 255 +# +# star(s) sequence consisting of the closure of s +# starting with the empty string and continuing +# in lexical order as given in s +# +############################################################################ + +procedure days() + + suspend "Sunday" | "Monday" | "Tuesday" | "Wednesday" | "Thursday" | + "Friday" | "Saturday" + +end + +procedure hex() + + suspend !"0123456789abcdef" || !"0123456789abcdef" + +end + +procedure label(s,i) + + suspend s || (i | (i +:= |1)) + +end + +procedure multii(i, j) + + suspend (i to i * j) & i + +end + +procedure months() + + suspend "January" | "February" | "March" | "April" | "May" | "June" | + "July" | "August" | "September" | "October" | "November" | "December" + +end + +procedure octal() + + suspend (0 to 3) || (0 to 7) || (0 to 7) + +end + +procedure star(s) + + suspend "" | (star(s) || !s) + +end |