1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-30 03:40:34 +02:00
Commit graph

78 commits

Author SHA1 Message Date
Taylan Kammer
242e8698c2 Better REPL behavior on syntax errors in meta commands.
Fixes <https://bugs.gnu.org/30600>.

* module/system/repl/command.scm (define-meta-command): Flush all
remaining input after handling a read error.
* module/system/repl/common.scm (flush-all-input): New public procedure.
* module/system/repl/repl.scm: Remove local flush-all-input definition.
2024-10-25 13:35:31 +02:00
Matthew Wette
8d21dd7eb8 Create procedure to enable silencing the Guile welcome message. * module/system/repl/repl.scm: add parameter %inhibit-welcome-message' * module/system/repl/repl.scm(run-repl*): add condition for calling procedure repl-welcome: if (%inhibit-welcome-message) is #t', don't 2024-10-12 13:16:35 +02:00
Ludovic Courtès
e2ed33ef04
Remove unnecessary module imports.
These were found with:

  make GUILE_WARNINGS='-W1 -Wunused-module'

* module/ice-9/copy-tree.scm:
* module/ice-9/eval-string.scm:
* module/ice-9/getopt-long.scm:
* module/ice-9/poll.scm:
* module/ice-9/popen.scm:
* module/ice-9/sandbox.scm:
* module/ice-9/threads.scm:
* module/sxml/apply-templates.scm:
* module/sxml/simple.scm:
* module/system/base/types.scm:
* module/system/repl/command.scm:
* module/system/repl/common.scm:
* module/system/repl/coop-server.scm:
* module/system/repl/debug.scm:
* module/system/repl/error-handling.scm:
* module/system/repl/repl.scm:
* module/system/repl/server.scm:
* module/system/vm/assembler.scm:
* module/system/vm/disassembler.scm:
* module/system/vm/dwarf.scm:
* module/system/vm/elf.scm:
* module/system/vm/frame.scm:
* module/system/vm/inspect.scm:
* module/system/vm/linker.scm:
* module/system/vm/program.scm:
* module/system/vm/trace.scm:
* module/system/vm/trap-state.scm:
* module/system/vm/traps.scm:
* module/system/xref.scm:
* module/texinfo/indexing.scm:
* module/texinfo/plain-text.scm:
* module/texinfo/reflection.scm:
* module/texinfo/string-utils.scm:
* module/web/client.scm:
* module/web/http.scm:
* module/web/request.scm:
* module/web/response.scm: Remove imports of unused modules.
2023-02-24 16:49:00 +01:00
David Thompson
b0a3149955 Add cooperative REPL server module.
Modified-by: Mark H Weaver <mhw@netris.org>

* module/system/repl/coop-server.scm: New module.

* module/system/repl/repl.scm (start-repl): Extract body to start-repl*.
  (start-repl*): New procedure.
  (run-repl): Extract body to run-repl*.
  (run-repl*): New procedure.

* module/system/repl/server.scm (run-server): Extract body to
  run-server*.
  (run-server*): New procedure.

* doc/ref/api-evaluation.texi (Cooperative REPL Servers): New node.

* module/Makefile.am (SYSTEM_SOURCES): Add system/repl/coop-server.scm.
2014-02-12 11:26:22 -05:00
Mark H Weaver
7520a9b95d Consume a peeked EOF at the REPL.
* module/system/repl/repl.scm (meta-reader): Consume peeked EOF.
2013-04-08 08:44:02 -04:00
Andy Wingo
5745de9172 current-language is a parameter in boot-9
* module/ice-9/boot-9.scm (current-language): New parameter.

* module/system/base/language.scm (*current-language*): Pull fluid from
  parameter.
  (current-language): Now a re-exported parameter.

* doc/ref/compiler.texi: Update reference from *current-language* fluid
  to current-language parameter.

* module/system/base/compile.scm (compile-and-load):
* module/ice-9/top-repl.scm (top-repl): Default to the current language,
  not to Scheme.

* module/ice-9/eval-string.scm:
* module/system/base/language.scm:
* module/system/repl/command.scm:
* module/system/repl/repl.scm: Update to use current-language parameter
  and parameterize.
2013-01-22 15:38:04 +01:00
Andy Wingo
2aef6c2ba9 ,language at REPL sets current-language
* module/system/repl/command.scm (language): Set the
  *current-language*.
* module/system/repl/repl.scm (start-repl): Create a new dynamic scope
  for *current-language*.
2011-12-04 21:56:13 +01:00
Andy Wingo
0c65f52c6d more define-syntax-rule usage
* module/ice-9/boot-9.scm:
* module/ice-9/control.scm:
* module/ice-9/futures.scm:
* module/ice-9/optargs.scm:
* module/ice-9/poll.scm:
* module/ice-9/receive.scm:
* module/ice-9/threads.scm:
* module/ice-9/vlist.scm:
* module/language/assembly/compile-bytecode.scm:
* module/language/ecmascript/compile-tree-il.scm:
* module/language/tree-il.scm:
* module/oop/goops.scm:
* module/oop/goops/simple.scm:
* module/oop/goops/stklos.scm:
* module/srfi/srfi-1.scm:
* module/srfi/srfi-35.scm:
* module/srfi/srfi-39.scm:
* module/srfi/srfi-45.scm:
* module/srfi/srfi-67/compare.scm:
* module/sxml/match.scm:
* module/system/repl/error-handling.scm:
* module/system/repl/repl.scm:
* module/system/vm/inspect.scm:
* module/texinfo.scm:
* module/web/server.scm: Use define-syntax-rule, where it makes sense.
2011-09-02 11:36:14 +02:00
Andy Wingo
bb455e4f94 allow ,option on-error report instead of debug
* module/system/repl/command.scm:
* module/system/repl/debug.scm (terminal-width): Move terminal-width
  here, make it thread-local, and export it.
  (print-locals, print-frame, print-frames): Default width to
  terminal-width.

* module/system/repl/error-handling.scm (call-with-error-handling): Add
  `report' and `backtrace' on-error handlers.

* module/system/repl/common.scm (repl-default-options): Add on-error
  REPL option, defaulting to `debug', but which may be changed.

* module/system/repl/repl.scm (run-repl): Pass the #:on-error REPL
  option to call-with-error-handling.
2011-03-17 12:39:59 +01:00
Andy Wingo
65fa60ca7a repl.scm understands comments
* module/system/repl/repl.scm (read-comment, read-scheme-line-comment)
  (read-scheme-datum-comment): New helpers.
  (meta-reader): Take a language instead of a reader.  If we have a
  nonwhitespace char, first check to see that it's a comment, and if so,
  read it off and loop.
  (prompting-meta-read): Call meta-reader with the lang.
2011-03-03 23:51:20 +01:00
Andy Wingo
859e58ae8a repl.scm refactor
* module/system/repl/repl.scm (flush-leading-whitespace): Rename from
  next-char.
  (meta-reader): Use flush-leading-whitespace.
  (run-repl): Use flush-to-newline after the evaluation, which seems to
  be the same as what we did before.
2011-03-03 23:19:35 +01:00
Andy Wingo
dcb7c7ddf5 flush all input on a read error
* module/system/repl/repl.scm (flush-all-input): New helper.
  (prompting-meta-read): Flush all input on a read error, as we could be
  within some expression or a string or something.
2011-02-27 23:26:08 +01:00
Andy Wingo
eaba53b7c8 repl.scm: use print-exception
* module/system/repl/repl.scm: Remove custom exception printers in favor
  of print-exception.
2011-02-11 12:57:08 +01:00
Andy Wingo
c372cd74fd repl read/write using current ports, not captured ports
Fixes bug in repl meta-commands after activating readline, which changes
the current input port.

* module/system/repl/common.scm (<repl>): Remove inport and outport
  fields.
  (make-repl): Adapt.
  (repl-read, repl-print): Just read and write to the current ports.

* module/system/repl/repl.scm (meta-reader): Meta-read from the current
  input port.

* module/system/repl/command.scm (read-command, define-meta-command):
  Read from the current input port.
2010-11-18 14:32:53 +01:00
Andy Wingo
29de6ae2e8 repl.scm displays syntax errors on read as well
* module/system/repl/repl.scm (prompting-meta-read): Use
  display-syntax-error as appropriate.
2010-11-18 12:21:36 +01:00
Andy Wingo
2090f909b4 add proper pretty-printing for syntax errors
* module/system/repl/repl.scm (display-syntax-error): New helper,
  displays a syntax error.
  (abort-on-error, run-repl): Use it.

* libguile/throw.c (handler_message): Re-code the same thing in C.
2010-11-16 02:57:27 +01:00
Andy Wingo
a627100bf3 further repl tweaks
* module/system/repl/error-handling.scm (error-string): Refactor a
  little.
  (call-with-error-handling): Ensure a trailing newline when printing
  the error-msg.

* module/system/repl/repl.scm (run-repl): We don't know the name of the
  meta-command here.
2010-10-08 19:27:45 +02:00
Ludovic Courtès
7390e4bd11 Fixlets for REPL error handling.
* module/system/repl/error-handling.scm (error-string): Don't call
  `display-error' when STACK is empty.
  (call-with-error-handling): Display ERROR-MSG instead of using
  `format', since ERROR-MSG may contain `format' escapes.

* module/system/repl/repl.scm (run-repl): Add missing argument to
  `format'.
2010-10-08 15:25:56 +02:00
Andy Wingo
35c46aad66 system repl repl comments
* module/system/repl/repl.scm (meta-reader): Add a comment about peek,
  read, and the EOF object.
2010-10-05 19:58:13 +02:00
Andy Wingo
78e836efff Revert "repl.scm next-char needed to read EOF from port"
Actually peek-char => EOF does not guarantee that read-char => EOF. I
don't know what to do about this.

This reverts commit 6e1dccc42f.
2010-10-04 22:54:41 +02:00
Andy Wingo
6e1dccc42f repl.scm next-char needed to read EOF from port
* module/system/repl/repl.scm (next-char): Actually read off the EOF if
  we got one. Interesting, this.
2010-10-03 23:08:27 +02:00
Andy Wingo
b0e556d4d0 avoid traps in repl except when evaluating the expression
* module/system/vm/trap-state.scm (with-default-trap-handler): Don't
  enable traps if we are setting a handler of #f.

* module/system/repl/error-handling.scm (call-with-error-handling): Add
  #:trap-handler arg.

* module/system/repl/repl.scm (run-repl): Only have traps enabled while
  running the thunk. Otherwise we trace on procedures called as part of
  the repl.
2010-09-23 13:45:23 +02:00
Ludovic Courtès
ac37b82d5b Fix typos.
* module/system/repl/repl.scm (run-repl): Fix variable name: `k', not
  `key'.

* module/texinfo/docbook.scm: Use `(srfi srfi-1)' for `fold'.
2010-09-02 00:04:39 +02:00
Andy Wingo
5bc97ad5dd ,x unbound does not quit repl
* module/system/repl/repl.scm (run-repl): Catch errors executing
  metacommands. Feature on top of feature...
2010-08-06 17:28:10 +02:00
Andy Wingo
5273854080 finally, backtraces only showing frames for the computation
* module/system/repl/repl.scm (run-repl): Run the thunk in a stack in a
  prompt, similar to the default prompt. Gives proper backtraces.

* module/system/repl/error-handling.scm (call-with-error-handling):
  Narrow one more outer frame, for the %start-stack thunk invocation.

* module/ice-9/boot-9.scm (%start-stack): Reindent.
2010-07-10 12:21:50 +02:00
Andy Wingo
ffe911f714 avoid running the debugger during parsing or compilation at the repl
* module/system/repl/repl.scm (abort-on-error): New helper.
  (run-repl): Don't enter the debugger during parsing or compilation of
  a repl expression. If you want to debug compilation, run compilation
  from the repl, not as part of the repl.
2010-07-09 18:58:01 +02:00
Andy Wingo
3ae78d95e6 tweaks to new repl
* module/system/repl/command.scm (read-command): Remove a pk.
* module/system/repl/repl.scm (run-repl): Export. Use % and abort to
  implement the prompt.
2010-07-09 18:22:08 +02:00
Andy Wingo
33df2ec719 integrate the debugger into the repl
* module/system/repl/debug.scm: New file, defines a data type to hold
  state for a debugger stack, and some helper procedures to print the
  stack or print a frame. Most pieces are from (system vm debug).

* module/system/repl/error-handling.scm: New file, implements
  call-with-error-handling and with-error-handling, and instead of going
  into a debugger, we go into a recursive repl that happens to have
  debugging information. Will be removing the old debugger from (system
  vm debug) shortly.

* module/Makefile.am (SYSTEM_SOURCES): Add error-handling and debug scm
  files.

* module/system/repl/repl.scm (prompting-meta-read): Better error
  handling -- we don't want to go into a debugger when reading a
  command.
  (start-repl): Add #:debug keyword argument, and just dispatch to
  run-repl.
  (run-repl): New function, with the guts of the old start-repl. Added a
  prompt, to which a throw to 'quit will abort.

* module/system/repl/common.scm (repl-prepare-eval-thunk): New
  helper. In the future we will use this to not enter the debugger on
  errors that happen at compile time.
  (repl-eval): Use repl-prepare-eval-thunk.
  (repl-print): Run the before-print-hook when printing a value.

* module/system/repl/command.scm (*command-table*): Move `option' to the
  `system' group. Move `trace' to the `profile' group. Add `debug' and
  `inspect' groups.
  (command-abbrevs): Rename from command-abbrev, and allow multiple
  abbreviations.
  (display-group): Fix the case where abbrev? was #f.
  (display-summary): Fix alignment of the command and
  abbreviations. Allow multiple abbreviations.
  (read-command): Rename from read-datum, and have better error
  handling.
  (meta-command): Better error handling.
  (define-meta-command): Better error handling.
  (help, show, import, compile, disassemble, time, profile, trace): Fix
  docstrings and error messages.
  (define-stack-command): New helper, for commands that operate on a
  saved stack.
  (backtrace, up, down, frame, procedure, locals): New debugger
  commands, in the REPL now.
  (inspect, pretty-print): New "inspect" commands.
2010-07-09 17:05:25 +02:00
Andy Wingo
652f48c062 use *repl-stack* instead of *repl-level*
* module/ice-9/boot-9.scm (*repl-stack*): Instead of repl-level, have a
  stack.
  (batch-mode?): Change to poke the stack.

* module/ice-9/deprecated.scm (set-batch-mode?!): Update deprecation
  method.

* module/system/repl/common.scm (repl-prompt): Update to poke
  *repl-stack* to get the level.

* module/system/repl/repl.scm (start-repl): Bind *repl-stack*
  appropriately.
2010-06-26 22:28:21 +02:00
Andy Wingo
a0d57eedfa don't bind the-last-stack in repl.scm
* module/system/repl/repl.scm (start-repl): Don't bind the-last-stack.
2010-06-19 13:36:53 +02:00
Andy Wingo
39d950fd21 repl whitespace fix
* module/system/repl/repl.scm: Fix whitespace.
2010-06-18 11:44:26 +02:00
Andy Wingo
c7317beca6 bind debugging i/o ports in start-repl
* module/system/repl/repl.scm (start-repl): If the debugging ports are
  unbound, bind them to the current i/o ports. Allows errors within
  with-output-to-foo / with-input-from-foo to be sensibly debugged.
2010-06-10 14:15:26 +02:00
Andy Wingo
7b69cafd0a repl.scm simplifications
* module/system/repl/repl.scm (prompting-meta-read): Use
  call-with-error-handling.

* module/system/vm/debug.scm (call-with-error-handling): Add case for
  #:on-error 'pass. Have the catch handler return the unspecified value.
2010-06-10 14:15:26 +02:00
Andy Wingo
b93c34c0ca start cleaning up repl/debugger error handling
* module/system/repl/repl.scm (prompting-meta-read): Catch and print
  read errors here, returning unspecified in that case.
  (start-repl): Don't enable the debugger while reading expressions.
  Adapt with-backtrace to with-error-handling.

* module/system/vm/debug.scm (run-debugger, debugger-repl): No need to
  take a stack, the frames vector is sufficient.
  (call-with-error-handling, with-error-handling): New public utilities.
  Notably they do not poke the-last-stack.
2010-06-10 14:15:26 +02:00
Andy Wingo
11da3f2bd6 hygienic with-backtrace
* module/system/repl/repl.scm (with-backtrace): Make a syntax-rules
  macro.
2010-06-10 14:15:26 +02:00
Andy Wingo
3098986b1a recursive repl support
* module/system/repl/common.scm (*repl-level*): New public fluid.
  (repl-prompt): If *repl-level* is a positive integer, add it to the
  prompt.

* module/system/repl/repl.scm (start-repl): The `lang' argument is now
  optional, and defaults to (current-language). New kwargs level and
  welcome; level defaults to 0, or 1+ the existing level, and the
  welcome is a boolean, true if level is 0. Parameterize *repl-level*
  during the dynamic extent of this repl. Also, parameterize
  the-last-stack to #f for the duration of this repl.

* module/system/vm/debug.scm (frame->module, debugger-repl): Stubs of a
  recursive repl implementation. The idea is to be a repl in the lexical
  context of the error; but it would be nice to be able to operate in
  the module of the proc too, for example to export bindings. Hmm.
2010-06-02 22:19:40 +02:00
Andy Wingo
1ad7fef524 implement a silly debugger
* module/system/vm/debug.scm: Implement the skeleton of a debugger. Not
  very useful yet.

* module/system/repl/repl.scm (call-with-backtrace): Have the pre-unwind
  hook drop the user into the debugger. Hopefully we can have something
  better within a couple weeks.
2009-12-22 23:38:06 +01:00
Andy Wingo
4b2afc6258 language-readers receive environment as an arg
* module/language/assembly/spec.scm:
* module/language/brainfuck/spec.scm:
* module/language/bytecode/spec.scm:
* module/language/ecmascript/spec.scm:
* module/language/glil/spec.scm:
* module/language/scheme/spec.scm:
* module/language/tree-il/spec.scm: Language-readers now take two
  arguments: the port and the environment. This should allow for
  compile-environment-specific reader behavior.

* module/system/base/compile.scm (read-and-compile):
* module/system/repl/common.scm (repl-read): Pass the environment to the
  language-reader.

* module/system/repl/repl.scm (meta-reader, prompting-meta-read):
* module/system/repl/command.scm (define-meta-command): Use the second
  argument to repl-reader, so we avoid frobbing current-reader.
2009-10-16 13:39:24 +02:00
Ludovic Courtès
e5f5113c21 Remove unused variables in system/language.
* module/language/assembly.scm (byte-length): Don't match unused
  record slots.

* module/language/tree-il.scm (tree-il->scheme, post-order!,
  pre-order!): Likewise.

* module/language/tree-il/analyze.scm (analyze-lexicals): Likewise.

* module/language/tree-il/compile-glil.scm (flatten): Likewise.

* module/language/assembly/disassemble.scm (disassemble-load-program):
  Don't match unused list elements.

* module/language/glil/decompile-assembly.scm (decompile-toplevel,
  decompile-load-program): Likewise.

* module/system/xref.scm (program-callee-rev-vars): Likewise.

* module/language/assembly/compile-bytecode.scm
  (write-bytecode)[write-sized-loader]: Remove.

* module/language/assembly/decompile-bytecode.scm (decode-load-program):
  Factorize `pad' variables.

* module/language/ecmascript/base.scm (object->value/string,
  object->value/number)[v]: Remove.

* module/language/ecmascript/tokenize.scm (read-slash)[c0]: Remove.

* module/language/objcode/spec.scm (decompile-value)[nargs]: Remove.

* module/system/repl/command.scm (time)[vms-start, vms-end]: Remove.

* module/system/repl/repl.scm (prompting-meta-read): Use `prompt'.
2009-09-21 00:36:31 +02:00
Andy Wingo
0d646345f4 flush whitespace from the repl input buffer *before* evaluation
* module/system/repl/repl.scm (start-repl): Given that the input port of
  the repl is line-buffered, it's likely we have #\newline in the input
  that is strictly extraneous, an in-band indicator to the repl that it
  should begin reading now. So flush out that newline, so that you can
  (read-char) at the repl, and it actually does wait for you to type in
  a char instead of just returning #\newline.

  While it's not an overriding concern, this does fix some brainfuck
  programs that want to input from the user.
2009-06-22 22:57:48 +02:00
Andy Wingo
eb72179985 meta-commands read off their own arguments
* module/system/repl/command.scm: Update copyright.
  (meta-command): Rework so that it's the various meta-commands that do
  the reading for their arguments. This way you can compile forms that
  span more than one line, and forms that need to be read with another
  language's reader.
  (define-meta-command): New helper macro. Update commands to use it.
  (help): Allow ,help on commands too.

* module/system/repl/repl.scm: Update copyright.
  (start-repl): Adjust to give meta-command what it wants.
2009-06-22 20:45:01 +02:00
Andy Wingo
1351c2dba5 fix backtraces with compiled boot-9
* module/ice-9/boot-9.scm (default-pre-unwind-handler): Since we were
  tail-called by pre-unwind-handler-dispatch, we can't use
  pre-unwind-handler-dispatch as a narrowing argument. Instead just
  narrow by one frame.
  (pre-unwind-handler-dispatch): Deprecate.
  (error-catching-loop): Remove crack comment and code, and just use
  default-pre-unwind-handler as our pre-unwind handler.

* module/ice-9/stack-catch.scm (stack-catch):
* module/system/repl/repl.scm (call-with-backtrace): Use
  default-pre-unwind-handler directly.
2009-05-26 21:51:42 +02:00
Andy Wingo
8239263f86 fix erroneous #:use-syntax clausen
* module/system/repl/command.scm:
* module/system/repl/common.scm:
* module/system/repl/repl.scm:
* module/system/vm/debug.scm:
* module/system/vm/trace.scm: Change #:use-syntax to #:use-module, as
  that's really what we want to do.
2009-04-22 22:27:50 +02:00
Andy Wingo
c15fa41c0c unbork the repl
* module/system/repl/repl.scm (meta-reader): Whoops, unbork the repl.
2009-02-24 23:34:26 +01:00
Andy Wingo
abf780e45e in meta-reader, return directly if the peeked char is EOF
* module/system/repl/repl.scm (meta-reader): If the (next-char #t)
  returns EOF, return that EOF directly, as it seems that with guile -q,
  the subsequent `read' actually waits for another C-d. Dunno why.
2009-02-24 23:16:58 +01:00
Andy Wingo
ff73ae34c3 finish compiler.texi, woo
* libguile/objcodes.c (do-pair): Removed unused debuging hack.

* module/language/glil/spec.scm (glil): Simplify a bit.

* module/system/repl/repl.scm (default-catch-handler): Don't catch
  vm-error, as vm-backtrace doesn't exist any more.

* doc/ref/compiler.texi: Finish documenting GLIL and object code.
2009-01-11 14:23:48 +01:00
Andy Wingo
9f0e9918f4 repl.scm relies on `display-backtrace' to do everything, some naming tweaks
* module/ice-9/boot-9.scm (default-pre-unwind-handler): Rename from
  default-lazy-handler.
  (pre-unwind-handler-dispatch): Rename from lazy-hadler-dispatch.
  (error-catching-loop): Adjust caller.

* module/system/repl/repl.scm (default-pre-unwind-handler): Remove this
  definition, in favor of the default one in boot-9.
  (default-catch-handler): Don't do a vm-backtrace, as we will soon be
  relying on core machinery to do that for us.
  (call-with-backtrace): Start a new stack for the thunk.
  (with-backtrace): Macro version of call-with-backtrace.
  (start-repl): Use with-backtrace for brevity. Start a stack with #t as
  the tag instead of repl-eval, because all traces of repl-eval are gone
  after it does a tail-call.

* module/ice-9/debugger.scm:
* module/ice-9/debugging/traps.scm:
* module/ice-9/stack-catch.scm: Adapt to s/lazy/pre-unwind/ in
  boot-9.scm.
2008-12-26 18:07:20 +01:00
Andy Wingo
b0b180d522 nifty generic compiler infrastructure -- no more hardcoded passes
* module/system/base/language.scm (<language>): Rework so that instead of
  hardcoding passes in the language, we define compilers that translate
  from one language to another. Add `parser' to the language fields, a
  bit of a hack but useful for languages with s-expression external
  representations but with record internal representations.
  (define-language, *compilation-cache*, invalidate-compilation-cache!)
  (compute-compilation-order, lookup-compilation-order): Add an algorithm
  that does a depth-first search for a translation path from a source
  language to a target language, caching the result in a lookup table.

* module/language/scheme/spec.scm:
* module/language/ghil/spec.scm: Update to the new language format.

* module/language/glil/spec.scm: Add a language specification for GLIL,
  with a compiler to objcode. Also there are parsers and printers, for
  repl usage, but for some reason this doesn't work yet.

* module/language/objcode/spec.scm: Define a language specification for
  object code. There is some sleight of hand here, in the "compiler" to
  values; but there is method behind the madness, because this way we
  higher levels can pass environments (a module + externals pair) to
  objcode->program.

* module/language/value/spec.scm: Define a language specification for
  values. There is something intellectually dishonest about this, but it
  does serve its purpose as a foundation for the language hierarchy.

* configure.in:
* module/language/Makefile.am
* module/language/ghil/Makefile.am
* module/language/glil/Makefile.am
* module/language/objcode/Makefile.am
* module/language/value/Makefile.am:
  Autotomfoolery for the ghil, glil, objcode, and value languages.

* module/language/scheme/translate.scm (translate): Import the bits that
  understand `compile-time-environment' here, and pass on the relevant
  portions of the environment to the next compiler pass.

* module/system/base/compile.scm (current-language): New procedure, refs
  the current language fluid, or lazily sets it to scheme.
  (call-once, call-with-output-file/atomic): Refactor these bits to use
  with-throw-handler. No functional change.
  (compile-file, compile-and-load, compile-passes, compile-fold)
  (compile): Refactor the public interface of the compiler to be generic
  and simple. Uses `lookup-compilation-order' to find a path from the
  source language to the target language.

* module/system/base/syntax.scm (define-type): Adapt to changes in
  define-record.
  (define-record): Instead of expecting all slots in the first form,
  expect them in the body, and let the first form hold the options.

* module/system/il/compile.scm (compile): Adapt to the compilation pass
  API (three in and two out).

* module/system/il/ghil.scm (<ghil-var>, <ghil-env>)
  (<ghil-toplevel-env>): Adapt to define-record changes.

* module/system/il/glil.scm (<glil-vars>): Adapt to define-record
  changes.
  (<glil>, print-glil): Add a GLIL record printer that uses unparse.
  (parse-glil, unparse-glil): Update unparse (formerly known as pprint),
  and write a parse function.

* module/system/repl/common.scm (<repl>): Adapt to define-record changes.
  (repl-parse): New function, parses the read form using the current
  language. Something of a hack.
  (repl-compile): Adapt to changes in `compile'.
  (repl-eval): Fix up the does-the-language-have-a-compiler check for
  changes in <language>.

* module/system/repl/repl.scm (start-repl): Parse the form before eval.

* module/system/repl/command.scm (describe): Parse.
  (compile): Be more generic.
  (compile-file): Adapt to changes in compile-file.
  (disassemble, time, profile, trace): Parse.

* module/system/vm/debug.scm:
* module/system/vm/assemble.scm: Adapt to define-record changes.

* module/language/scheme/translate.scm (receive): Fix an important bug
  that gave `receive' letrec semantics instead of let semantics. Whoops!
2008-11-14 22:42:31 +01:00
Andy Wingo
1bb6b839ec handle throws to unknown keys in the repl
* module/system/repl/repl.scm (default-catch-handler): Don't rethrow if
  we don't know the key, just print an error.
2008-10-09 11:10:25 +02:00
Andy Wingo
edb1d1d78d remove repl.scm's start-stack definition
* module/system/repl/repl.scm: Now that we actually compile start-stack,
  no need to provide our own definition here.
2008-10-03 15:07:09 +02:00