home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / mitsch75.zip / scheme-7_5_17-src.zip / scheme-7.5.17 / src / compiler / machines / C / rgspcm.scm < prev    next >
Text File  |  1999-01-02  |  2KB  |  67 lines

  1. #| -*-Scheme-*-
  2.  
  3. $Id: rgspcm.scm,v 1.3 1999/01/02 06:06:43 cph Exp $
  4.  
  5. Copyright (c) 1992-1999 Massachusetts Institute of Technology
  6.  
  7. This program is free software; you can redistribute it and/or modify
  8. it under the terms of the GNU General Public License as published by
  9. the Free Software Foundation; either version 2 of the License, or (at
  10. your option) any later version.
  11.  
  12. This program is distributed in the hope that it will be useful, but
  13. WITHOUT ANY WARRANTY; without even the implied warranty of
  14. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  15. General Public License for more details.
  16.  
  17. You should have received a copy of the GNU General Public License
  18. along with this program; if not, write to the Free Software
  19. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  20. |#
  21.  
  22. ;;;; RTL Generation: Special primitive combinations.
  23.  
  24. (declare (usual-integrations))
  25.  
  26. (define (define-special-primitive-handler name handler)
  27.   (let ((primitive (make-primitive-procedure name true)))
  28.     (let ((entry (assq primitive special-primitive-handlers)))
  29.       (if entry
  30.       (set-cdr! entry handler)
  31.       (set! special-primitive-handlers
  32.         (cons (cons primitive handler)
  33.               special-primitive-handlers)))))
  34.   name)
  35.  
  36. (define (special-primitive-handler primitive)
  37.   (let ((entry (assq primitive special-primitive-handlers)))
  38.     (and entry
  39.      (cdr entry))))
  40.  
  41. (define special-primitive-handlers
  42.   '())
  43.  
  44. (define (define-special-primitive/standard primitive)
  45.   (define-special-primitive-handler primitive
  46.     rtl:make-invocation:special-primitive))
  47.  
  48. (define-special-primitive/standard '&+)
  49. (define-special-primitive/standard '&-)
  50. (define-special-primitive/standard '&*)
  51. (define-special-primitive/standard '&/)
  52. (define-special-primitive/standard '&=)
  53. (define-special-primitive/standard '&<)
  54. (define-special-primitive/standard '&>)
  55. (define-special-primitive/standard '1+)
  56. (define-special-primitive/standard '-1+)
  57. (define-special-primitive/standard 'zero?)
  58. (define-special-primitive/standard 'positive?)
  59. (define-special-primitive/standard 'negative?)
  60. (define-special-primitive/standard 'quotient)
  61. (define-special-primitive/standard 'remainder)
  62.  
  63. #|
  64. (define-special-primitive/if-open-coding 'vector-cons)
  65. (define-special-primitive/if-open-coding 'string-allocate)
  66. (define-special-primitive/if-open-coding 'floating-vector-cons)
  67. |#