psd-s48.scm 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. ; Part of Scheme 48 1.9. See file COPYING for notices and license.
  2. ; Authors: Richard Kelsey, Jonathan Rees
  3. ; To use PSD with Scheme 48:
  4. ; - Put (setq psd-using-slib nil) in your .emacs
  5. ; - Put this file in psd-directory
  6. ; - Remove (define *psd-tab-char* (integer->char 9)) from psd's read.scm
  7. ; - Do something horrible to primitives.scm to circumvent bug in
  8. ; Scheme 48's byte code compiler... those big long lists have to be
  9. ; split up: `((x ,x) ... (y ,y) ...) =>
  10. ; (let ((foo (lambda () `((x ,x) ...)))
  11. ; (bar (lambda () `((y ,y) ...))))
  12. ; (append (foo) (bar)))
  13. ; JAR's remarks:
  14. ; - The variable *PSD-PREVIOUS-LINE* was undefined (not consequentially so)
  15. ; - It doesn't support DELAY
  16. ; - It doesn't support the => syntax in COND
  17. ; - It doesn't like (write-char c port):
  18. ; ERROR: Wrong number of arguments to primitive procedure
  19. ; write-char
  20. ; - It would be awfully nice if there were a "quit" command
  21. ; - It leaves that little "=>" arrow in my buffer (except it's not
  22. ; really there, is it?)
  23. ; - It opens the source file multiple (maybe 6) times without
  24. ; closing it (not really a problem since the GC cleans these up, but
  25. ; sort of annoying)
  26. ;;;;
  27. ;;;; $Id: psd-s48.scm,v 1.1 1994/07/13 04:28:45 bdc Exp $
  28. ;;;;
  29. ;;;; psd -- a portable Scheme debugger, version 1.1
  30. ;;;; Copyright (C) 1992 Pertti Kellomaki, pk@cs.tut.fi
  31. ;;;; This program is free software; you can redistribute it and/or modify
  32. ;;;; it under the terms of the GNU General Public License as published by
  33. ;;;; the Free Software Foundation; either version 1, or (at your option)
  34. ;;;; any later version.
  35. ;;;; This program is distributed in the hope that it will be useful,
  36. ;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
  37. ;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  38. ;;;; GNU General Public License for more details.
  39. ;;;; You should have received a copy of the GNU General Public License
  40. ;;;; along with this program; if not, write to the Free Software
  41. ;;;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  42. ;;;;in the psd distribution.
  43. ;;;;
  44. ;;;; $Log: psd.scm,v $
  45. ;;;; Revision 1.6 1993/10/07 08:20:14 pk
  46. ;;;; Define force-output, redefinition hurts less than getting an error
  47. ;;;; message about nonexistent procedure.
  48. ;;;;
  49. ;;;; Revision 1.5 1993/10/06 13:06:16 pk
  50. ;;;; Removed references to slib. Commented out force-output, let the user
  51. ;;;; uncomment it if needed.
  52. ;;;;
  53. ;;;; Revision 1.4 1993/09/29 08:45:11 pk
  54. ;;;; Removed reference to long and deep lists.
  55. ;;;;
  56. ;;;; Revision 1.3 1993/09/24 08:01:18 pk
  57. ;;;; Changed version number from 1.0 to 1.1.
  58. ;;;; Added loading of version.scm and announcing of version.
  59. ;;;;
  60. ;;;; Revision 1.2 1993/09/23 06:50:00 pk
  61. ;;;; Moved definition of the Scheme variable psd-directory from the psd*.scm
  62. ;;;; files to psd.el, which sends it to the Scheme process. This way, the path
  63. ;;;; to psd needs to be specified only once.
  64. ;;;;
  65. ;;;; Revision 1.1 1993/09/22 12:45:32 pk
  66. ;;;; Initial revision
  67. ;;;;
  68. ;;;;
  69. ;;;;
  70. ;;;; Written by Pertti Kellomaki, pk@cs.tut.fi
  71. ;;;;
  72. ;;;; SLIB interface to load psd files.
  73. ;;;; This is the file that takes care of loading psd into the Scheme
  74. ;;;; interpreter. If you want to modify psd to work with a particular
  75. ;;;; implementation, say "foo", this is the way to do it:
  76. ;;;; 1) Make a copy of the file "psd.scm" under the name "psd-foo.scm",
  77. ;;;; and modify it to load "primitives-foo.scm" instead of
  78. ;;;; "primitives.scm". You can also do other things.
  79. ;;;;
  80. ;;;; 2) Make a copy of the file "primitives.scm" under the name
  81. ;;;; "primitives-foo.scm", and modify the definitions in it to
  82. ;;;; know about the additional primitives in your implementation
  83. ;;;;
  84. ;;;; 3) When you now set the Emacs variable scheme-program-name to
  85. ;;;; "foo" and give the commands ``M-x run-scheme'' ``M-x psd-mode'',
  86. ;;;; you have a psd system that knows about your additional
  87. ;;;; primitives.
  88. ;;; this is not portable.
  89. (define psd:control-z ((access-scheme-48 'ascii->char) 26))
  90. ; Neither is this.
  91. (define *psd-tab-char* ((access-scheme-48 'ascii->char) 9))
  92. ;;; FORCE-OUTPUT flushes any pending output on optional arg output port
  93. ;;; use this definition if your system doesn't have such a procedure.
  94. (define (force-output . arg)
  95. ((access-scheme-48 'force-output)
  96. (if (null? arg) (current-output-port) (car arg))))
  97. (load (string-append psd-directory "qp.scm"))
  98. (load (string-append psd-directory "version.scm"))
  99. (load (string-append psd-directory "instrum.scm"))
  100. (load (string-append psd-directory "pexpr.scm"))
  101. (load (string-append psd-directory "read.scm"))
  102. (load (string-append psd-directory "runtime.scm"))
  103. (load (string-append psd-directory "primitives.scm"))
  104. (define *psd-previous-line* #f)
  105. ;;;
  106. ;;; Say hello
  107. ;;;
  108. (psd-announce-version)
  109. (define error (access-scheme-48 'error))