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

4452 commits

Author SHA1 Message Date
Andy Wingo
4d24854111 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.
2009-04-29 23:12:12 +02:00
Andy Wingo
12eae603c7 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.
2009-04-29 22:50:45 +02:00
Andy Wingo
3d5f3091e1 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.
2009-04-29 21:20:28 +02:00
Andy Wingo
5a0132b337 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.
2009-04-29 00:38:12 +02:00
Andy Wingo
5f1a2fb10f 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.
2009-04-26 21:10:24 +02:00
Andy Wingo
bac0272216 build ecmascript stuff last
* module/Makefile.am: Wait to build ecmascript until the compiler has
  bootstrapped.
2009-04-26 20:57:51 +02:00
Andy Wingo
22225fc113 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.
2009-04-26 20:56:24 +02:00
Andy Wingo
e4721dde31 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.
2009-04-26 20:36:58 +02:00
Andy Wingo
165a7596ee 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.
2009-04-26 13:10:30 +02:00
Andy Wingo
00bbb89e96 remove sc-macro definition
* module/ice-9/boot-9.scm (sc-macro): Remove sc-macro definition, yay.
2009-04-26 11:48:29 +02:00
Andy Wingo
f176c584d0 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.
2009-04-26 11:35:23 +02:00
Andy Wingo
97ce9dbf21 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.
2009-04-25 16:31:52 +02:00
Andy Wingo
b3501b8043 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.
2009-04-25 14:10:08 +02:00
Andy Wingo
2ce560b944 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.
2009-04-25 12:50:53 +02:00
Andy Wingo
0ee32d0131 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.
2009-04-24 23:56:40 +02:00
Andy Wingo
9c35c5796c 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.
2009-04-24 23:10:31 +02:00
Andy Wingo
34ad4f83ca 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.
2009-04-24 19:59:42 +02:00
Andy Wingo
6e26b23c5d Merge branch 'master' into syncase-in-boot-9 2009-04-24 19:45:43 +02:00
Andy Wingo
58df2e4393 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.
2009-04-24 19:40:55 +02:00
Andy Wingo
d6ebfd7226 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.
2009-04-24 14:44:15 +02:00
Andy Wingo
a2716cbe1e 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.
2009-04-24 14:36:50 +02:00
Andy Wingo
384e92b3ae 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.
2009-04-24 14:35:04 +02:00
Andy Wingo
7c72fe0bb5 ice-9 syncase now deprecated, woo
Remove #:use-module (ice-9 syncase) from lots of places, as it's no
longer needed.
2009-04-24 14:34:23 +02:00
Andy Wingo
01c161ca11 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!
2009-04-24 14:25:45 +02:00
Andy Wingo
c5ad45c7b3 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.
2009-04-24 14:24:26 +02:00
Andy Wingo
85e95b4710 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.
2009-04-24 14:22:00 +02:00
Andy Wingo
64e5d08d3e 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.
2009-04-24 14:21:06 +02:00
Andy Wingo
131826039c 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.
2009-04-24 14:20:30 +02:00
Andy Wingo
a26934a850 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.
2009-04-24 14:20:22 +02:00
Andy Wingo
757937c290 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.
2009-04-24 13:42:25 +02:00
Andy Wingo
819cf0e8b8 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))).
2009-04-23 11:25:22 +02:00
Andy Wingo
8239263f86 fix erroneous #:use-syntax clausen
* module/system/repl/command.scm:
* module/system/repl/common.scm:
* module/system/repl/repl.scm:
* module/system/vm/debug.scm:
* module/system/vm/trace.scm: Change #:use-syntax to #:use-module, as
  that's really what we want to do.
2009-04-22 22:27:50 +02:00
Andy Wingo
eb5d1f8826 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.
2009-04-22 22:23:43 +02:00
Andy Wingo
efa6f9d944 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).
2009-04-22 00:17:22 +02:00
Andy Wingo
b1e93821a3 fix begin-deprecated
* module/ice-9/boot-9.scm (begin-deprecated): Fix to output source code,
  doh.
2009-04-21 23:03:00 +02:00
Andy Wingo
928258fbf2 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.
2009-04-21 23:02:53 +02:00
Andy Wingo
ae6bba7f9c 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.
2009-04-21 23:02:38 +02:00
Andy Wingo
dec62b5ef8 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.
2009-04-21 22:56:51 +02:00
Andy Wingo
265e61273d 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.
2009-04-21 22:26:27 +02:00
Andy Wingo
71d903c881 Merge branch 'syncase' 2009-04-20 22:26:02 +02:00
Andy Wingo
fb3807793f 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.
2009-04-20 18:20:01 +02:00
Andy Wingo
2b4b555b8f 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.
2009-04-20 17:23:40 +02:00
Andy Wingo
69dd78d7c8 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.
2009-04-17 15:20:19 +02:00
Andy Wingo
c5cc65ac0c 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.
2009-04-17 15:20:19 +02:00
Andy Wingo
249bab1c53 @ 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.
2009-04-17 15:20:18 +02:00
Andy Wingo
900761bc8d hygienic compilation
* module/language/scheme/compile-ghil.scm (lookup-transformer): Recognize
  macros as initial (@ ...) or (@@ ...) forms, enabling hygienic
  compilation.
2009-04-17 15:20:18 +02:00
Andy Wingo
d2b61fe0ff 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.
2009-04-17 15:20:17 +02:00
Andy Wingo
8e1d0d507a 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.
2009-04-17 15:20:17 +02:00
Andy Wingo
4e237f1460 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.
2009-04-17 15:20:16 +02:00
Andy Wingo
e02e84deed 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.
2009-04-17 15:20:16 +02:00