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

163 commits

Author SHA1 Message Date
Andy Wingo
fb6e61ca21 beginnings of letrec* support in the expander
* libguile/expand.h (SCM_EXPANDED_LETREC_IN_ORDER_P)
  (SCM_MAKE_EXPANDED_LETREC): Add a new field to letrec, in-order?. Will
  be used to support letrec*.

* libguile/expand.c (LETREC, expand_named_let, expand_letrec): Adapt
  code.

* module/language/elisp/compile-tree-il.scm (compile-pair):
* module/ice-9/psyntax.scm (build-named-let, build-letrec): Pass #f for
  in-order? to `make-letrec'.

* module/ice-9/psyntax-pp.scm: Regenerate.

* module/language/tree-il.scm: Add letrec-in-order? accessor.
  (parse-tree-il, unparse-tree-il): Parse and unparse an in-order?
  letrec as `letrec*'.
  (tree-il->scheme): Serialize letrec*.
2010-06-17 13:43:26 +02:00
Andy Wingo
246ea9e16a remove `version' field from <language>
* module/system/base/language.scm (<language>): Remove the `version'
  field from languages. It just wasn't useful.

* module/language/assembly/spec.scm:
* module/language/brainfuck/spec.scm:
* module/language/bytecode/spec.scm:
* module/language/ecmascript/spec.scm:
* module/language/elisp/spec.scm:
* module/language/glil/spec.scm:
* module/language/objcode/spec.scm:
* module/language/scheme/spec.scm:
* module/language/tree-il/spec.scm:
* module/language/value/spec.scm: Remove #:version from all language
  definitions. Shorten some language names (e.g. "Guile Scheme" ->
  "Scheme").
2010-05-02 11:19:13 +02:00
Andy Wingo
92a61010bd change remaining %nil -> #nil
* doc/ref/vm.texi:
* libguile/boolean.h:
* libguile/pairs.h:
* module/language/elisp/README:
* test-suite/tests/elisp-compiler.test:
* test-suite/tests/load.test: Change remaining mentions of %nil to #nil.
2010-04-09 21:06:29 +02:00
Andy Wingo
474060a23c elisp fixes for nil, and, or
* module/language/elisp/runtime/macro-slot.scm (or, and): Fix one-arg
  case to return the arg as-is.

* module/language/elisp/runtime.scm (nil-value): Fix to be #nil.
2010-04-09 21:06:29 +02:00
Andy Wingo
54e53aa430 %nil -> #nil
* module/language/assembly.scm (object->assembly, assembly->object):
* module/language/elisp/compile-tree-il.scm (compile-pair):
* module/language/glil/decompile-assembly.scm (decompile-load-program):
  Change instances of %nil to #nil.
2010-04-09 14:17:04 +02:00
Ludovic Courtès
eb80072df0 Change the Elisp compiler from GPLv2+ to LGPLv3+.
* module/language/elisp/bindings.scm, module/language/elisp/lexer.scm,
  module/language/elisp/parser.scm, module/language/elisp/runtime.scm,
  module/language/elisp/runtime/function-slot.scm,
  module/language/elisp/runtime/macro-slot.scm,
  module/language/elisp/runtime/value-slot.scm: Switch from GPLv2+ to
  LGPLv3+; fix copyright year.
2009-12-15 19:10:48 +01:00
Andy Wingo
e42573315b merge from master to elisp
* module/language/elisp/compile-tree-il.scm: Update for changes to
  tree-il (lambda-case, mainly).

* module/language/elisp/spec.scm: Update GPL version to 3. Update reader
  for new taking a port and environment argument.

* libguile/_scm.h: Bump objcode version.

* libguile/vm-i-system.c: Fix conflicts.

* module/Makefile.am: Fix conflicts, and add elisp modules to the build.
2009-12-11 10:45:18 +01:00
Andy Wingo
27c8177fe4 remove GHIL, Elisp, and R5RS languages
GHIL is obsolete, and it's about time we got rid of it. Elisp and R5RS
were unmodified since their import from Guile-VM, so we ditch them too.

R5RS compilation is supported via compiling Scheme within an R5RS
environment.

Elisp will be supported when we merge in Daniel's work.
2009-10-16 12:20:06 +02:00
Daniel Kraft
9a9f123144 Support circular structures in elisp reader.
* module/language/elisp/lexer.scm: Recognize circular markers.
* module/language/elisp/parser.scm: Handle them correctly.
* test-suite/tests/elisp-reader.test: Check circular structure parsing.
2009-08-27 18:49:29 +02:00
Daniel Kraft
9e90010f07 Replaced generated elisp parser with hand-written one to fix source properties.
* module/language/elisp/parser.scm: Hand-written parser.
* test-suite/tests/elisp-reader.test: Test for source properties.
2009-08-27 17:15:57 +02:00
Daniel Kraft
15eeabfd53 Don't accept backquote/unquote/unquote-splicing any longer in elisp.
The real names \`, \, and \,@ should be used instead and are returned
now by the real reader.

* module/language/elisp/compile-tree-il.scm: Only accept correct names.
2009-08-27 16:19:03 +02:00
Daniel Kraft
98c2d75a15 Error in lexer when 'empty' symbol would have been read. 2009-08-26 22:03:01 +02:00
Daniel Kraft
e840cc6540 Parser for elisp and use it as reader.
* module/language/elisp/parser.scm: New parser file.
* module/language/elisp/lexer.scm: Fix lexer/1 and add unquote-splicing support.
* module/language/elisp/spec.scm: Use new elisp-reader.
* module/language/elisp/README: Document we've got a reader now.
* test-suite/tests/elisp-reader.test: Test the parser.
2009-08-26 21:36:37 +02:00
Daniel Kraft
ddb4364b1a get-lexer/1 for elisp that finishes after the first full expression is read.
* module/language/elisp/lexer.scm: Add get-lexer/1.
* test-suite/tests/elisp-reader.test: Test lexer/1.
2009-08-26 21:03:06 +02:00
Daniel Kraft
5b1ee3bef1 Character and string literal support for the elisp lexer.
* module/language/elisp/lexer.scm: Handle character and string literals.
* test-suite/tests/elisp-reader.test: Test it.
2009-08-26 19:48:06 +02:00
Daniel Kraft
25512a940b A first, rough lexer for elisp still missing some stuff.
* module/language/elisp/lexer.scm: New lexer file.
* test-suite/Makefile.am: Register elisp-reader.test as new test.
* test-suite/tests/elisp-reader.test: New test-case.
2009-08-26 14:32:48 +02:00
Daniel Kraft
1b1195f29b Abstracted dynamic binding a little off the fluids.
* module/language/elisp/compile-tree-il.scm: Move dynamic binding to one place
  and changed names that refer to `fluids' for dynamic binding.
* module/language/elisp/bindings.scm: Changed names referring to `fluids'.
2009-08-04 09:23:02 +02:00
Daniel Kraft
f4dc86f137 Implement catch and unwind-protect as macros.
* module/language/elisp/compile-tree-il.scm: Remove catch and unwind-protect.
* module/language/elisp/runtime/macro-slot.scm: Re-implement them here.
2009-08-03 18:22:12 +02:00
Daniel Kraft
dfbc6e9d54 Allow lexical binding of lambda arguments.
* module/language/elisp/compile-tree-il.scm: Rework lambda compiler to allow
  opional lexical binding of (some) lambda arguments.
* test-suite/tests/elisp-compiler.test: Check this.
2009-08-01 13:00:27 +02:00
Daniel Kraft
c808c926fd Compiler option to always bind certain symbols lexically.
Affects so far let-bound symbols, lambda arguments to come in the future.

* module/language/elisp/README: Document it.
* module/language/elisp/compile-tree-il.scm: Add :always-lexical option.
* test-suite/tests/elisp-compiler.test: Test it.
2009-07-31 18:00:01 +02:00
Daniel Kraft
bfd472a7d3 Use explicit guile-primitive forms in the macro expansion of dotimes and dolist. 2009-07-30 21:49:00 +02:00
Daniel Kraft
e6042c08b7 Implement some elisp constructs in macros instead of hard-coded compiler code.
* module/language/elisp/compile-tree-il.scm: Remove implementation of prog1,
  and, or, cond, dolist.
* module/language/elisp/runtime/macro-slot.scm: Implement them here instead.
2009-07-30 21:43:24 +02:00
Daniel Kraft
f3df67e203 without-void-checks as new extension for fine-control
* module/language/elisp/README: Document it.
* module/language/elisp/compile-tree-il.scm: Handle without-void-checks.
* test-suite/tests/elisp-compiler.test: Test it.
2009-07-30 13:51:45 +02:00
Daniel Kraft
e96a9591ce funcall, apply and eval built-ins.
* module/language/elisp/README: Document new features.
* module/language/elisp/runtime/function-slot.scm: Implement funcall, apply and
  eval by using the existing compiler code.
* test-suite/tests/elisp-compiler.test: Test those.
2009-07-29 16:27:45 +02:00
Daniel Kraft
c61ec8e29e Added guile-primitive construct for references to primitives from Elisp.
* module/language/elisp/README: Document it.
* module/language/elisp/compile-tree-il.scm: Implement guile-primitive.
* test-suite/tests/elisp-compiler.test: Switched a usage of guile-ref to
  the now available guile-primitive.
2009-07-29 14:25:33 +02:00
Daniel Kraft
c2c7c27755 Added length built-in.
* module/language/elisp/runtime/function-slot.scm: Add length built-in.
* test-suite/tests/elisp-compiler.test: Test length.
2009-07-29 13:45:40 +02:00
Daniel Kraft
a6a5cf03d4 Implemented lexical-let and lexical-let* for elisp.
* module/language/elisp/README: Document it.
* module/language/elisp/bindings.scm: New fields in bindings data structure
  to keep track of lexical bindings for symbols.
* module/language/elisp/compile-tree-il.scm: Implement lexical-let(*).
* test-suite/tests/elisp-compiler.test: Test lexical scoping with lexical-let.
2009-07-29 12:09:43 +02:00
Daniel Kraft
a089997441 Compiler option to disable void-checks in elisp.
* module/language/elisp/README: Document the change.
* module/language/elisp/compile-tree-il.scm: Add disable-void-check option.
* test-suite/tests/elisp-compiler.test: Test it.
2009-07-24 11:09:57 +02:00
Daniel Kraft
a90d9c855d Don't pass the bindings-data all around in compile-tree-il, but use fluids for this dynamic binding.
* module/language/elisp/compile-tree-il.scm: Use fluid for bindings-data.
2009-07-24 10:40:07 +02:00
Daniel Kraft
e8f18b3f63 Implemented the flet and flet* extensions.
* module/language/elisp/README: Document it.
* module/language/elisp/compile-tree-il.scm: Implement flet and flet*.
* test-suite/tests/elisp-compiler.test: Test flet and flet*.
2009-07-24 09:56:13 +02:00
Daniel Kraft
3709984696 Implemented dynamic symbol access built-ins (set, fset, symbol-value, makunbound...)
* module/language/elisp/README: Document it.
* module/language/elisp/compile-tree-il.scm: Moved ensure-fluid! to runtime function.
* module/language/elisp/runtime.scm: Runtime functions to support dynamic value access.
* module/language/elisp/runtime/function-slot.scm: Defined the built-ins.
* test-suite/tests/elisp-compiler.test: Test them.
2009-07-23 14:09:55 +02:00
Daniel Kraft
33da12eeff Added guile-ref extension construct, change throw implementation to easier one using a built-in function and implement unwind-protect.
* module/language/elisp/README: Document the changes.
* module/language/elisp/compile-tree-il.scm: Implement unwind-protect.
* module/language/elisp/runtime/function-slot.scm: throw as built-in.
* test-suite/tests/elisp-compiler.test: Test unwind-protect.
2009-07-22 12:50:56 +02:00
Daniel Kraft
35b2e41d6d Implemented catch and throw in elisp.
* module/language/elisp/README: Document this.
* module/language/elisp/compile-tree-il.scm: Implement catch and throw.
* test-suite/tests/elisp-compiler.test: Test catch/throw.
2009-07-22 12:23:03 +02:00
Daniel Kraft
5d221ca375 Don't ensure fluids all over the place but scan for variables needed and ensure just before the compiled code all those.
* module/language/elisp/README: Document this.
* module/language/elisp/compile-tree-il.scm: Implement it here, pass bindings all around the compilation.
* module/language/elisp/bindings.scm: New module with symbol-tracking abilities needed for this.
2009-07-21 16:45:10 +02:00
Daniel Kraft
fb66a47a8e Implemented prog1, prog2, dotimes, dolist control structures.
* module/language/elisp/README: Document it and some further ideas written down.
* module/language/elisp/compile-tree-il.scm: Implement prog1, dolist.
* module/language/elisp/runtime/macro-slot.scm: prog2 and dotimes.
* test-suite/tests/elisp-compiler.test: Test prog1, prog2, dotimes, dolist.
2009-07-20 20:52:00 +02:00
Daniel Kraft
f614ca12cd Implemented some important list built-ins.
* module/language/elisp/runtime.scm: Updated/added convenience macros.
* module/language/elisp/runtime/function-slot.scm: Implement list built-ins.
* module/language/elisp/runtime/macro-slot.scm: Implement list built-ins.
* test-suite/tests/elisp-compiler.test: Test the implemented built-ins.
2009-07-18 20:10:24 +02:00
Daniel Kraft
7d1a978289 Implemented unless, when and dotimes using built-in macros.
* module/language/elisp/README: Document that.
* module/language/elisp/runtime.scm: Defined built-in-macro macro.
* module/language/elisp/runtime/macro-slot.scm: Implement unless, when, dotimes.
* test-suite/tests/elisp-compiler.test: Test for those constructs.
2009-07-18 18:38:42 +02:00
Daniel Kraft
570c12aca7 Return correct value for setq form.
* module/language/elisp/compile-tree-il.scm: Fix implementation of setq.
* test-suite/tests/elisp-compiler.test: Check for value of setq form.
2009-07-18 17:58:01 +02:00
Daniel Kraft
9b5ff6a6e1 Implemented real quotation (added support for backquotation).
* module/language/elisp/README: Document that.
* module/language/elisp/compile-tree-il.scm: Implement backquote.
* test-suite/tests/elisp-compiler.test: Test quotation and backquotes.
2009-07-18 17:32:59 +02:00
Daniel Kraft
e905e490fa Implemented eq and equal built-in predicates.
* module/language/elisp/runtime/function-slot.scm: Implement eq and equal.
* test-suite/tests/elisp-compiler.test: Test them.
2009-07-18 17:21:55 +02:00
Daniel Kraft
74c009dadc Implemented macros in elisp compiler.
* module/language/elisp/README: Document it.
* module/language/elisp/compile-tree-il.scm: Implement defmacro and expansion.
* module/language/elisp/runtime/macro-slot.scm: New module to keep definitions.
* test-suite/Makefile.am: Add elisp-compiler.test to list of tests.
* test-suite/tests/elisp-compiler.test: Basic macro tests.
2009-07-16 15:23:38 +02:00
Daniel Kraft
b6b9d59604 Extended test-suite to cover already implemented built-ins and fixed errors found.
* module/language/elisp/runtime/function-slot.scm: Fixed errors in number preds.
* test-suite/tests/elisp-compiler.test: Test built-ins already implemented.
2009-07-16 14:28:07 +02:00
Daniel Kraft
d158fa62ab Test-suite for elisp compiler so far, excluding the built-ins.
* test-suite/tests/elisp-compiler.test: Tests for compiler so far.
2009-07-15 22:08:36 +02:00
Daniel Kraft
09241ea7f7 Removed wrong not in zerop built-in.
* module/language/elisp/runtime/function-slot.scm: Fix zerop.
2009-07-15 13:51:19 +02:00
Daniel Kraft
de9f26b5f0 Implemented defconst, defvar, defun special forms for elisp.
* module/language/elisp/README: Document this.
* module/language/elisp/compile-tree-il.scm: Implement defconst/defvar/defun.
2009-07-14 21:18:07 +02:00
Daniel Kraft
1e018f6c67 Some bug fixes on the way and mainly implemented some built-ins (arithmetic).
* module/language/elisp/README: Document changes.
* module/language/elisp/compile-tree-il.scm: Bug fixes to fluid-creation.
* module/language/elisp/runtime.scm: Some helping definitions for built-ins.
* module/language/elisp/runtime/function-slot.scm: Defined artihmetic built-ins.
2009-07-13 18:35:57 +02:00
Daniel Kraft
f28de79197 Automatically create fluids when necessary.
* module/language/elisp/README: Document that.
* module/language/elisp/compile-tree-il.scm: Create fluids when necessary.
* module/language/elisp/runtime/function-slot.scm: Fix module name.
2009-07-13 17:26:07 +02:00
Daniel Kraft
cef997e82a Fixed lambda expressions and implemented function calls using the basic list notation.
* module/language/elisp/README: Document that.
* module/language/elisp/compile-tree-il.scm: Implement function calls.
2009-07-13 16:51:05 +02:00
Daniel Kraft
50abfe7649 Lambda expressions in elisp, but not yet function calls.
* module/language/elisp/README: Document this.
* module/language/elisp/compile-tree-il.scm: Implement lambda expressions.
2009-07-13 15:43:53 +02:00
Daniel Kraft
3a4b86357e Implemented let and let* in elisp.
* module/language/elisp/README: Document it.
* module/language/elisp/compile-tree-il.scm: Implement let and let*.
2009-07-07 19:38:25 +02:00