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.
Andy Wingo [Mon, 20 Apr 2009 15:23:40 +0000 (17:23 +0200)]
fix build errors on fresh checkout
* meta/guile-tools: We can't use srfi-1, because on a fresh checkout
the srfi-1 shlib isn't built yet. Bummer.
* meta/uninstalled-env.in: Fix up the DYLD lines for BSDen.
* module/scripts/snart-guile-m4-docs.scm: Fix expected arguments.
Andy Wingo [Mon, 20 Apr 2009 09:42:24 +0000 (11:42 +0200)]
fix m4->texi snarfage after the guile-tools change
* doc/ref/Makefile.am: Fix to work after a make clean with the recent
guile-tools changes.
Andy Wingo [Wed, 15 Apr 2009 15:02:33 +0000 (17:02 +0200)]
no positions when reading psyntax-pp, validation in @/@@, cleanups
* module/ice-9/syncase.scm (old-debug): Re-disable position recording
when reading psyntax-pp.
* libguile/eval.c (scm_m_at, scm_m_atat): More input validation.
* libguile/debug.c (scm_procedure_module): Use scm_env_module. Remove
extraneous docstring.
Andy Wingo [Tue, 7 Apr 2009 05:48:03 +0000 (22:48 -0700)]
fix hygiene + modules + local macros
* module/ice-9/psyntax-pp.scm: Regenerate.
* module/ice-9/psyntax.scm (syntax-type): Look up the type of the car of
a form relative to its module, if it is a syntax object. Fixes hygiene
wrt modules and private macros.
* module/ice-9/syncase.scm (sc-macro): Add a comment.
* module/system/base/pmatch.scm: The big test case: just export pmatch,
not ppat too.
Andy Wingo [Mon, 9 Mar 2009 19:32:05 +0000 (20:32 +0100)]
fix handling of pre-modules errors in the vm
* libguile/vm-i-system.c (toplevel-ref, toplevel-set): Correct situation
whereby we would not throw when toplevel vars were unbound, before
modules had booted.
Andy Wingo [Mon, 9 Mar 2009 20:26:44 +0000 (21:26 +0100)]
@ and @@ as primitive macros
* libguile/eval.h:
* libguile/eval.c (error_unbound_variable, error_defined_variable):
Move these prototypes up earlier.
(scm_m_at, scm_m_atat): New functions, provide the @ and @@
functionality. Moved here from defmacros because they are
"special", inasmuch as syncase doesn't really understand them in
interpreted code.
* module/ice-9/boot-9.scm (@, @@): Don't define as defmacros, as
defmacros have to actually return source now.
Andy Wingo [Sun, 5 Apr 2009 18:52:22 +0000 (11:52 -0700)]
hygienic compilation
* module/language/scheme/compile-ghil.scm (lookup-transformer): Recognize
macros as initial (@ ...) or (@@ ...) forms, enabling hygienic
compilation.
Andy Wingo [Tue, 31 Mar 2009 07:00:04 +0000 (00:00 -0700)]
houston, we have hygiene
* module/ice-9/expand-support.scm (strip-expansion-structures): Enable
@/@@ substitution.
* module/ice-9/psyntax-pp.scm: Recompile.
* module/ice-9/psyntax.scm: Since syntax objects are quotable, make the
module field the module name, not the module itself. Scope the operand
of global calls appropriately. Thread modules through syntax-dispatch
destructuring. Houston, we have hygiene.
* module/ice-9/syncase.scm: Adapt to module / module-name changes.
Andy Wingo [Tue, 31 Mar 2009 05:06:35 +0000 (22:06 -0700)]
more work on modules and hygiene, not finished yet, alas.
* module/ice-9/compile-psyntax.scm: No more expansion-eval-closure.
* module/ice-9/expand-support.scm (strip-expansion-structures): Only @@
names whose module is not the current module. Actually @@ serialization
is disabled for this commit, just to get this one in and keep things
working.
* module/ice-9/psyntax-pp.scm: Recompiled.
* module/ice-9/psyntax.scm (put-global-definition-hook)
(get-global-definition-hook): Instead of going through that stupid
getprop/putprop interface, let's just inline Guile-specific code here.
(build-global-reference, build-global-assignment): Fix a bug where the
module and public? were switched, which happily allowed things to
compile. (We reintroduce a similar bug above in expand-support.)
(lookup): Add a module argument.
(global-extend): Adapt for put-global-definition-hook invocation.
(syntax-type): Lookup with mod. Return mod even for lexicals and
define-form -- why not.
(chi-top, fluid-let-syntax, syntax, set!): Lookup with mod. Wrap with
mod.
* module/ice-9/syncase.scm (expansion-eval-closure)
(current-eval-closure, env->eval-closure): OK! So the idea is: module
hygiene is syncase's business, not ours. So lose the eval-closure
fluid. Also, eval closures are so 1990s.
(sc-macro): But, we have to take the module from the env, sadly. In the
future this will be different.
Remove the rest of the eval-closure bits. Enable source reporting,
while we're debugging.
* module/language/scheme/compile-ghil.scm (lookup-transformer): Adapt for
eval closure fluid changes.
Andy Wingo [Tue, 31 Mar 2009 04:20:44 +0000 (21:20 -0700)]
eval-closure-module, here hopefully not for long
* libguile/modules.h:
* libguile/modules.c (scm_eval_closure_module): Define a
new-yet-deprecated accessor, to ease a transition.
Andy Wingo [Mon, 30 Mar 2009 00:15:25 +0000 (17:15 -0700)]
thread the module through syntax-case's expansion
* libguile/debug.h:
* libguile/debug.c (scm_procedure_module): New procedure, returns the
module that was current when the given procedure was defined. Used by
syncase to scope free identifiers.
* module/ice-9/psyntax-pp.scm: Recompiled.
* module/ice-9/psyntax.scm: Thread the module through the syntax
expansion. This is harder than it would appear because in many places
the different components of syntax objects are destructured.
* module/ice-9/syncase.scm (guile-macro): Adapt to new signature for
syntax transformer functions.
Andy Wingo [Sun, 29 Mar 2009 18:41:02 +0000 (11:41 -0700)]
finish bootstrap to syntax-objects with modules
* module/ice-9/psyntax.scm: Now that we have gone through the
intermediate step (in which both representations of syntax-object had
to coexist), change all callers to make-syntax-object to pass the third
argument, and restore the define-structure definition of syntax
objects.
* module/ice-9/psyntax-pp.scm: Recompile.
Andy Wingo [Sun, 29 Mar 2009 18:35:55 +0000 (11:35 -0700)]
add modules to syntax objects (part 1, intermediate step)
* module/ice-9/psyntax.scm (make-syntax-object): As an intermediate step
to adding modules to syntax objects, replace the definition of
syntax-object as a structure with an expanded-out definition that has
(1) a constructor that takes 2 or 3 arguments, and (2) a predicate that
works with vectors of length 3 or 4. I couldn't just redefine
make-syntax-object, for example, because these are internal
definitions, and we can't have duplicate bindings in a letrec.
Andy Wingo [Sun, 29 Mar 2009 17:41:27 +0000 (10:41 -0700)]
serialize module information into syncase's output -- getting ready for hygiene
* module/ice-9/Makefile.am: Replace annotate.scm with expand-support.scm.
* module/ice-9/annotate.scm: Removed; subsumed into expand-support.scm.
* module/ice-9/compile-psyntax.scm: Strip out expansion structures before
writing to disk.
* module/ice-9/expand-support.scm: New file. Provides annotation support,
and other compound data types for use by the expander. Currently the
only one that is used is the toplevel reference, <module-ref>, but we
will record lexicals this way soon.
* module/ice-9/psyntax-pp.scm: Regenerate.
* module/ice-9/psyntax.scm (build-global-reference)
(build-global-assignment): Instead of expanding out global references
as symbols, expand them as <module-ref> structures, with space to
record the module that they should be scoped against. This is in
anticipation of us actually threading the module info through the
syntax transformation, so that we can get hygiene with respect to
modules.
* module/ice-9/syncase.scm: Replace eval-when. Since sc-expand will give
us something that isn't Scheme because we put the <module-ref>
structures in it, strip that info whenever we actually do need scheme.
* module/language/scheme/compile-ghil.scm (lookup-transformer): Strip
expansion structures here too.
* module/language/scheme/expand.scm (language): Swap annotate for
expand-support. But this file will die soon, I think.
Andy Wingo [Fri, 17 Apr 2009 13:18:46 +0000 (15:18 +0200)]
fix a tricky GC bug in scm_c_make_subr
* libguile/procs.c (scm_c_make_subr): Fix a really tricky bug!!! If
scm_double_cell caused GC, the symbolic name wouldn't be marked. But
the symptom wouldn't appear until you accessed that symbol much later,
for example during tab completion / apropos grovelling. Not sure why we
didn't see this earlier.
Andy Wingo [Fri, 17 Apr 2009 09:19:42 +0000 (11:19 +0200)]
guile-tools is a scheme script that loads scheme modules
* meta/guile-tools: Changed to be a scheme script. Instead of looking for
executables in a "scripts dir", we just look for modules in (scripts),
and load the modules directly.
* module/Makefile.am:
* module/scripts/: Move the scripts into module/ so they can be compiled.
Rename scripts from `foo' to `foo.scm'.
* libguile/Makefile.am: Invoke the snarf->texi code via guile-tools.
* configure.in:
* .gitignore: Update for changes.
Andy Wingo [Fri, 17 Apr 2009 07:27:32 +0000 (09:27 +0200)]
fix a couple gc-related continuations bugs
Thanks to Juhani Rantanen for the report.
* libguile/continuations.c (scm_make_continuation): Delay making the smob
until the data is fully initialized. Fixes a bug whereby a GC in
scm_vm_capture_continuations would catch the us with an undefined
continuation->vm_conts, leading to marking badness.
* libguile/vm.c (vm_cont_free): Report the correct size to scm_gc_free.
Andy Wingo [Thu, 16 Apr 2009 15:49:59 +0000 (17:49 +0200)]
support expression-by-expression compilation
* module/language/ghil.scm (unparse-ghil): Fix unparsing of quasiquoted
expressions.
* module/language/ghil/spec.scm (join): Define a joiner for GHIL.
* module/language/scheme/compile-ghil.scm (cenv-ghil-env): Expand the
definition of a CENV so it can have an actual ghil-env, if available.
(compile-ghil): Return the actual ghil env in the cenv.
* module/system/base/compile.scm (compile-file): Rewrite. `output-file'
is now a keyword argument, along with the new kwargs `env' and `from'.
We now allow exceptions to propagate up, and instead of printing the
output file to the console, we return a string corresponding to its
location.
(compile-and-load): Use read-and-compile.
(compile-fold): Thread around the cenv as well. Return all three
values.
(find-language-joint, read-and-compile): New exciting helpers. The idea
is that compiling a file should be semantically equivalent to compiling
each expression in it, one by one. Compilation can have side effects,
e.g. affecting the current language or the current reader. So what we
do is find a point in the compilation path at which different
expressions of a given language can be joined into one. Expressions
from the source language are compiled to the joint language, then
joined and compiled to the target.
(compile): Just return the first value from compile-fold.
* module/system/base/language.scm (language-joiner): New optional field.
* scripts/compile: Rework for changes to compile-file.
Andy Wingo [Thu, 16 Apr 2009 13:20:40 +0000 (15:20 +0200)]
compilation passes return third value: the continuation environment
* module/system/base/compile.scm: Expect compile passes to produce three
values, not two. The third is the "continuation environment", the
environment that can be used to compile a subsequent expression from
the same source language. For example, expansion-time side effects can
set the current module, which would be reflected appropriately in the
continuation environment.
* module/language/assembly/compile-bytecode.scm:
* module/language/bytecode/spec.scm:
* module/language/ecmascript/compile-ghil.scm:
* module/language/ghil/compile-glil.scm:
* module/language/glil/spec.scm:
* module/language/objcode/spec.scm:
* module/language/scheme/compile-ghil.scm:
* module/system/base/compile.scm: Update compile passes to return a
continuation environment.
Andy Wingo [Mon, 6 Apr 2009 18:07:22 +0000 (11:07 -0700)]
guile-config rebased on top of pkg-config
* configure.in:
* meta/Makefile.am (EXTRA_DIST): Remove guile-config.in bits.
* meta/guile-config: Reimplement to work on top of pkg-config. This lets
guile-config not be substed by configure.
* meta/uninstalled-env.in: Remove the path to guile-config, belatedly.
Set the pkg-config path correctly.
Ludovic Courtès [Sun, 5 Apr 2009 18:15:11 +0000 (20:15 +0200)]
Avoid uses of deprecated forms in the VM code.
Reported by Daniel Kraft <d@domob.eu>.
* libguile/frames.c, libguile/vm.c: Include <stdlib.h>, use `size_t'
instead of `scm_sizet'.
* libguile/objcodes.c, libguile/programs.c, libguile/vm-engine.c,
libguile/vm-i-loader.c, libguile/vm-i-system.c: Use `scm_list_X ()'
instead of the deprecated `SCM_LISTX ()'.
daniel [Fri, 13 Feb 2009 13:27:41 +0000 (14:27 +0100)]
Make `--disable-deprecated' work.
* configure.in (enable_deprecated): Set SCM_WARN_DEPRECATED_DEFAULT
even when --disable-deprecated is passed.
* libguile/deprecation.h: Declare deprecation-issuing methods even
if SCM_ENABLE_DEPRECATED is not set.
* libguile/deprecation.c: Ditto.
(scm_init_deprecation): Include full body even for unset
SCM_ENABLE_DEPRECATED.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Jose A. Ortega Ruiz [Sat, 4 Apr 2009 09:59:57 +0000 (11:59 +0200)]
Improved handling of callers cache in (system xref).
* We cache callees in each module, and keep a list of modified
('tainted') modules, which is used to reconstruct the callers
database incrementally.
* `procedure-callers' now returns an a-list, keyed by module name.
Andy Wingo [Sat, 4 Apr 2009 18:36:18 +0000 (11:36 -0700)]
fix nondeterminism in vm-i-system.c
* libguile/vm-i-system.c (br-if-eq, br-if-not-eq): Fix some
nondeterminism caught by GCC 4.4.
Andy Wingo [Fri, 3 Apr 2009 17:38:30 +0000 (10:38 -0700)]
no hard-coded stack limitations if the user has getrlimit
* libguile/debug.c (init_stack_limit): Instead of "1 MB or 80% of rlimit,
whichever is lower", just use 80% of the rlimit, if set.
Andy Wingo [Tue, 31 Mar 2009 03:28:30 +0000 (20:28 -0700)]
add test case for load-extension bug, fix gdb-uninstalled-guile
* test-suite/standalone/test-extensions:
* test-suite/standalone/test-extensions-lib.c:
* test-suite/standalone/Makefile.am: Add a test case for the
load-extension bug.
* meta/gdb-uninstalled-guile.in: Fix the path to include meta/.
Andy Wingo [Sun, 29 Mar 2009 05:31:20 +0000 (22:31 -0700)]
Merge branch 'wingo'
Andy Wingo [Sun, 29 Mar 2009 05:21:00 +0000 (22:21 -0700)]
fix duplicates in procedure-callers
* module/system/xref.scm (ensure-callers-db): OK! Since we can see the
same variable twice, e.g. in different modules, keep a unified hash of
seen vars and modules. Prevents duplicates in procedure-callers.
Andy Wingo [Sun, 29 Mar 2009 04:57:26 +0000 (21:57 -0700)]
fix spurious duplicates in procedure-callees and callers
* module/system/xref.scm (program-callee-rev-vars): It's possible to get
duplicates when combining callees of inner procedures, so ignore dups.
Quadratic, boo.
Andy Wingo [Sat, 28 Mar 2009 01:47:13 +0000 (18:47 -0700)]
bugfix: don't dynamic link if we found a registered extension
* libguile/extensions.c (load_extension): Don't do dynamic linking if we
actually did find an extension in the list.
Andy Wingo [Sat, 28 Mar 2009 01:40:15 +0000 (18:40 -0700)]
frame, program, objcode, etc inits use load-extension
* libguile/extensions.h: Define a scm_t_extension_init_func.
* libguile/frames.c:
* libguile/instructions.c:
* libguile/objcodes.c:
* libguile/programs.c:
* libguile/vm.c: Register extension init funcs. Should play nicer with a
static Guile, in addition to working on Darwin with non-default
installation prefixes without munging DYLD_LIBRARY_PATH.
* module/system/vm/frame.scm:
* module/system/vm/instruction.scm:
* module/system/vm/objcode.scm:
* module/system/vm/program.scm:
* module/system/vm/vm.scm: Use load-extension.
Andy Wingo [Fri, 27 Mar 2009 23:21:20 +0000 (16:21 -0700)]
fix distcheck hopefully, by cleaning the vm-i-*.i files
* libguile/Makefile.am (CLEANFILES): Clean vm-i-*.i.
Andy Wingo [Fri, 27 Mar 2009 23:11:43 +0000 (16:11 -0700)]
fix "linking" of guile-config
* meta/guile-config.in: Adjust "linking"; @bindir@ doesn't get fully
expanded. So instead use a shell trampoline.
Andy Wingo [Fri, 27 Mar 2009 23:01:12 +0000 (16:01 -0700)]
fix check for guile-tools running uninstalled
* meta/guile-tools.in (mydir): Fix check for running uninstalled.
Andy Wingo [Fri, 27 Mar 2009 22:51:16 +0000 (15:51 -0700)]
rely on getrlimit to DTRT, don't make stack calibration file
* libguile/measure-hwm.scm: Remove.
* .gitignore: Update for removal.
* test-suite/standalone/test-fast-slot-ref.in:
* test-suite/standalone/test-use-srfi.in:
* am/guilec:
* check-guile.in: Revert back to normal guile invocation.
* libguile/Makefile.am: Don't make a stack calibration file, as the
getrlimit-based limit setting should work fine.
Andy Wingo [Fri, 27 Mar 2009 22:44:17 +0000 (15:44 -0700)]
getrlimit-based stack limits
* libguile/debug.c (init_stack_limit): Initialize the stack limit based
on operating system limits (via getrlimit(2)), or 1 MB -- whichever is
smaller.
Andy Wingo [Fri, 27 Mar 2009 22:06:41 +0000 (15:06 -0700)]
add getrlimit and setrlimit wrappers
* README: Some rewording.
* configure.in: Check for getrlimit and setrlimit.
* libguile/posix.h:
* libguile/posix.c: Add some getrlimit and setrlimit wrappers. They're
documented, but I suspect something else has to be done to get them
into the manual.
Andy Wingo [Fri, 27 Mar 2009 21:03:03 +0000 (14:03 -0700)]
allow building against uninstalled guile; move some things to meta/
* README: Add more info about building against an uninstalled Guile.
* meta/: New directory. The proximate cause of its creation is that I
want to be able to build external packages against uninstalled Guile,
and to do that I need guile-tools in the PATH, but I don't want
$top_builddir/libtool in the path. But it seems like a good
reorganization, for things that are /about/ Guile: pkg-config files, m4
files, guile-config... then we also include uninstalled info: the
environment, the pre-inst-guile script, etc.
* meta/guile-1.8-uninstalled.pc.in: New pkg-config template. pkg-config
prefers -uninstalled pkg-config files, if they are in its path.
* meta/Makefile.am:
* meta/ChangeLog-2008:
* meta/gdb-uninstalled-guile.in:
* meta/guile-1.8.pc.in:
* meta/guile-config.in:
* meta/guile.m4:
* meta/guile-tools.in: Moved to meta/.
* meta/guile.in: This is the new name of pre-inst-guile.in.
* meta/uninstalled-env.in: And this, pre-inst-guile-env.in.
* Makefile.am:
* am/guilec:
* am/pre-inst-guile:
* check-guile.in:
* configure.in:
* doc/ref/Makefile.am:
* gc-benchmarks/run-benchmark.scm:
* test-suite/standalone/Makefile.am:
* test-suite/standalone/README:
* testsuite/Makefile.am: Adapt to meta/ change.
Ludovic Courtès [Fri, 27 Mar 2009 08:50:06 +0000 (09:50 +0100)]
Improve wording in `libguile/Makefile.am' regarding stack calibration.
* libguile/Makefile.am (stack-limit-calibration.scm): Improve wording of
the comment. Suggested by Neil Jerram.
Ludovic Courtès [Thu, 26 Mar 2009 18:17:26 +0000 (19:17 +0100)]
Run the stack calibration script before running the compiler.
* am/guilec (.scm.go): Use `pre-inst-guile' and load
`stack-limit-calibration.scm'. This is particularly useful when
building the first `.go' files where the compiler is run using the
interpreter, which may end up using a lot of stack space.
* libguile/Makefile.am (BUILT_SOURCES): Add
`stack-limit-calibration.scm'.
(TESTS, TESTS_ENVIRONMENT): Remove.
(stack-limit-calibration.scm): Prepend `-' so that any errors during
the calibration are ignored.
Ludovic Courtès [Thu, 26 Mar 2009 17:47:28 +0000 (18:47 +0100)]
Remove multiple definition of `scm_i_marking'.
* libguile/private-gc.h (scm_i_marking): Turn definition into a
declaration.
(scm_mark_all): Mark as `SCM_INTERNAL'.
* libguile/gc-mark.c (scm_i_marking): New definition.
Ludovic Courtès [Tue, 24 Mar 2009 23:23:23 +0000 (00:23 +0100)]
Fix `testsuite/Makefile.am' for `distcheck'.
* testsuite/Makefile.am (check_SCRIPTS): Remove, renamed to `TESTS'.
(EXTRA_DIST): Add $(TESTS).
Ludovic Courtès [Fri, 20 Mar 2009 00:11:16 +0000 (01:11 +0100)]
Aggregate `Makefile.am' files under `examples/'.
* configure.in: Don't produce `examples/*/Makefile'.
* examples/Makefile.am (SUBDIRS): Remove.
(EXTRA_DIST, AM_CFLAGS, AM_LIBS): New.
(box/box, box/box.o, box-module/box, box-module/box.o, libbox.la,
box-dynamic/box.lo, libbox-module.la, box-dynamic-module/box.lo,
installcheck, CLEANFILES, clean-local): New targets, aggregated from
`Makefile.am' files formerly in sub-directories.
* examples/check.test: New file, aggregated from `check.test' files in
sub-directories.
Ludovic Courtès [Tue, 24 Mar 2009 22:37:41 +0000 (23:37 +0100)]
Include <alloca.h> in `gsubr.c'.
* libguile/gsubr.c: Include <alloca.h>. Reported by Carlo Bramini
<carlo.bramix@libero.it>.
Andy Wingo [Fri, 20 Mar 2009 12:20:28 +0000 (13:20 +0100)]
speed up goops rehashing
* module/oop/goops/dispatch.scm (cache-try-hash!): Speed up goops
rehashing, in theory. I haven't measured, though.
Andy Wingo [Fri, 20 Mar 2009 11:52:24 +0000 (12:52 +0100)]
fix interpreted methods with empty bodies
* module/oop/goops.scm (method): If a method has no body, subst in `(if
#f #f)' instead of `(begin)', to please the memoizer.
Andy Wingo [Fri, 20 Mar 2009 11:06:10 +0000 (12:06 +0100)]
add generic method-formals; fixes to method-source
* module/oop/goops.scm (method-source): Don't throw an error if this
method has no source.
(method-formals): New generic function, the complement of
method-specializers for introspection.
Andy Wingo [Thu, 19 Mar 2009 10:46:22 +0000 (11:46 +0100)]
fix casts to unsigned long in objcodes.c
* libguile/objcodes.c (scm_c_make_objcode_slice): Fix casts to unsigned
long.
Ludovic Courtès [Wed, 18 Mar 2009 21:28:37 +0000 (22:28 +0100)]
Have `scm_take_locale_symbol ()' return an interned symbol (fixes bug #25865).
* libguile/symbols.c (intern_symbol): New function, with code formerly
duplicated in `scm_i_c_mem2symbol ()' and `scm_i_mem2symbol ()'.
(scm_i_c_mem2symbol, scm_i_mem2symbol): Use it.
(scm_take_locale_symboln): Use `intern_symbol ()'. This fixes
bug #25865.
* test-suite/standalone/Makefile.am
(test_scm_take_locale_symbol_SOURCES,
test_scm_take_locale_symbol_CFLAGS,
test_scm_take_locale_symbol_LDADD): New variables.
(check_PROGRAMS, TESTS): Add `test-scm-take-locale-symbol'.
Andy Wingo [Wed, 18 Mar 2009 00:49:28 +0000 (01:49 +0100)]
rework procedure-callers to stay correct as callees are redefined
* module/system/xref.scm (procedure-callers): Rework to calculate the
callers of a *variable*, not of a value. This is because the
module-observers only get fired when the module changes, not with the
variables change values. Also accept either a variable, a symbol
(resolved in the current module), or a modname . symname pair.
Andy Wingo [Tue, 17 Mar 2009 23:46:16 +0000 (00:46 +0100)]
doubly-weak callers db
* module/system/xref.scm (ensure-callers-db): Store the callers db as a
doubly-weak hash table.
Andy Wingo [Tue, 17 Mar 2009 23:44:26 +0000 (00:44 +0100)]
implement procedure-callers
* module/system/xref.scm: Implement procedure-callers, as the inverse of
procedure-callees, with a cache invalidated by changes in modules.
* module/ice-9/boot-9.scm (module-use!): Don't poke module observers when
module-use! is called for an already-used module.
Andy Wingo [Tue, 17 Mar 2009 22:16:35 +0000 (23:16 +0100)]
add xref stub for interpreted procedures
* module/system/xref.scm (hacky-procedure-callees): Add a
procedure-callees implementation for procedures with source, that
currently does nothing. Not sure what to do, going into the future.