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

115 commits

Author SHA1 Message Date
Andy Wingo
fbbc50caf8 remove define-private
* module/language/scheme/translate.scm: Remove define-private.
2008-05-11 22:03:50 +02:00
Andy Wingo
be852e52de pmatchify a cond for prettiness
* module/language/scheme/translate.scm: pmatchify, it's prettier.
2008-05-11 21:30:02 +02:00
Andy Wingo
9f8ec6eb1f fix errors in (language scheme translate) introduced in pmatchification
* module/language/scheme/translate.scm (trans-pair): Fix some errors
  introduced in pmatchification.
2008-05-04 14:28:16 +02:00
Andy Wingo
f245e62cf8 Refactor (language scheme translate) to use pmatch
* module/language/scheme/translate.scm: Refactor use of `match' to use
  `pmatch'. Relatively straightforward.

* module/system/base/pmatch.scm (ppat): Fix some copy-n-paste bugs: the _
  rule, the quote rule.
2008-05-04 13:26:00 +02:00
Andy Wingo
849cefacf1 unify variant types and records; also make-foo instead of <foo>
* module/system/base/syntax.scm (define-record): Rework to separate the
  type and its constructor. Now (define-record (<foo> bar)) will create
  `make-foo' as the constructor, not `<foo>'. Also the constructor now
  takes either keyword or positional arguments, so that it can be used as
  the implementation of variant types as well.
  (|): Map directly to define-record instead of rolling our own thing.

* module/language/scheme/translate.scm:
* module/system/base/language.scm:
* module/system/il/compile.scm:
* module/system/il/ghil.scm:
* module/system/il/glil.scm:
* module/system/repl/common.scm:
* module/system/vm/assemble.scm:
* module/system/vm/debug.scm: Change instances of record creation to use
  the make-foo procedures instead of <foo>. Adjust module exports as
  necessary.
2008-05-03 18:32:46 +02:00
Ludovic Courtes
b89fc2153e Slowly improving support for macro compilation.
* module/language/scheme/translate.scm (&current-macros): Removed.
  (&current-macro-module): Removed.
  (&compile-time-module): New.
  (eval-at-compile-time): New.
  (translate): Initialize `&compile-time-module'.
  (expand-macro)[use-syntax]: New case.
  [begin let...]: Don't expand these built-in macros.
  [else]: Rewrote the macro detection and invocation logic.  Invoke macro
  transformers in the current compile-time module.
  (trans): Let `expand-macro' raise an exception if needed.
  (trans-pair)[defmacro define-macro]: Evaluate the macro definition in
  the compile-time module.

* testsuite/t-match.scm: Use `use-syntax' instead of `use-modules' for
  `(ice-9 match)' and `(srfi srfi-9)'.

* testsuite/t-records.scm: Likewise.

git-archimport-id: lcourtes@laas.fr--2005-mobile/guile-vm--mobile--0.6--patch-15
2008-04-25 19:15:50 +02:00
Ludovic Courtes
9dbbe4bb83 Improved macro handling; started documenting the issue.
* doc/guile-vm.texi (Compiling Scheme Code): New node.

* module/language/scheme/translate.scm (&current-macro-module): New.
  (translate): Evaluate macros in `&current-macro-module'.
  (trans-pair): Likewise.

git-archimport-id: lcourtes@laas.fr--2005-mobile/guile-vm--mobile--0.6--patch-13
2008-04-25 19:09:30 +02:00
Ludovic Courtes
2335fb97dc Added support for defmacro' and define-macro' in the compiler.
* module/language/scheme/translate.scm: Use `(srfi srfi-39)'.
  (&current-macros): New top-level.
  (expand-macro): New.
  (scheme-primitives): Renamed `%scheme-primitives'.
  (%forbidden-primitives): New.
  (trans): Use `expand-macro' instead of `macroexpand'.
  (trans-pair): Handle `define-macro' and `defmacro'.

* module/system/base/compile.scm (call-with-compile-error-catch): Handle
  non-pair LOC.

* testsuite/t-macros2.scm: New test case.

* testsuite/Makefile.am (vm_test_files): Updated.

* testsuite/t-macros.scm: Test `read-options'.

git-archimport-id: lcourtes@laas.fr--2005-mobile/guile-vm--mobile--0.6--patch-9
2008-04-25 19:09:30 +02:00
Ludovic Courtes
48302624d9 Fixed error handling; detect and report macro expansion errors.
* module/language/scheme/translate.scm (trans): Catch exceptions thrown
  by `macroexpand' and throw a syntax error.
  (trans-pair): Catch calls to `procedure->memoizing-macro' and raise a
  syntax error.

* module/system/base/compile.scm (call-with-compile-error-catch): Made a
  macro (a procedure doesn't do the job).
  (compile-file): Uncommented call to `call-with-compile-error-catch'.

git-archimport-id: lcourtes@laas.fr--2005-mobile/guile-vm--mobile--0.6--patch-7
2008-04-25 19:09:30 +02:00
Ludovic Courtes
884d46de23 Tried compiling more code; augmented the doc.
* module/language/Makefile.am: New.

* module/language/scheme/Makefile.am: New.

* configure.in: Produce these two new Makefiles.

* doc/guile-vm.texi: Documented `compile-file', `compiled-file-name', and
  `compile-in'.

* module/system/base/compile.scm: Cosmetic changes.

* module/system/base/language.scm: Likewise.

* module/system/il/Makefile.am: Tried (and failed) to compile more
  things.

* module/system/vm/Makefile.am: All source files in here can now be
  compiled without harming further compilation.

* module/system/vm/assemble.scm: Select only specific bindings from
  `(system vm core)'.
  (dump-object!): Show a more meaningful error message.

* module/system/vm/conv.scm: Select only specific bindings from `(system
  vm core)'.

* module/system/vm/debug.scm: Likewise.

* module/system/vm/frame.scm: Changed the header.  Use a renamer for
  `(system vm core)'.

* src/guilec.in: Added options, via `getopt-long'.

git-archimport-id: lcourtes@laas.fr--2005-mobile/guile-vm--mobile--0.6--patch-6
2008-04-25 19:09:30 +02:00
Ludovic Courtes
b6368dbbb9 Fixed a Scheme translation bug; cleaned compilation with GCC 4.
* module/language/scheme/translate.scm (trans-pair): In the `set!' case,
  when a procedure-with-setter is passed, call `trans:pair' with an
  actual pair.  This fixes a long-lasting bug which prevented compilation
  of `set!' statements with procedures-with-setter (this showed up when
  compiling `(system vm assemble)').

* module/system/base/compile.scm: Added `objcode->u8vector' to the
  `#:select' clause.

* module/system/base/syntax.scm: Cosmetic changes.

* module/system/vm/assemble.scm (preprocess): Removed debugging
  statements.

* src/frames.c: Cosmetic changes.

* src/frames.h (SCM_FRAME_SET_DYNAMIC_LINK): New.

* src/objcodes.c: Use `scm_t_uint8' instead of `char' when relevant.

* src/vm.c (vm_heapify_frames_1): Use `SCM_FRAME_SET_DYNAMIC_LINK ()'.

* src/vm_loader.c: Added casts to mute GCC 4 warnings.

* testsuite/run-vm-tests.scm (*scheme*): Renamed to `%scheme'.
  (run-test-from-file): Renamed to `compile/run-test-from-file'.
  (run-vm-tests): Run each test using both the VM and the interpreter;
  compare the results.

* testsuite/t-proc-with-setter.scm: Try out `get/set'.

* doc/Makefile.am (info_TEXINFOS): New.

* doc/guile-vm.texi: Added index entries and indices.

* doc/texinfo.tex: New file.

git-archimport-id: lcourtes@laas.fr--2005-mobile/guile-vm--mobile--0.6--patch-5
2008-04-25 19:09:30 +02:00
Keisuke Nishida
ac99cb0cb1 *** empty log message *** 2001-04-22 02:13:48 +00:00
Keisuke Nishida
f21dfea659 *** empty log message *** 2001-04-19 03:09:27 +00:00
Keisuke Nishida
8f5cfc810f *** empty log message *** 2001-04-16 03:43:48 +00:00
Keisuke Nishida
c722838216 *** empty log message *** 2001-04-15 14:54:59 +00:00