Andy Wingo [Tue, 26 May 2009 20:23:44 +0000 (22:23 +0200)]
adjust VM copyright notices to LGPL, use SCM_INTERNAL/API properly
* libguile/frames.c:
* libguile/frames.h:
* libguile/instructions.c:
* libguile/instructions.h:
* libguile/objcodes.c:
* libguile/objcodes.h:
* libguile/programs.c:
* libguile/programs.h:
* libguile/vm-bootstrap.h:
* libguile/vm-engine.c:
* libguile/vm-engine.h:
* libguile/vm-expand.h:
* libguile/vm-i-scheme.c:
* libguile/vm.c:
* libguile/vm.h: Update to use SCM_API and SCM_INTERNAL correctly. Adjust
copyright to be the same as the copyright of Guile itself, which should
be fine given that the FSF holds the whole thing.
Andy Wingo [Tue, 26 May 2009 19:47:45 +0000 (21:47 +0200)]
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.
Andy Wingo [Tue, 26 May 2009 14:03:37 +0000 (16:03 +0200)]
distcheck fix, fix (ice-9 time)
* lang/Makefile.am (elisp_sources): Add elisp/expand.scm.
* module/ice-9/time.scm (time): Fix for new macro expander. Ew.
Andy Wingo [Mon, 25 May 2009 20:45:42 +0000 (22:45 +0200)]
update docs -- sections on assembly and objcode
* doc/ref/api-procedures.texi:
* doc/ref/compiler.texi:
* doc/ref/vm.texi: Update the docs some more.
Andy Wingo [Sun, 24 May 2009 11:09:01 +0000 (13:09 +0200)]
update docs, clean up VM vestiges, macro docs, fix (/ a b c)
* doc/ref/api-procedures.texi (Compiled Procedures): Fix for API changes.
* doc/ref/compiler.texi (Compiling to the Virtual Machine): Replace GHIL
docs with Tree-IL docs. Update the bits about the Scheme compiler to
talk about Tree-IL and the expander instead of GHIL. Remove
<glil-argument>. Add placeholder sections for assembly and bytecode.
* doc/ref/vm.texi: Update examples with what currently happens. Reword
some things. Fix a couple errors.
* libguile/vm-i-system.c (externals): Remove this instruction, it's not
used.
* module/ice-9/documentation.scm (object-documentation): If the object is
a macro, try to return documentation on the macro transformer.
* module/language/assembly/disassemble.scm (disassemble-load-program):
Fix problem in which we skipped the first element of the object vector,
because of changes to procedure layouts a few months ago.
* module/language/scheme/spec.scm (read-file): Remove read-file
definition.
* module/language/tree-il.scm: Reorder exports. Remove <lexical>, it was
a compat shim to something that was never released. Fix `location'.
* module/language/tree-il/primitives.scm (/): Fix expander for more than
two args to /.
* module/system/base/compile.scm (read-file-in): Remove unused
definition.
* module/system/base/language.scm (system): Remove language-read-file.
* module/language/ecmascript/spec.scm (ecmascript): Remove read-file
definition.
Andy Wingo [Fri, 22 May 2009 19:14:48 +0000 (21:14 +0200)]
fix (oop goops) compilation for (language tree-il primitives)
* module/oop/goops.scm (compile): Whoop-dee, fix up (oop goops) for
(language tree-il primitives) change.
Andy Wingo [Fri, 22 May 2009 19:12:42 +0000 (21:12 +0200)]
source location tracking in psyntax, booya!
* module/ice-9/psyntax.scm (source-annotation): Return #f if
source-properties returns null.
(source-wrap): Rework a bit.
(syntax-type): Don't throw away source info for wrapped expressions.
Can has source location info, fools!
(chi-body): Correctly propagate source info for body subforms.
(syntax): Remove special case for map, it doesn't apply (ahem) for
Guile.
* module/ice-9/psyntax-pp.scm: Regenerate.
Andy Wingo [Fri, 22 May 2009 17:48:14 +0000 (19:48 +0200)]
remove annotations in psyntax in favor of guile's source properties
* module/ice-9/psyntax.scm: Remove references to annotation objects,
we're just going to try and use Guile's source properties now. It works
until `syntax' reconstructs output, at which point it seems we lose it.
* module/ice-9/psyntax-pp.scm: Regenerated.
Andy Wingo [Fri, 22 May 2009 17:26:58 +0000 (19:26 +0200)]
fix problem naming internal definitions
* module/ice-9/psyntax.scm (chi-body): Fix a problem introduced in
dc1eed52f71, that internal syntax definitions were included in the id
lis along with value definitions. Only showed up on a second bootstrap.
Psyntax, how I love thee.
* module/ice-9/psyntax-pp.scm
Andy Wingo [Fri, 22 May 2009 14:07:41 +0000 (16:07 +0200)]
move things to (language tree-il primitives)
* module/language/tree-il/optimize.scm:
* module/language/tree-il/primitives.scm: Move primitive-related things
to primitive.scm from inline.scm and optimize.scm.
* module/Makefile.am: Update for inventory changes.
Andy Wingo [Fri, 22 May 2009 11:00:23 +0000 (13:00 +0200)]
fix tree-il test to work if source info happens to be present
* module/language/tree-il/compile-glil.scm (flatten-lambda): Fix source
emission.
* test-suite/tests/tree-il.test (strip-source): Strip source info on
tree-il before compiling, so we don't get extraneous source info in the
glil. Make check passes!
Andy Wingo [Fri, 22 May 2009 10:48:45 +0000 (12:48 +0200)]
fix bad call to make-glil-src
* module/language/tree-il/compile-glil.scm (flatten-lambda): Fix bad call
to make-glil-src, unfortunately not hit during production because
psyntax doesn't yet understand source locations.
Andy Wingo [Fri, 22 May 2009 10:45:49 +0000 (12:45 +0200)]
fix expansion of (ice-9 threads)
* module/ice-9/threads.scm: Move syntax definitions before the procedures
that use them, and rewrite as hygienic macros since they are so much
nicer that way. Fixes the thread tests.
Andy Wingo [Fri, 22 May 2009 10:22:39 +0000 (12:22 +0200)]
syntax.test is passing, yay
* test-suite/tests/syntax.test ("top-level define"): Remove the test for
currying, as we don't do that any more by default. It should be easy
for the user to add in if she wants it, though.
("do"): Remove unmemoization tests, as sc-expand fully expands `do'.
("while"): Remove while tests in empty environments. They have been
throwing 'unresolved, and the problem they seek to test is fully
handled by hygiene anyway.
And otherwise tweak expected exception strings, and everything passes!
Andy Wingo [Fri, 22 May 2009 10:08:50 +0000 (12:08 +0200)]
residualize names into procedures. re-implement srfi-61. module naming foo.
* module/ice-9/boot-9.scm (cond): Implement srfi-61; most of the code is
from the SRFI itself. Yuk.
(%print-module, make-modules-in, %app, (%app modules))
(module-name): Syncase needs to get at the names of modules, even at
anonymous modules. So lazily assign gensyms as module names. Name %app
as (%app), but since (%app modules) is at the top of the module
hierarchy, name it ().
* module/ice-9/psyntax.scm: When building tree-il, try to name lambdas in
definitions and in lets.
(let, letrec): Give more specific errors in a couple of cases.
* module/ice-9/psyntax-pp.scm: Regenerated.
* test-suite/tests/syntax.test: More work. Many exceptions have different
messages than they used to, many more generic; we can roll this back to
be faithful to the original strings, but it doesn't seem necessary to
me.
Andy Wingo [Thu, 21 May 2009 20:43:07 +0000 (22:43 +0200)]
some work on syntax.test
* module/language/tree-il.scm (tree-il->scheme):
* module/ice-9/psyntax.scm (build-conditional): Attempt to not generate
(if #f #f) as the second arm of an if, but it doesn't seem to be
successful.
* module/ice-9/psyntax-pp.scm (syntax-rules): Regenerate.
* test-suite/tests/syntax.test (exception:unexpected-syntax): Change
capitalization.
("unquote-splicing"): Update test.
("begin"): Add in second arms on these ifs, to avoid the strange though
harmless expansion of `if'.
(matches?): New helper macro.
("lambda"): Match on lexically bound symbols, as they will be
alpha-renamed.
Andy Wingo [Thu, 21 May 2009 20:11:48 +0000 (22:11 +0200)]
catch syntax errors in unquote and unquote-splicing
* module/ice-9/psyntax.scm (quasiquote): Catch syntax errors in unquote
and unquote-splicing.
* module/ice-9/psytax-pp.scm: Regenerated.
Andy Wingo [Thu, 21 May 2009 19:39:37 +0000 (21:39 +0200)]
fix multiple values returning from srfi-18's `with-exception-handler'
* module/srfi/srfi-18.scm (with-exception-handler): Hah! Fixed a
scurrilous bug in which we assumed that the thunk returned one or more
values. Hah.
Andy Wingo [Thu, 21 May 2009 19:13:24 +0000 (21:13 +0200)]
fix apply and call/cc in drop contexts
* module/language/tree-il/compile-glil.scm (flatten): Actually apply only
needs one arg after the proc. And shit, call/cc and apply in drop
contexts also need to be able to return arbitrary numbers of values;
work it by trampolining through their applicative (non-@) definitions.
Also, simplify the single-valued drop case to avoid the
truncate-values.
* module/language/tree-il/inline.scm (call/cc):
* module/language/tree-il/optimize.scm (*interesting-primitive-names*):
Define call/cc as "interesting". Perhaps we should be hashing on value
and not on variable.
* test-suite/tests/tree-il.test ("application"): Fix up test for new,
sleeker output. (Actually the GLIL is more verbose, but the assembly is
better.)
("apply", "call/cc"): Add some more tests.
Andy Wingo [Thu, 21 May 2009 15:22:58 +0000 (17:22 +0200)]
procedures in "drop" contexts can return unspecified values
* module/language/tree-il/compile-glil.scm (flatten): For applications in
"drop" context, allow the procedure to return unspecified values
(including 0 values).
* test-suite/tests/tree-il.test ("application"): Adapt test.
* module/srfi/srfi-18.scm (wrap): Clarify.
* test-suite/tests/srfi-18.test: Fix so that the expression importing
srfi-18 is expanded before the tests. However the tests are still
failing, something about 0-valued returns...
Andy Wingo [Thu, 21 May 2009 14:04:14 +0000 (16:04 +0200)]
fix srfi-17.test
* test-suite/tests/srfi-17.test (exception:bad-quote): Change the
expected exception for (set! (quote foo) ...) errors.
Andy Wingo [Thu, 21 May 2009 13:34:29 +0000 (15:34 +0200)]
just parse method arguments once.
* module/oop/goops.scm (method): Tweak to just run through the arguments
once. Thanks to Eli Barzilay for the tip.
Andy Wingo [Thu, 21 May 2009 11:49:00 +0000 (13:49 +0200)]
rewrite `method' as a hygienic macro to re-allow lexical specializers
* module/oop/goops.scm (method): Reimplement as a hygienic macro. This
seriously took me like 6 hours to figure out. Allows for lexical
specializers: (let ((<x> ...)) (define-method (foo (arg <x>)) ...)).
* module/oop/goops/compile.scm (next-method?, compile-make-procedure):
Remove these, as `method' does it all now, hygienically.
Andy Wingo [Wed, 20 May 2009 16:11:23 +0000 (18:11 +0200)]
fix failing macro-as-parameter tests in eval.test
* module/ice-9/psyntax.scm (chi-lambda-clause): Strip the docstring
before passing it on to the continuation.
* module/ice-9/psyntax-pp.scm: Regenerated.
* test-suite/tests/eval.test (exception:failed-match): New exception, for
syntax-case failed matches.
("evaluator"): Fix macro-as-parameter tests. They pass now :)
Andy Wingo [Wed, 20 May 2009 15:41:21 +0000 (17:41 +0200)]
remove compile-time-environment
* module/ice-9/boot-9.scm (guile-user): Move the `compile' autoload to
the guile-user module. Remove reference to compile-time-environment.
* module/language/scheme/compile-ghil.scm:
* module/language/tree-il/compile-glil.scm:
* module/language/tree-il/optimize.scm:
* module/system/base/compile.scm:
* test-suite/tests/compiler.test: Remove definition of and references to
compile-time-environment. While I do think that recompilation based on
a lexical environment can be useful, I think it needs to be implemented
differently. So for now we've lost nothing if we take it away, as it
doesn't work with syncase anyway.
Andy Wingo [Wed, 20 May 2009 15:28:59 +0000 (17:28 +0200)]
Fix a bug in the (ice-9 match) test
* testsuite/t-match.scm (matches?): Fix match invocation. As far as I can
tell, although (ice-9 match) does advertise a => form of clauses, it
requires that the end of the => be a symbol. For some reason this
works in the interpreter:
((lambda () (begin => #t)))
It's part of the expansion of matches?. It also worked in the old
compiler. Thinking that maybe toplevel references could cause side
effects, I made the new compiler actually ref =>, which brought this to
light.
Andy Wingo [Wed, 20 May 2009 11:59:42 +0000 (13:59 +0200)]
fix @slot-ref / @slot-set! compilation
* module/language/tree-il/compile-glil.scm: Add primcall compilers for
@slot-ref and @slot-set.
* module/language/tree-il/optimize.scm (add-interesting-primitive!): New
export. Creates an association between a variable in the current module
and a primitive name.
* module/oop/goops.scm: Rework compiler hooks to work with tree-il and
not ghil.
Andy Wingo [Wed, 20 May 2009 11:33:44 +0000 (13:33 +0200)]
compile `list' and `vector' to their associated opcodes
* module/language/glil/compile-assembly.scm (glil->assembly): Check the
length when emitting calls to variable-argument stack instructions.
Allow two-byte lengths -- allows e.g. calls to `list' with more than
256 arguments.
* module/language/tree-il/compile-glil.scm: Add primcall associations for
`list' and `vector', with any number of arguments. Necessary because
syncase's quasiquote expansions will produce calls to `list' with many
arguments.
* module/language/tree-il/optimize.scm (*interesting-primitive-names*):
Add `list' and `vector' to the set of primitives to resolve.
Andy Wingo [Wed, 20 May 2009 10:46:23 +0000 (12:46 +0200)]
don't allocate too many locals for expansions of `or'
* module/language/tree-il/analyze.scm (analyze-lexicals): Add in a hack
to avoid allocating more locals than necessary for expansions of `or'.
Documented in the source.
* test-suite/tests/tree-il.test: Add a test case.
Andy Wingo [Wed, 20 May 2009 09:59:41 +0000 (11:59 +0200)]
a few fixups
* module/ice-9/psyntax.scm (chi-install-global, syntax-case): Fix a
couple of cases in which bare datums were passed to output
constructors.
* module/ice-9/psyntax-pp.scm: Regenerated.
* module/language/scheme/spec.scm (scheme): Clean up the #:compilers
list.
* module/language/tree-il/compile-glil.scm (flatten): Fix call to
`length' in call/cc compiler.
Andy Wingo [Wed, 20 May 2009 09:15:22 +0000 (11:15 +0200)]
and, or, cond etc use syntax-rules, compile scheme through tree-il
* libguile/vm-i-system.c:
* libguile/vm-engine.h (ASSERT_BOUND): New assertion, that a value is
bound. Used by local-ref and external-ref in paranoid mode.
* module/ice-9/boot-9.scm (and, or, cond, case, do): Since we are
switching to use psyntax as the first pass of the compiler, and perhaps
soon of the interpreter too, we need to make sure it expands out all
forms to primitive expressions. So define expanders for these derived
syntax forms, as in the R5RS report.
* module/ice-9/psyntax-pp.scm: Regenerate, with core forms fully
expanded.
* module/ice-9/psyntax.scm (build-void): New constructor, for making
undefined values.
(build-primref): Add in a hack so that primitive refs in the boot
module expand out to toplevel refs, not module refs.
(chi-void): Use build-void.
(if): Define an expander for if that calls build-conditional.
* module/language/scheme/compile-tree-il.scm (compile-tree-il): Use let*
so as not to depend on binding order for the result of
(current-module).
* module/language/scheme/spec.scm (scheme): Switch over to tree-il as the
primary intermediate language. Not yet fully tested, but at least it
can compile psyntax-pp.scm.
* module/language/tree-il/analyze.scm (analyze-lexicals): Arguments don't
count towards a function's nlocs.
* module/language/tree-il/compile-glil.scm (*comp-module*, compile-glil):
Define a "compilation module" fluid.
(flatten-lambda): Fix a call to make-glil-argument. Fix bug in
heapifying arguments.
(flatten): Fix number of arguments passed to apply instruction. Add a
special case for `(values ...)'. If inlining primitive-refs fails,
try expanding into toplevel-refs if the comp-module's variable is the
same as the root variable.
* module/language/tree-il/optimize.scm (resolve-primitives!): Add missing
src variable for <module-ref>.
* test-suite/tests/tree-il.test ("lambda"): Fix nlocs counts. Add a
closure test case.
Andy Wingo [Mon, 18 May 2009 21:45:35 +0000 (23:45 +0200)]
add tree-il->glil compilation test suite
* module/language/tree-il.scm (parse-tree-il): Fix a number of bugs.
(unparse-tree-il): Apply takes rest args now.
* module/language/tree-il/analyze.scm (analyze-lexicals)
(analyze-lexicals): Heap vars shouldn't increment the number of locals.
* module/language/tree-il/optimize.scm (resolve-primitives!): Don't
resolve public refs to primitives, not at the moment anyway.
* test-suite/Makefile.am (SCM_TESTS): Add tree-il test.
* test-suite/lib.scm (pass-if, expect-fail, pass-if-exception)
(expect-fail-exception): Rewrite as syntax-rules macros. In a very
amusing turn of events, it turns out that bindings introduced by
hygienic macros are not visible inside expansions produced by
defmacros. This seems to be expected, so go ahead and work around the
problem.
* test-suite/tests/srfi-31.test ("rec special form"): Expand in eval.
* test-suite/tests/syntax.test ("begin"): Do some more expanding in eval,
though all is not yet well.
* test-suite/tests/tree-il.test: New test suite, for tree-il->glil
compilation.
Andy Wingo [Sun, 17 May 2009 23:08:34 +0000 (01:08 +0200)]
special cases for more types of known applications
* module/language/tree-il/compile-glil.scm (flatten): Handle a number of
interesting applications, and fix a bug for calls in `drop' contexts.
* module/language/tree-il/inline.scm: Define expanders for apply,
call-with-values, call-with-current-continuation, and values.
Andy Wingo [Sun, 17 May 2009 21:24:26 +0000 (23:24 +0200)]
inline calls to some primitives
* module/system/base/pmatch.scm: Wrap consequents in (let () ) instead of
(begin ) so that they can have local definitions.
* module/language/tree-il/compile-glil.scm: Inline some calls to
primitives.
Andy Wingo [Sun, 17 May 2009 16:04:36 +0000 (18:04 +0200)]
define `delay' in terms of make-promise
* module/ice-9/boot-9.scm (delay): Define `delay' in terms of
make-promise.
* module/ice-9/psyntax-pp.scm (compile): Regenerated with a fully
compiled Guile, so that the gensym numbers are the same.
* module/language/tree-il/compile-glil.scm: Add some notes about what
needs doing to catch up to the old compiler.
Andy Wingo [Sun, 17 May 2009 14:46:46 +0000 (16:46 +0200)]
and now, we residualize the original names into the metadata. yay!
* module/language/tree-il/compile-glil.scm (vars->bind-list)
(emit-bindings, flatten-lambda, flatten): Write the original names into
<glil-bind> structures. Yaaaaay!
Andy Wingo [Sun, 17 May 2009 14:39:55 +0000 (16:39 +0200)]
actually pass original ids on to tree-il data types
* module/ice-9/psyntax.scm (build-lambda, build-let, build-named-let)
(build-letrec): Actually pass along the original ids to tree-il
constructors.
* module/ice-9/psyntax-pp.scm: Regenerated.
* module/language/tree-il.scm: Add fields in <lambda>, <let>, and
<letrec> for the original variable names.
* module/language/tree-il/compile-glil.scm (compile-glil): Adapt for new
make-lambda arg.
Andy Wingo [Sun, 17 May 2009 14:27:18 +0000 (16:27 +0200)]
preserve original var names in lets and lambdas
* module/ice-9/psyntax.scm (build-letrec, build-let, build-lambda)
(build-named-let): Take extra args for the original names of the
gensyms. Not used yet. Callers adapted.
* module/ice-9/psyntax-pp.scm: Regenerated.
Andy Wingo [Fri, 15 May 2009 21:44:14 +0000 (23:44 +0200)]
tree-il -> glil compiler works now, at least in initial tests
* module/language/tree-il/analyze.scm: Break analyzer out into its own
file.
* module/language/tree-il/compile-glil.scm: Port the GHIL->GLIL compiler
over to work on tree-il. Works, but still misses a number of important
optimizations.
* module/language/tree-il.scm: Add <void>. Not used quite yet.
* module/language/glil.scm: Remove <glil-argument>, as it is the same as
<glil-local> (minus an offset).
* module/language/glil/compile-assembly.scm:
* module/language/glil/decompile-assembly.scm:
* module/language/ghil/compile-glil.scm: Adapt for <glil-argument>
* removal.
* module/Makefile.am (TREE_IL_LANG_SOURCES): Reorder, and add
analyze.scm.
Andy Wingo [Wed, 13 May 2009 22:11:25 +0000 (00:11 +0200)]
add lexical analyzer and allocator
* module/language/tree-il/optimize.scm: Rework to just export the
optimize! procedure.
* module/language/tree-il/compile-glil.scm (analyze-lexicals): New
function, analyzes and allocates lexical variables. Almost ready to
compile now.
(codegen): Dedent.
Andy Wingo [Tue, 12 May 2009 20:29:34 +0000 (22:29 +0200)]
add primitive expander for tree-il
* module/Makefile.am: Add inline.scm.
* module/language/tree-il.scm (pre-order!, post-order!): pre-order! is
new. post-order! existed but was not public. They do destructive tree
traversals of tree-il, and need more documentation. Also, add
predicates to tree-il's export list.
* module/language/tree-il/inline.scm: New file, which expands primitives
into more primitive primitives. In the future perhaps it will not be
necessary, as the general inlining infrastructure will handle these
cases, but for now it's useful.
* module/language/tree-il/optimize.scm: Move post-order! out to better
pastures.
Andy Wingo [Mon, 11 May 2009 21:23:34 +0000 (23:23 +0200)]
add tree-il optimizer
* module/language/tree-il/optimize.scm: New module, for optimizations.
Currently all we have is resolving some toplevel refs to primitive
refs.
* module/Makefile.am: Add new module.
* module/language/tree-il.scm: Fix exports for accessors for `src'.
* module/language/tree-il/compile-glil.scm: Tweaks, things still aren't
working yet.
Andy Wingo [Fri, 8 May 2009 10:56:18 +0000 (12:56 +0200)]
more work on tree-il compilation
* module/language/scheme/amatch.scm: Remove, this approach won't be used.
* module/Makefile.am: Adjust for additions and removals.
* module/language/scheme/compile-ghil.scm: Remove an vestigial debugging
statement.
* module/language/scheme/spec.scm:
* module/language/scheme/compile-tree-il.scm:
* module/language/scheme/decompile-tree-il.scm: Add tree-il compiler and
decompiler.
* module/language/tree-il/compile-glil.scm: Add some notes.
* module/language/tree-il/spec.scm: No need to wrap expressions in
lambdas -- GHIL needs somewhere to put its variables, we don't.
Andy Wingo [Thu, 7 May 2009 15:44:51 +0000 (17:44 +0200)]
go ahead and regenerate psyntax-pp.scm
Andy Wingo [Thu, 7 May 2009 15:38:40 +0000 (17:38 +0200)]
remove (ice-9 expand-support)
* module/ice-9/Makefile.am:
* module/ice-9/expand-support.scm: Remove module, no longer used.
* module/ice-9/psyntax.scm: Fix a comment.
Andy Wingo [Thu, 7 May 2009 11:45:03 +0000 (13:45 +0200)]
new language: tree-il. psyntax generates it when run in compile mode.
* module/Makefile.am: Add tree-il sources.
* module/ice-9/compile-psyntax.scm: Adjust for sc-expand producing
tree-il in compile mode.
* module/ice-9/psyntax.scm: Switch from expand-support to tree-il for
generating output in compile mode. Completely generate tree-il -- the
output wasn't Scheme before, but now it's completely not Scheme.
* module/ice-9/psyntax-pp.scm: Regenerated.
* module/language/scheme/compile-ghil.scm: Strip structures using
tree-il, not expand-support.
* module/language/tree-il.scm:
* module/language/tree-il/spec.scm
* module/language/tree-il/compile-glil.scm: New language. It will compile
to GLIL, though it doesn't yet.
Andy Wingo [Thu, 7 May 2009 09:02:10 +0000 (11:02 +0200)]
make expand-support structure constructors take a source argument
* module/ice-9/expand-support.scm (make-module-ref, make-lexical): Add
source arguments to these constructors.
* module/ice-9/psyntax.scm:
* module/ice-9/psyntax-pp.scm: Adapt to match, though we don't wire
everything up yet.
Andy Wingo [Thu, 7 May 2009 08:27:53 +0000 (10:27 +0200)]
fix install-global construction of `define' forms
* module/ice-9/psyntax.scm (build-global-definition): Remove mod
argument, as it does not seem we could ever define something in another
module.
(chi-install-global): Build the define as a definition, not an
application. Doesn't matter now, but it will later.
(chi-top): Fix build-global-definition call.
* module/ice-9/psyntax.scm: Regenerated.
Andy Wingo [Mon, 4 May 2009 10:18:14 +0000 (12:18 +0200)]
when compiling, use make-lexical to residualize original var names
* module/ice-9/psyntax.scm (build-lexical-reference): Change to be a
function. Take an extra arg, the original name of the variable. If we
are compiling, make a #<lexical>, annotated with the original var name.
All callers changed.
(build-lexical-assignment): Also a function, taking also the original
var name, using build-lexical-reference to build its output.
* module/ice-9/psyntax-pp.scm: Regenerated.
Andy Wingo [Mon, 4 May 2009 09:57:36 +0000 (11:57 +0200)]
sc-expand in compile mode produces (ice-9 expand-support) structures
* module/ice-9/psyntax.scm (*mode*): New moving part, a fluid.
(sc-expand): Dynamically bind *mode* to the expansion mode.
(build-global-reference): Change to be a procedure instead of local
syntax. Import the logic about when to make a @ or @@ form to here,
from boot-9.scm. If we are compiling, build output using (ice-9
expand-support)'s make-module-ref, otherwise just making the familiar
s-expressions. (This will allow us to correctly expand in modules in
which @ or @@ are not bound, at least when we are compiling.)
(build-global-assignment): Use the result of build-global-reference. A
bit hacky, but hey.
(top-level-eval-hook, local-eval-hook): Strip expansion structures
before evalling.
* module/ice-9/boot-9.scm (make-module-ref): Remove, this logic is now
back in psyntax.scm.
* module/ice-9/compile-psyntax.scm (source): Since we expand in compile
mode, we need to strip expansion structures.
* module/ice-9/expand-support.scm (strip-expansion-structures): Remove
the logic about whether and how to strip @/@@ from here, as it's part
of psyntax now.
* module/ice-9/psyntax-pp.scm: Regenerated.
* module/language/scheme/compile-ghil.scm (compile-ghil): Strip expansion
structures -- for now. In the future, we might translate directly from
these structures into GHIL.
Andy Wingo [Mon, 4 May 2009 08:47:31 +0000 (10:47 +0200)]
replace sc-expand with sc-expand3, removing binding for sc-expand3
* module/ice-9/boot-9.scm (sc-expand3):
* module/ice-9/psyntax.scm (sc-expand3): Replace sc-expand with
sc-expand3, as expand3 with one argument is the same as sc-expand.
* module/ice-9/psyntax-pp.scm: Regenerated.
* module/ice-9/compile-psyntax.scm:
* module/language/scheme/compile-ghil.scm: Change callers to sc-expand3
to use sc-expand.
Andy Wingo [Wed, 29 Apr 2009 21:57:31 +0000 (23:57 +0200)]
remove (void) from boot-9 and psyntax
* module/ice-9/psyntax.scm: Tweak comments. Remove references to `void';
just produce (if #f #f) instead of (void).
* module/ice-9/psyntax-pp.scm: Regenerated, twice.
* module/ice-9/boot-9.scm (void): Remove this binding.
Andy Wingo [Wed, 29 Apr 2009 21:39:09 +0000 (23:39 +0200)]
more cleanups to boot-9/psyntax
* module/ice-9/boot-9.scm: Comment some more things.
* module/ice-9/psyntax.scm: Remove error-hook -- callers should just use
syntax-violation. Change all callers.
* module/ice-9/psyntax-pp.scm: Regenerated.
Andy Wingo [Wed, 29 Apr 2009 21:12:12 +0000 (23:12 +0200)]
remove andmap from public API (we still have and-map)
* module/ice-9/boot-9.scm (and-map, or-map): Move these definitions up so
psyntax can use them.
(andmap): Remove, yay.
* module/ice-9/psyntax.scm: Remove notes about andmap, and just use
Guile's and-map -- except in cases that need the multiple list support,
in which case we have a private and-map*.
* module/ice-9/psyntax-pp.scm: Regenerated.
Andy Wingo [Wed, 29 Apr 2009 20:50:45 +0000 (22:50 +0200)]
cleanups to boot-9
* module/ice-9/boot-9.scm: Shuffle around some definitions.
(module-add!): Removed stub definition, no longer used.
(install-global-transformer): Removed, no longer used (yay!).
* module/ice-9/psyntax-pp.scm: Regenerated.
* module/ice-9/psyntax.scm: Remove install-global-transformer.
Andy Wingo [Wed, 29 Apr 2009 19:19:23 +0000 (21:19 +0200)]
first-class macro representation (no bits on variables)
* libguile/macros.c (scm_macro_p): Update docs.
* module/ice-9/boot-9.scm (module-define!, module-ref): Define pre-boot
forms of these functions as well. I suspect module-add! can go soon.
(module-lookup-keyword, module-define-keyword!)
(module-undefine-keyword!) Remove these.
* module/ice-9/psyntax-pp.scm: Regenerate. Notice the difference?
* module/ice-9/psyntax.scm (put-global-definition-hook)
(get-global-definition-hook): Rework to expect first-class macros. Heh
heh.
(remove-global-definition-hook): Pleasantly, this hook can go away.
(chi-install-global): Terrorism to generate the right kind of output --
will clean up.
(chi-top): Unify definition handling for all kinds of values.
Andy Wingo [Tue, 28 Apr 2009 22:38:12 +0000 (00:38 +0200)]
a different tack for syncase macro representation
* libguile/macros.c (macro_print): Show syntax-case bindings, if present.
(macro_mark): Mark the extra two words if they're there.
(scm_make_syncase_macro, scm_make_extended_syncase_macro): OK! A new
take at the "how do we represent syncase macros in Guile" problem.
Whereas we need a disjoint type, but would like it to be compatible
with old predicates (e.g. `macro?'), and need to be able to extend
existing syntax definitions (e.g. `cond'), let's add a bit to macros to
indicate whether they have syncase macro bindings or not, and a fourth
macro type for native syncase macros.
(scm_macro_type): Return 'syntax-case for native syntax-case macros.
Note that other macro types may have syntax-case bindings.
(scm_macro_name): Return #f if the transformer is not a procedure.
(scm_syncase_macro_type, scm_syncase_macro_binding): New accessors for
the syncase macro bindings.
* libguile/macros.h: Add API for syncase macros.
* module/ice-9/boot-9.scm (module-define-keyword!): Adapt to use syncase
macros, though they are not yet used. Reorder other syncase API.
* module/ice-9/psyntax.scm (chi-expr): Fix syntax-violation invocation.
Andy Wingo [Sun, 26 Apr 2009 19:10:24 +0000 (21:10 +0200)]
syntax-dispatch -> $sc-dispatch
* module/ice-9/boot-9.scm:
* module/ice-9/psyntax-pp.scm:
* module/ice-9/psyntax.scm: Change syntax-dispatch to $sc-dispatch, as it
is in current psyntax. The idea is that this isn't really a public
variable, though it has to be, currently, so just obscure that fact
with an obscure name.
Andy Wingo [Sun, 26 Apr 2009 18:57:51 +0000 (20:57 +0200)]
build ecmascript stuff last
* module/Makefile.am: Wait to build ecmascript until the compiler has
bootstrapped.
Andy Wingo [Sun, 26 Apr 2009 18:56:24 +0000 (20:56 +0200)]
syntax-object->datum => syntax->datum, likewise datum->syntax
* module/ice-9/boot-9.scm (datum->syntax, syntax->datum): Rename from
datum->syntax-object and syntax-object->datum, following r6rs. Change
all callers. Reorder some of the other exports from psyntax.
* module/ice-9/psyntax.scm: Change datum->syntax and syntax->datum
definitions and callers.
* module/ice-9/psyntax-pp.scm: Regenerated.
* module/oop/goops.scm (define-class-pre-definition): Update for changes.
Andy Wingo [Sun, 26 Apr 2009 18:36:58 +0000 (20:36 +0200)]
replace psyntax's syntax-error with r6rs' syntax-violation
* module/ice-9/boot-9.scm (syntax-violation): Well, as long as we have to
have a function for indicating syntax errors, let's let it be a
well-thought-out one -- syntax-violation from r6rs. No more
syntax-error.
* module/ice-9/psyntax-pp.scm: Regenerated.
* module/ice-9/psyntax.scm: Replace instances of syntax-error with
syntax-violation. Implement as a scm-error to 'syntax-error, with some
nice arguments.
Andy Wingo [Sun, 26 Apr 2009 11:10:30 +0000 (13:10 +0200)]
add module-{define-keyword!,undefine-keyword!,lookup-keyword}
* libguile/modules.c (scm_module_local_variable): Allow this to be called
before modules are booted with #f as the module.
* module/ice-9/boot-9.scm (module-define-keyword!)
(module-lookup-keyword, module-undefine-keyword!): Well, if syncase
forces us to allow the keyword bindings to be partitioned from value
bindings, let's go ahead and do that in boot-9 instead of in
psyntax. A step on the way to removing `install-global-transformer'.
(sc-chi): Remove.
* module/ice-9/psyntax.scm (put-global-definition-hook):
(remove-global-definition-hook, get-global-definition-hook): Use our
new module-* functions.
(sc-chi): Remove, no longer needed.
* module/ice-9/psyntax-pp.scm: Regenerated.
Andy Wingo [Sun, 26 Apr 2009 09:48:29 +0000 (11:48 +0200)]
remove sc-macro definition
* module/ice-9/boot-9.scm (sc-macro): Remove sc-macro definition, yay.
Andy Wingo [Sun, 26 Apr 2009 09:35:23 +0000 (11:35 +0200)]
fix module-bound?, start compiling srfi-18.scm
* module/Makefile.am (SRFI_SOURCES): Let's finally start compiling
srfi-18.scm, what the hell.
* module/ice-9/boot-9.scm (module-bound?): module-bound? was returning
true if (not (variable-bound? (module-local-variable m v))), but
(variable-bound? (module-variable m v)). Fix to cut out on the first
variable it finds. This bug has been there for a while now.
Andy Wingo [Sat, 25 Apr 2009 17:09:19 +0000 (19:09 +0200)]
Fix the elisp memoizer code for syncase-in-boot-9
* lang/elisp/interface.scm:
* lang/elisp/internals/lambda.scm:
* lang/elisp/primitives/syntax.scm:
* lang/elisp/transform.scm: Use (lang elisp expand) as the transformer,
because we really are intending this code for the memoizer and not the
compiler.
* lang/elisp/expand.scm: A null expander.
* lang/elisp/interface.scm (use-elisp-file, use-elisp-library):
* lang/elisp/transform.scm (scheme): Turn these defmacros into
procedure->memoizing-macro calls, given that without syncase we have no
defmacro either.
* lang/elisp/primitives/fns.scm (macroexpand): Comment out, as Scheme's
macro expander (temporarily on hiatus) won't work with elisp.
Andy Wingo [Sat, 25 Apr 2009 14:31:52 +0000 (16:31 +0200)]
allow defmacros to have docstrings
* module/ice-9/boot-9.scm (define-macro, defmacro): Add the ability to
have a docstring.
* module/ice-9/documentation.scm (object-documentation): Remove
references to defmacro? and macro?. Since we store the transformation
procedure as the binding, we can get docs from the procedure directly.
* module/ice-9/psyntax-pp.scm: Regenerate.
* module/ice-9/psyntax.scm (put-global-definition-hook):
Take the type and the value separately, so we can set the variable to
the procedure, while keeping the *sc-expander* to be the "binding
object".
(global-extend): Pass type and val separately.
Andy Wingo [Sat, 25 Apr 2009 12:10:08 +0000 (14:10 +0200)]
all of guile compiles now, expanded with syncase
* libguile/eval.c (scm_m_eval_when): Whoops, eval-when has an implicit
begin. Fix.
* module/oop/goops.scm: Syncase doesn't like definitions in expression
context, and grudgingly I have decided to go along with that. But that
doesn't mean we can't keep the old semantics, via accessing the module
system directly. So do so. I took the opportunity to rewrite some
macros with syntax-rules and syntax-case -- the former is nicer than
the latter, of course.
* module/oop/goops/save.scm: Don't define within an expression.
* module/oop/goops/simple.scm (define-class): Use define-syntax.
* module/oop/goops/stklos.scm (define-class): Use define-syntax.
Andy Wingo [Sat, 25 Apr 2009 10:50:53 +0000 (12:50 +0200)]
fix bad syntax in define-macro, (ice-9 match), and (oop goops)
* module/ice-9/boot-9.scm (define-macro): Use syntax-case to destructure
macro arguments, so we get good errors.
* module/ice-9/match.scm (defstruct, define-const-structure): Don't
unquote in the `defstruct' macro as a value in expansions.
* module/oop/goops.scm (standard-define-class): Can't define a macro with
`define', use `define-syntax' instead.
(define-accessor): Use syntax-rules. Doesn't give us much in this case.
(toplevel-define!): New helper, to let us keep GOOPS' behavior with the
new expander. Some solution that works lexically and at the toplevel
would be nice, though.
(define-method): Reimplement with syntax-rules -- soooo much nicer.
* module/oop/goops/dispatch.scm (lookup-create-cmethod): Don't define
within an expression.
Andy Wingo [Fri, 24 Apr 2009 21:56:40 +0000 (23:56 +0200)]
allow docstrings with internal definitions
* module/Makefile.am (SCHEME_LANG_SOURCES):
* module/language/scheme/expand.scm: Remove expand.scm, we don't need it
any more.
* module/ice-9/psyntax.scm (build-lambda, chi-lambda-clause): Support
docstrings with internal definitions. What are Scheme people thinking
these days?
* module/ice-9/psyntax-pp.scm: Regenerated.
Andy Wingo [Fri, 24 Apr 2009 21:10:31 +0000 (23:10 +0200)]
make sure we compile boot code in (guile), not (guile-user)
* libguile/eval.h:
* libguile/eval.c (scm_m_eval_when): Define a cheap eval-when, used
before syncase has booted.
* module/Makefile.am: Reorder to put (system vm) and (system repl)
modules after the compiler, as they are not needed at runtime.
* module/ice-9/boot-9.scm: Move the eval-when earlier, to be the first
thing -- so when we recompile Guile we do so all in the '(guile)
module, not '(guile-user).
* module/ice-9/compile-psyntax.scm: Rewrite to assume that psyntax.scm
will eval-when to set its module, etc. Have everything in a let --
otherwise the `format' call is in (guile), but `target' was defined
in (guile-user). Also, write in an eval-when to the expanded file.
* module/ice-9/psyntax-pp.scm: Regenerate.
* module/ice-9/networking.scm:
* module/ice-9/psyntax.scm:
* module/ice-9/r4rs.scm: Sprinkles of eval-when, for flavor.
Andy Wingo [Fri, 24 Apr 2009 17:59:42 +0000 (19:59 +0200)]
handle pre-module macro procedures correctly
* module/ice-9/psyntax.scm (chi-macro): It's possible for a macro
procedure to have no module, if the procedure was made before modules
were booted.
* module/ice-9/psyntax-pp.scm: Regenerated.
Andy Wingo [Fri, 24 Apr 2009 17:45:43 +0000 (19:45 +0200)]
Merge branch 'master' into syncase-in-boot-9
Andy Wingo [Fri, 24 Apr 2009 17:16:06 +0000 (19:16 +0200)]
merge ice-9, srfi, oop makfiles into module makefile
* configure.in: No longer output the Makefile.ins.
* module/Makefile.am: Include the contents of ice-9/, srfi/, and oop/.
* module/ice-9/Makefile.am:
* module/ice-9/debugger/Makefile.am:
* module/ice-9/debugging/Makefile.am:
* module/oop/Makefile.am:
* module/oop/goops/Makefile.am:
* module/srfi/Makefile.am: Removed.
Andy Wingo [Fri, 24 Apr 2009 11:30:57 +0000 (13:30 +0200)]
finish transition to bare/hygiene/public/private
* module/ice-9/boot-9.scm (make-module-ref): Remove the transition
support.
* module/ice-9/psyntax.scm (get-global-definition-hook): Remove
transition support. Also remove support for guile-macro.
(build-global-reference, build-global-assignment): Remove transition
support.
* module/ice-9/psyntax-pp.scm: Regenerated.
Andy Wingo [Fri, 24 Apr 2009 11:13:29 +0000 (13:13 +0200)]
only bend hygiene in macro-introduced output, not for explicit @/@@
* module/ice-9/psyntax.scm
* module/ice-9/psyntax-pp.scm
* module/ice-9/boot-9.scm (make-module-ref): We were so almost there
with what we had, sniff. The deal is that
(begin (load "foo.scm") ((@@ (foo) bar)))
would expand to
(begin (load "foo.scm") (bar))
because bar was unbound at expansion time, and make-module-ref assumed
it was like the else in a cond. But it shouldn't have, because we
/explicitly/ asked for the @@ var -- so now if we see a @ or @@, we
never drop it. @@ introduced by hygiene can be dropped if it doesn't
reference a var, though.
Practically speaking, this means tagging all modules in psyntax with
their intent: public or private (corresponding to @ or @@), hygiene
(introduced by a macro), or bare (when we don't have a module). I'm
not sure when we'd see a bare.
The implementation is complicated by the need to support the old
format and the new format at the same time, so that psyntax-pp can be
regenerated.
Andy Wingo [Fri, 24 Apr 2009 10:12:24 +0000 (12:12 +0200)]
fix @ and syncase
* module/ice-9/boot-9.scm
(make-module-ref): equal?, not eq?, when matching on module name.
(Module names don't have to come from an invocation of module-name in
this process.)
* module/ice-9/psyntax.scm (build-global-reference)
(build-global-assignment, @): Rework the format of the module in syntax
objects so that a car of #f indicates a public reference. Loading (foo
%module-public-interface) didn't guarantee that (foo) was loaded and
useful.
* module/ice-9/psyntax-pp.scm: Regenerated.
* module/language/scheme/compile-ghil.scm (lookup-transformer):
primitive-macro? does not exist any more.
Andy Wingo [Thu, 23 Apr 2009 11:34:23 +0000 (13:34 +0200)]
ice-9 syncase now deprecated, woo
Remove #:use-module (ice-9 syncase) from lots of places, as it's no
longer needed.
Andy Wingo [Thu, 23 Apr 2009 11:30:23 +0000 (13:30 +0200)]
it is alive!!!!! + concision + fix to compile-ghil
* module/ice-9/boot-9.scm: Remove lots of debugging prints. Remove some
already-deprecated attempts to load modules from shared libraries.
* module/ice-9/psyntax.scm: If we have to create a variable for a
syntactic binding, initialize its contents to a gensym. I'd like
something more meaningful, but at least this way we can tell different
macros apart. Only warn about missing modules if modules are booted.
Chi the value part of a (set! (@ ...) ) expression -- whoops!
* module/ice-9/psyntax-pp.scm: Regenerated.
* module/language/glil.scm (parse-glil): Fix an unquoting error.
* module/language/scheme/compile-ghil.scm: No need to import syncase, we
gots it. Rework compiler to expand only once, with syncase, instead of
incrementally. Fix define-scheme-transformer to work with syncase, by
not referencing bare keywords. It works!
Andy Wingo [Thu, 23 Apr 2009 10:41:03 +0000 (12:41 +0200)]
allow redefinition of global macros to variables
* module/ice-9/psyntax.scm: Allow the redefinition of keywords to
variables. Otherwise we can't do (define let #f), which is totally
useful and stuff.
* module/ice-9/psyntax-pp.scm: Regenerated.
Andy Wingo [Fri, 24 Apr 2009 12:08:32 +0000 (14:08 +0200)]
fix load for syncase-in-boot-9; compile-psyntax works again
* module/ice-9/r4rs.scm:
* module/ice-9/boot-9.scm (%load-verbosely, assert-load-verbosity)
(%load-announce, %load-hook, load): Move these from r4rs.scm to
boot-9.scm.
* module/ice-9/compile-psyntax.scm: Update to work with
syncase-in-boot-9.
* module/ice-9/psyntax-pp.scm: Recompiled with syncase-in-boot-9.
Andy Wingo [Fri, 24 Apr 2009 12:01:26 +0000 (14:01 +0200)]
leap of faith: (ice-9 syncase) in psyntax-pp.scm -> (guile)
* module/ice-9/psyntax-pp.scm: Manually switch psyntax-pp over to (guile)
from (ice-9 syncase). Heh heh.
Andy Wingo [Fri, 24 Apr 2009 11:54:38 +0000 (13:54 +0200)]
syncase early in boot-9, defmacros in terms of syntax-case -- halfway working
* module/ice-9/boot-9.scm
(eval-when): Remove, as syncase is going to handle this one for us.
(sc-expand, sc-expand3, sc-chi, install-global-transformer)
(syntax-dispatch, syntax-error, annotation?, bound-identifier=?)
(datum->syntax-object, free-identifier=?, generate-temporaries)
(identifier?, syntax-object->datum, void, andmap): Oh, ugly of uglies:
add these exciting definitions to the main environment. Hopefully we
can pull them back out soon.
(make-module-ref, resolve-module): Stub these out, as a replacement for
expand-support.
(%pre-modules-transformer): Define to sc-expand, so that we are using
syncase from the very start.
(defmacro, define-macro): Define in terms of syntax-case.
(macroexpand, macroexpand-1): Remove, there should be a different way
to get at this -- though perhaps with the same name.
(make-module): Make sc-expand the default module-transformer.
(process-define-module): Issue a deprecation warning when using ice-9
syncase.
(primitive-macro?): Remove, no meaning...
(use-syntax): Deprecate.
(define-private, define-public, defmacro-public): Rework in terms of
syntax-rules.
* module/ice-9/syncase.scm: Gut, as syncase is provided by core now.
Andy Wingo [Fri, 24 Apr 2009 11:50:14 +0000 (13:50 +0200)]
module-name returns '(guile) during boot; psyntax tweak
* module/ice-9/boot-9.scm (module-name): Return '(guile) before the
module system is booted, for syncase's benefit. Defer redefinition
until the module system is booted.
* module/ice-9/psyntax.scm (put-global-definition-hook): Only set a
variable if it's unbound.
* module/ice-9/psyntax.scm: Regenerated.
Andy Wingo [Wed, 22 Apr 2009 21:10:35 +0000 (23:10 +0200)]
more steps on the way to boot-time syncase
* module/ice-9/boot-9.scm: Define a version of module-add! for psyntax,
before modules are booted.
* module/ice-9/psyntax.scm: Remove a warning, and rename a variable.
Initialize a new variable to 'sc-macro, though it will have no effect.
* module/ice-9/psyntax-pp.scm: Regenerated.
Andy Wingo [Thu, 23 Apr 2009 09:25:22 +0000 (11:25 +0200)]
I ain't broke, but brother I'm badly bent
* module/ice-9/expand-support.scm (strip-expansion-structures): If, when
producing @/@@ forms, we find that an @@ variable is not bound in its
module, just serialize the symbol. This bends hygiene, in that it can
introduce a global (but not lexical) reference in the expanded module,
but it seems necessary to not produce (@@ (foo) else) in forms like
((@@ (foo) cond) ((test then) ((@@ (foo) else) bar))).
Andy Wingo [Wed, 22 Apr 2009 20:27:50 +0000 (22:27 +0200)]
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.
Andy Wingo [Wed, 22 Apr 2009 20:23:43 +0000 (22:23 +0200)]
move pk, peek, and warn to the beginning of boot-9
* module/ice-9/boot-9.scm (peek, pk, warn): Move these helpers up to the
top. I like them!
(load-compiled): Don't define within an if, syncase doesn't like that.
Andy Wingo [Tue, 21 Apr 2009 22:17:22 +0000 (00:17 +0200)]
module-name before syncase is booted
* module/ice-9/boot-9.scm (module-name): Give psyntax a module-name
definition, even before psyntax is booted (in a future commit).
Andy Wingo [Mon, 9 Mar 2009 21:01:27 +0000 (22:01 +0100)]
fix begin-deprecated
* module/ice-9/boot-9.scm (begin-deprecated): Fix to output source code,
doh.
Andy Wingo [Mon, 9 Mar 2009 20:40:30 +0000 (21:40 +0100)]
tweaks to boot-9
* module/ice-9/boot-9.scm: Move the r4rs init up to the top.
(try-module-autoload): Don't use with-fluids before it's defined.
Andy Wingo [Mon, 9 Mar 2009 20:09:22 +0000 (21:09 +0100)]
allow eval to be called before modules are booted
* libguile/eval.c (scm_eval): If the module system isn't booted, assert
not on the module argument.
Andy Wingo [Mon, 9 Mar 2009 19:52:45 +0000 (20:52 +0100)]
commit some tweaks to expand.scm, likely obviated by syncase though
* module/language/scheme/expand.scm (re-annotate, expand): A couple of
speculative cases for dealing with syncase better -- but all of this
code is likely to go.
Andy Wingo [Mon, 9 Mar 2009 19:49:54 +0000 (20:49 +0100)]
scm_[current_]module_transformer returns the %pre-modules-transformer, if set
* libguile/modules.c (scm_module_transformer)
(scm_current_module_transformer): So, if the module system hasn't yet
booted, take the current transformer from a variable named
%pre-modules-transformer from the %pre-modules-obarray. This is a
prequel to booting syncase early in boot-9.
Andy Wingo [Tue, 21 Apr 2009 20:56:51 +0000 (22:56 +0200)]
make syncase aware of (set! (@ (foo) bar) baz)
* module/ice-9/psyntax.scm (set!): Handle (set! (@ (foo ..) bar) val)
inside syncase. Heh heh heh.
* module/ice-9/psyntax-pp.scm: Regenerated.
Andy Wingo [Tue, 21 Apr 2009 20:26:27 +0000 (22:26 +0200)]
syncase knows about @ / @@
* module/ice-9/psyntax.scm (syntax-type): Handle a new type, module-ref.
Like external-macro, it also has a procedure as a binding.
(chi-expr): module-ref forms -- that is to say, (@ (foo ...) bar) -- as
expressions they are global references, but with respect to a specific
module.
(@, @@): Define module-ref syntax handlers.
* module/ice-9/psyntax-pp.scm: Regenerated.
* module/ice-9/syncase.scm: Mark as primitive syntax so we don't clobber
their definitions.
The reason I'm doing things like this is so as to support (set! (@@ ...)
...) sensibly, which will be the next patch.
Andy Wingo [Tue, 21 Apr 2009 10:41:19 +0000 (12:41 +0200)]
distcheck fixen
* examples/Makefile.am: Fix the installed guile-config invocation to set
PKG_CONFIG_PATH.
* meta/Makefile.am (EXTRA_DIST): Dist the bin_SCRIPTS.
* meta/guile-config (pkg-config): Better error messages if pkg-config
invocation fails.
* meta/uninstalled-env.in (PATH): Now that guile-config and guile-tools
are not generated, make it the srcdir/meta instead of the builddir.
(Guile itself will be picked up from libguile.)
Andy Wingo [Mon, 20 Apr 2009 20:26:02 +0000 (22:26 +0200)]
Merge branch 'syncase'
Andy Wingo [Mon, 20 Apr 2009 16:23:11 +0000 (18:23 +0200)]
fix guile.m4 for sitedir change
* meta/guile.m4
Andy Wingo [Mon, 20 Apr 2009 16:20:01 +0000 (18:20 +0200)]
scripts take rest args
* meta/guile-tools: Instead of fixing scripts I should have been fixing
the script runner.
* module/scripts/compile.scm:
* module/scripts/snarf-guile-m4-docs.scm: Fix to take rest args.
Andy Wingo [Mon, 20 Apr 2009 15:42:35 +0000 (17:42 +0200)]
some more build fixes for bugs that I introduced
* meta/guile-1.8.pc.in: Include a pkgdatadir, which will map down to
`guile-config info pkgdatadir', used in existing guile.m4 files.
* meta/guile-config: Fix guile-config info varname. Facepalm.
* meta/guile.m4: Make GUILE_SITE_DIR use the sitedir variable instead.
Really it should use pkg-config directly, though.