home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / scheme / gjr / cmplrtst.lha / prim.scm < prev    next >
Encoding:
Text File  |  1990-03-27  |  571 b   |  30 lines

  1. ;;; -*- Scheme -*-
  2.  
  3. #|
  4. Description:
  5. This code tests the invocation of C primitives.
  6.  
  7. Usage:
  8. (my-char->integer #\@) -> 64
  9. (my-apply + 1 2 3 4) -> 10
  10. (test 'a 'a) -> #t
  11. (test 'a 'b) -> ()
  12. (test-unimpl 'a) -> unimplemented primitive future?
  13. |#
  14.  
  15. (declare (usual-integrations))
  16.  
  17. (define (my-char->integer x)
  18.   (char->integer x))
  19.  
  20. (define (my-apply proc . data)
  21.   (apply proc data))
  22.  
  23. (define (test x y)
  24.   (my-apply eq? x y))
  25.  
  26. (let-syntax ((primitive
  27.           (macro (name arity)
  28.         (make-primitive-procedure name arity))))
  29.   (define (test-unimpl x)
  30.     ((primitive future? 1) x)))