home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / lisp / eulisp / feel0_89.lha / Feel / Boot / string.em < prev    next >
Encoding:
Text File  |  1993-07-09  |  1.3 KB  |  58 lines

  1. ;; Eulisp Module
  2. ;; Author: pab
  3. ;; File: string.em
  4. ;; Date: Wed Jun 30 12:27:51 1993
  5. ;;
  6. ;; Project:
  7. ;; Description: 
  8. ;;
  9.  
  10. (defmodule string
  11.   (init extras0 macros0 defs gens character)
  12.   ()
  13.  
  14.   (export <string>)
  15.  
  16. ;;; ----------
  17. ;;; default methods for initial-state, next-state, current-element and
  18. ;;; (setter current-element) work for <string>
  19.  
  20.   (defmethod element ((v <string>) (s <fixint>)) (string-ref v s))
  21.  
  22.   (defmethod (setter element) ((c <string>) (s <fixint>) v)
  23.     ((setter string-ref) c s v))
  24.  
  25.   (defmethod current-key ((c <string>) (s <fixint>)) s)
  26.  
  27. ;;; ----------
  28. ;;; specified methods
  29.  
  30.   (defmethod binary< ((s1 <string>) (s2 <string>)) (string-lt s1 s2))
  31.  
  32.   (defmethod as-lowercase ((s <string>)) (map as-lowercase s))
  33.  
  34. ;;; (defgeneric as-lowercase! (s))
  35. ;;; 
  36. ;;; (export as-uppercase!)
  37. ;;; 
  38. ;;; (defmethod as-lowercase! ((s <string>)) (map-into s as-lowercase s))
  39.  
  40.   (defmethod as-uppercase ((s <string>)) (map as-uppercase s))
  41.  
  42. ;;; (defgeneric as-uppercase! (s))
  43. ;;; 
  44. ;;; (export as-uppercase!)
  45. ;;; 
  46. ;;; (defmethod as-uppercase! ((s <string>)) (map-into s as-uppercase s))
  47.  
  48.   (defmethod size ((c <string>)) (length c))
  49.  
  50.   (defmethod deep-copy ((s <string>))
  51.     (shallow-copy s))
  52.  
  53.   (defmethod clone ((s <string>))
  54.     (make-string (size s)))
  55.  
  56.   ;; end module
  57.   )
  58.