New patches: [unrevert anonymous**20060116211333] < > { hunk ./inspector.scm 487 ;;; General compound data + +;** This code assumes that all environments are flat, which is the case +;** in Scheme48 1.3. It would have to be changed if the environment +;** representation were to change. + +(define-method &inspect-object ((closure :closure)) + (values "A closure." + 'closure + (let ((template (closure-template closure)) + (env (closure-env closure))) + `(,@(if (zero? (vector-length env)) + '() + `("Environment:" + ,@(inspect-environment + env + (debug-data-env-shape + (template-debug-data template) + #f)) ; No PC + ,newline ,newline)) + "Template: " (,template))))) + +(define (inspect-environment env shape) + (let ((len (vector-length env))) + (define (with-names i names result) + (cond ((= i len) + (reverse result)) + ((not (pair? names)) + (with-no-names i result)) + (else + (with-names (+ i 1) (cdr names) + (append-reverse `(,newline ,i ,(name-label (car names)) + ,(safe-vector-ref env i)) + result))))) + (define (with-no-names i result) + (if (= i len) + (reverse result) + (with-no-names (+ i 1) + (append-reverse `(,newline ,i ,(safe-vector-ref env i)) + result)))) + (if (pair? shape) + (with-names 0 (car shape) '()) + (with-no-names 0 '())))) + +(define (name-label name) + (if (symbol? name) + name + (string-append (circular-write-to-string name) + ": "))) hunk ./packages.scm 229 disassembler ;++ Scheme48 command processor and ought ;++ to be replaced. byte-vectors + closures + (subset debug-data (debug-data-env-shape)) + (subset disclosers (template-debug-data)) ) (optimize auto-integrate) (files inspector)) } Context: [Implemented disassembly of debugger frames. Taylor Campbell **20060116205645] [Modified slime48.el to provide the `slime48' feature after loading. Taylor Campbell **20060116204238] [Fixed LOAD-FILE hack for appending .scm extension so that it works even if the .scm extension is already there, rather than causing LOAD to lose due to receiving a bogus filename argument. Taylor Campbell **20060116204056] [Reorganized and simplified code to inspect vectors and templates, and added disassembly to template inspection. Taylor Campbell **20060116203650] [Clarified note about slowness and warnings in loading SLIME48. Taylor Campbell **20060116203215] [Removed unnecessary `slime-lisp-implementations' cruft in slime48.el, now that it has been moved into the suggested initialization code in the README. Taylor Campbell **20051218192501] [Turned on Scheme48's LOAD-NOISILY switch in `slime48-init-command'. Taylor Campbell **20051218191227] [Overhauled README to reflect integration with SLIME's new Lisp implementation selection system, rather than the old, manual SLIME48 startup routine. Taylor Campbell **20051218191202] [Renamed CL:BREAK -> SWANK:SIMPLE-BREAK, since the change was made in SLIME CVS. Taylor Campbell **20051218170639] [Removed ,IN & ,IN-PACKAGE REPL shortcut, since it was added to SLIME CVS. Taylor Campbell **20051218170547] [Added SWANK:COMPILER-MACROEXPAND & SWANK:COMPILER-MACROEXPAND-1 to macro expansion RPC interface. Taylor Campbell **20051218165529] [Implemented SWANK:PPRINT-INSPECTOR-PART. Taylor Campbell **20051218165348] [Fixed SWANK:SET-PACKAGE to load the package if it is not already loaded before setting the interaction environment to it. Taylor Campbell **20051218163318] [Added scheme-mode & scheme48-mode to the recognized SLIME Lisp modes in slime48.el. Taylor Campbell **20051218162016] [Fixed source disclosure hack for CALL-WITH-VALUES so that it will not barf if the first operand is not a LAMBDA expression. Taylor Campbell **20051218161809] [Implemented procedure definition finding. Taylor Campbell **20051218161625] [Changed SWANK:LIST-ALL-PACKAGE-NAMES to list all the structures in the Swank world, not all the packages. Taylor Campbell **20051218160912 (See the comment inserted above the change for details.) ] [Fixed completion so that generated names defined in a package would not cause errors when trying to complete. Taylor Campbell **20051218160634] [Clarified error message for unbound variables in MAYBE-BINDING-VALUE in module.scm. Taylor Campbell **20051108065538] [Fixed circular writing of dotted lists to include the dotted cdr. Taylor Campbell **20051107221650] [Implemented the Swank compilation & loading RPCs. Taylor Campbell **20051103044127] [Fixed redefinition by tossing in the package mutation sentinel at every RPC evaluation. Redefining a binding in one package should now update all references to it in compiled code of other packages. Taylor Campbell **20051103044041] [Implemented SWANK:UNDEFINE-FUNCTION (which can undefine anything, of course, not just functions, because Scheme does not separate namespaces). Taylor Campbell **20051103043943] [Fixed implementation of USE-PACKAGE so that it would actually load the package first. Taylor Campbell **20051103033502] [Fixed SWANK:SLDB-ABORT, which was previously operating on a bogus assumption that there should always be an ABORT restarter even after skipping the one set up by Swank. Taylor Campbell **20051102224735] [Implemented generalization of SWANK:QUIT-LISP, so that SLIME48 started from Emacs can exit the Scheme48 image on ,QUIT and SLIME48 started manually in a pre-existing Scheme48 image can specify how SLIME48's quit should be handled, which by default only terminates the Swank session. Taylor Campbell **20051101214549] [Updated for the new connection info & multiple Lisp support in SLIME. Taylor Campbell **20051101204345 `slime48.el' is now usable, because an erroneous reference to my own local function LOAD-SLIME was replaced, and useful to others, because it provides utilities for starting up SLIME48 on its own. Also, the hack of setting the default values of SLIME-LISP-PACKAGE:CONNLOCAL & SLIME-LISP-PACKAGE-PROMPT-STRING:CONNLOCAL is no longer needed, due to SLIME's new general support for multiple Lisps. ] [Massively reworked SLDB basis and abstracted much functionality into a separate module. Taylor Campbell **20051010214926] [Introduced LIMITED-WRITING structure for a more general limited writing facility to replace that of DISPLAY-CONDITIONS. Taylor Campbell **20051004180829 The LIMITED-WRITING structure provides centralized fluids for the current depth & length for limited writing and removes the need for passing explicit arguments and maintaining this information manually, so all of the randomness like REPL-PRINT-DEPTH, SLDB-PRINT-LENGTH, &c., has been expunged. LIMITED-WRITE-TO-STRING from STRING-I/O now also respects the current write depth & length. ] [Reflected changes to REPL-EVAL-STRING's interface in inspector and SLDB evaluation-in-frame commands. Taylor Campbell **20051004165850] [Simplified and tightened a number of packages' OPEN clauses in packages.scm. Replaced two erroneously introduced references to SIGNALS with SIMPLE-SIGNALS. Taylor Campbell **20051004164346] [Implemented fancy inspection of byte vectors. Taylor Campbell **20051004153353] [Upcased quoted literal symbols in apropos output to match the convention of the rest of the code. Taylor Campbell **20051004065939] [Changed evaluation in SLDB frames to use UID->PACKAGE to compute the package to evaluate in reliably, rather than guessing heuristically from the package name in the frame's debug data record. Taylor Campbell **20051004064417] [Implemented UID->PACKAGE in MODULE-CONTROL. Taylor Campbell **20051004064209] [Fixed typo: 'elsewherea' -> 'elsewhere' in comment about internal facility interfaces in interfaces.scm. Taylor Campbell **20051004021514] [Finished listing of Swank RPC interfaces in interfaces.scm and corrected some entries. Taylor Campbell **20051004021442] [Corrected boolean argument interpretation in SWANK:APROPOS-LIST-FOR-EMACS RPC. Taylor Campbell **20051003195115] [Implemented apropos support. Taylor Campbell **20051003193137] [Implemented simple name completion. Taylor Campbell **20051003192828] [Fixed the one remaining -*- line, of module.scm, that specified scheme48-mode and a 'package' local variable. Taylor Campbell **20051003071440] [Removed half-assed definitions of PACKAGE-OPEN! & PACKAGE-UNDEFINE! from module.scm and replaced them with the built-in PACKAGE-MUTATION structure's exports. Taylor Campbell **20051003055950 Package mutation is now more likely to work, though I haven't tried it yet. I previously avoided PACKAGE-MUTATION because I was also using my own hacks for undefined global errors (to install restarts) and because I thought it probably relied on the presence of the rest of the built-in command processor's bulk, which is not the case. ] [Introduced USE-PACKAGE Swank RPC and ,USE(-PACKAGE) SLIME REPL command. Taylor Campbell **20051003055921] [Added slime48.el, a collection of utilities augmenting slime.el on the Emacs side of SLIME48. Taylor Campbell **20051003050915] [Expounded on hackishness of the #. reader macro needed to implement presentations. Taylor Campbell **20051003041953] [Fixed backwards REPL presentation switch toggling. Taylor Campbell **20051003041508] [Removed uses of POSIX pids, which don't work on Windows and which are unnecessary for multithreaded Swank servers, only SIGIO ones. Taylor Campbell **20051003040724] [Renamed :READ-OUTPUT -> :WRITE-STRING in Scheme-to-Emacs output interface. Taylor Campbell **20051003040600] [Made circular writer ignore nil. Taylor Campbell **20051003040542] [Brought REPL & inspector up to date and implemented REPL presentations. Taylor Campbell **20051003040138] [Renamed defrectype*.scm to defrectype.scm. Taylor Campbell **20051002001616] [Modified SLIME48-START in load.scm & SLIME48 in top.scm to accept an option for specifying either a port or a file to write the OS-selected port to. Taylor Campbell **20050921033206 SLIME48-START & SLIME48 now have an optional argument, which may be either a number or a string: if it is a number, the Swank TCP server listens on that service; if it is a string, the selection of the port number is left to the OS, and then a file is created whose contents are that port number, for the remote system to poll to find the port by which to connect to the Scheme48 Swank server. ] [Introduced SWANK-TCP-SERVER-PORT-NUMBER. Taylor Campbell **20050921033132] [Added a log message when closing Swank TCP servers. Taylor Campbell **20050918165911] [Fixed the SLIME48 starter so that the README's explanation of how to close the server is accurate. Taylor Campbell **20050918165828] [Changed '-*- mode: scheme48; package: ... -*-' lines to '-*- mode: scheme; scheme48-package: ... -*-' in all Scheme source files. Taylor Campbell **20050918165405 Not everyone has scheme48.el, and a buffer-local `package' variable is a bad idea, because it is frequently meant to be a function-local variable in elisp, but WITH-CURRENT-BUFFER would pre-empt that. ] [Added circular writing (CL-style #n=... & #n#). Taylor Campbell **20050918005251 Implemented a simple CIRCULAR-WRITE (naively written using alists for the circular object tables) and improved the safety of several parts by using that instead of the standard writer or the pretty-printer, which are now used only where safe or necessary. ] [initial revision Taylor Campbell **20050918004210] Patch bundle hash: 4ae2451410ecb7b46727eb6807cacf5a0c3cd53b