psd-s48.scm 4.7 KB

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