plt-features.scm 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. ; -*- Mode: Scheme; Syntax: Scheme; Package: Scheme; -*-
  2. ; Part of Scheme 48 1.9. See file COPYING for notices and license.
  3. ; Authors: Mike Sperber
  4. ; This is file plt-features.scm.
  5. ; Synchronize any changes with all the other *-features.scm files.
  6. ; SIGNALS
  7. ; ERROR is built-in
  8. (define (format-error-message message who irritants)
  9. (printf "~a: ~a~a"
  10. who message
  11. (apply string-append
  12. (map (lambda (irritant)
  13. (string-append " " ((error-value->string-handler) irritant 1000)))
  14. irritants))))
  15. (define (assertion-violation who message . irritants)
  16. (error (format-error-message message who irritants)
  17. irritants))
  18. (define (implementation-restriction-violation who message . irritants)
  19. (error (format-error-message message who irritants)
  20. irritants))
  21. (define (warning who message . irritants)
  22. (display (format-error-message message who irritants)
  23. (current-error-port))
  24. (newline (current-error-port)))
  25. (define (syntax-violation who message form . maybe-subform)
  26. (apply warning who message form maybe-subform)
  27. ''syntax-error)
  28. (define (note who message . irritants)
  29. (apply warning who message irritants))
  30. ; FEATURES
  31. (define force-output flush-output)
  32. (define current-noise-port current-error-port)
  33. (define (string-hash s) (abs (equal-hash-code s)))
  34. (define (make-immutable! thing) thing) ; PLT can only do this upon construction
  35. ; IMMUTABLE? is built in
  36. ; BITWISE
  37. ; ARITHMETIC-SHIFT is built-in
  38. ; BITWISE-AND is built-in
  39. ; BITWISE-IOR is built-in
  40. ; BITWISE-NOT is built-in
  41. ; ASCII
  42. (define char->ascii char->integer)
  43. (define ascii->char integer->char)
  44. (define ascii-limit 127)
  45. (define ascii-whitespaces '(32 10 9 12 13))
  46. ; CELLS
  47. (define make-cell box)
  48. (define cell-ref unbox)
  49. (define cell-set! set-box!)
  50. ; CODE-VECTORS
  51. (define make-code-vector make-bytes)
  52. (define code-vector? bytes?)
  53. (define code-vector-ref bytes-ref)
  54. (define code-vector-set! bytes-set!)
  55. (define code-vector-length bytes-length)
  56. ; BINARY I/O
  57. ; WRITE-BYTE is built-in
  58. (define (set-port-crlf?! port val)
  59. (values))