external.scm 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. ; Copyright (c) 1993-2008 by Richard Kelsey and Jonathan Rees. See file COPYING.
  2. (define (fake-it name)
  3. (lambda args
  4. (display "Call to ")
  5. (display (cons name args))
  6. (newline)
  7. 0))
  8. (define extended-vm (fake-it 'extended-vm))
  9. (define external-call (fake-it 'call-external-value))
  10. (define schedule-interrupt (fake-it 'schedule-interrupt))
  11. (define dequeue-external-event! (fake-it 'dequeue-external-event!))
  12. (define-syntax document-it
  13. (syntax-rules
  14. ()
  15. ((document-it name op)
  16. (define (name . args)
  17. (display "Call to ")
  18. (display (cons name args))
  19. (newline)
  20. (apply op args)))))
  21. (document-it external-bignum-make-cached-constants (lambda () #f))
  22. (document-it external-bignum-make-zero (lambda () #f))
  23. (document-it external-bignum-make-one (lambda (x) #f))
  24. (document-it external-bignum-add +)
  25. (document-it external-bignum-subtract -)
  26. (document-it external-bignum-multiply *)
  27. (document-it external-bignum-quotient quotient)
  28. (document-it external-bignum-remainder remainder)
  29. (document-it external-bignum-divide /)
  30. (document-it external-bignum-equal? =)
  31. (document-it external-bignum-compare (lambda (x y)
  32. (if (< x y)
  33. -1
  34. (if (= x y)
  35. 0
  36. 1))))
  37. (document-it external-bignum-test (lambda (x)
  38. (if (< x 0) -1
  39. (if (= x 0) 0
  40. 1))))
  41. (document-it external-bignum-negate (lambda (x) (- x)))
  42. (document-it external-bignum-from-long (lambda (x) x))
  43. (document-it external-bignum-from-unsigned-long (lambda (x) x))
  44. (document-it external-bignum-fits-in-word?
  45. (lambda (bignum word-length two-compl?)
  46. (and (>= bignum -134217728)
  47. (<= bignum 134217727))))
  48. (document-it external-bignum->long (lambda (x) x))
  49. (document-it external-bignum-bitwise-and bitwise-and)
  50. (document-it external-bignum-bitwise-xor bitwise-xor)
  51. (document-it external-bignum-bitwise-ior bitwise-ior)
  52. (document-it external-bignum-bitwise-not bitwise-not)
  53. (document-it external-bignum-bit-count bit-count)
  54. (document-it external-bignum-arithmetic-shift arithmetic-shift)
  55. (define (real-time) 0)
  56. (define (run-time) 0)
  57. (define (cheap-time) 0)
  58. (define s48-call-native-procedure (fake-it 's48-call-native-code))
  59. (define s48-invoke-native-continuation (fake-it 's48-call-native-code))
  60. (define s48-native-return 0)
  61. (define s48-jump-native (fake-it 's48-jump-native))
  62. (define get-proposal-lock! (fake-it 'get-proposal-lock!))
  63. (define release-proposal-lock! (fake-it 'release-proposal-lock!))
  64. (define (shared-ref x) x)
  65. (define-syntax shared-set!
  66. (syntax-rules ()
  67. ((shared-set! x v)
  68. (set! x v))))
  69. (define (get-os-string-encoding)
  70. "UTF-8")
  71. (define host-architecture "s48")
  72. (define (raise-argument-type-error val)
  73. (fake-it 'raise-argument-type-error))
  74. (define (raise-range-error val min max)
  75. (fake-it 'raise-range-error))