home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Tools / Languages / MacHaskell 2.2 / util / annotation-utils.scm next >
Encoding:
Text File  |  1994-09-27  |  1.2 KB  |  20 lines  |  [TEXT/CCL2]

  1.  
  2. ;;; Some general utilities for dealing with annotations
  3.  
  4. ;;; Lookup an annotation on a var
  5.  
  6. (define (lookup-annotation var aname)
  7.   (lookup-annotation-1 (var-annotations var) aname))
  8.  
  9. (define (lookup-annotation-1 a aname)
  10.   (if (null? a)
  11.       '#f
  12.       (if (eq? aname (annotation-value-name (car a)))
  13.       (car a)
  14.       (lookup-annotation-1 (cdr a) aname))))
  15.  
  16. ;;; This parses a string denoting a strictness property into a list
  17. ;;; of booleans.   "S,N,S" -> (#t #f #t)
  18.  
  19. (define (parse-strictness str)
  20.   (parse-stric