home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / OL.LZH / PROCS.LZH / GENER.ICN < prev    next >
Text File  |  1991-07-13  |  1KB  |  45 lines

  1. ############################################################################
  2. #
  3. #    Name:    gener.icn
  4. #
  5. #    Title:    Generate miscellaneous sequences
  6. #
  7. #    Author:    Ralph E. Griswold
  8. #
  9. #    Date:    June 10, 1988
  10. #
  11. ############################################################################
  12. #  
  13. #  These procedures generate sequences of results.
  14. #  
  15. #       hex()          sequence of hexadecimal codes for numbers
  16. #                      from 0 to 255
  17. #  
  18. #       label(s,i)     sequence of labels with prefix s starting at
  19. #                      i
  20. #  
  21. #       octal()        sequence of octal codes for numbers from 0 to
  22. #                      255
  23. #  
  24. #       star(s)        sequence consisting of the closure of s
  25. #                      starting with the empty string and continuing
  26. #                      in lexical order as given in s
  27. #  
  28. ############################################################################
  29.  
  30. procedure hex()
  31.    suspend !"0123456789abcdef" || !"0123456789abcdef"
  32. end
  33.  
  34. procedure label(s,i)
  35.    suspend s || (i | (i +:= |1))
  36. end
  37.  
  38. procedure octal()
  39.    suspend (0 to 3) || (0 to 7) || (0 to 7)
  40. end
  41.  
  42. procedure star(s)
  43.    suspend "" | (star(s) || !s)
  44. end
  45.