Ludovic Courtès [Wed, 21 Apr 2010 21:30:48 +0000 (23:30 +0200)]
Add `program-free-variables' to `(system vm program)'.
* module/system/vm/program.scm (program-free-variables): New procedure.
* module/language/objcode/spec.scm (program-free-variables): Remove.
Ludovic Courtès [Sun, 18 Apr 2010 22:27:47 +0000 (00:27 +0200)]
Fix the type tag produced by `SCM_STATIC_PROGRAM'.
* libguile/snarf.h (SCM_STATIC_PROGRAM): Fix typo.
Ludovic Courtès [Wed, 14 Apr 2010 21:46:41 +0000 (23:46 +0200)]
When printing a VM, show the type of engine being used.
* libguile/vm.c (scm_i_vm_print): Print the engine type.
Andy Wingo [Thu, 6 May 2010 20:34:36 +0000 (22:34 +0200)]
fix macros that expand into (begin (define-module ...) ...)
* module/ice-9/boot-9.scm (define-module): Add `expand' to the
situations, so that we ensure the current module changes at expand
time.
* module/ice-9/r6rs-libraries.scm (library): Expand the body within @@
expressions.
Andy Wingo [Thu, 6 May 2010 20:32:50 +0000 (22:32 +0200)]
psyntax no longer attempts to track (current-module)
* module/ice-9/psyntax.scm: Revert tracking of the current module while
expanding toplevel sequences. Better to preserve lexical scoping
(relative to the module of the original expression) and allow for @@
to override it.
* module/ice-9/psyntax-pp.scm: Regenerated.
* test-suite/tests/syncase.test: Test module-changing with @@.
Andy Wingo [Thu, 6 May 2010 19:12:09 +0000 (21:12 +0200)]
@@ generalized to arbitrary expressions.
* module/ice-9/psyntax.scm (@@): The RHS of an @@ is no longer
restricted to be an identifier, it can be an arbitrary expression.
* module/ice-9/psyntax-pp.scm: Regenerated.
Andy Wingo [Wed, 5 May 2010 22:15:06 +0000 (00:15 +0200)]
change form of @ and @@ psyntax handlers
* module/ice-9/psyntax.scm (@, @@): Take r and w args, and also return
r, w, and s. Adapt callers.
Andy Wingo [Wed, 5 May 2010 20:59:32 +0000 (22:59 +0200)]
add `expand' eval-when situation
* module/ice-9/psyntax.scm (chi-when-list, chi-top): Add an undocumented
`expand' situation to eval-when, which will trigger at expand-time for
toplevel expressions. Useful when you are expanding for eval, but need
to do some side effect to affect the expander -- like defining a
module.
* module/ice-9/psyntax-pp.scm: Regenerate.
Andy Wingo [Tue, 4 May 2010 21:47:22 +0000 (23:47 +0200)]
add explanatory comment to chi-macro
* module/ice-9/psyntax.scm (chi-macro): Add comment.
Andy Wingo [Tue, 4 May 2010 21:20:12 +0000 (23:20 +0200)]
check layout when making vtables
* libguile/struct.c (scm_is_valid_vtable_layout): New private layout
validating function.
(scm_i_struct_inherit_vtable_magic): Do a more proper layout
validation, and don't abort.
Andy Wingo [Mon, 3 May 2010 17:09:35 +0000 (19:09 +0200)]
add rnrs libraries test suite
* test-suite/Makefile.am:
* test-suite/tests/rnrs-libraries.test:
* test-suite/tests/rnrs-test-a.scm: Add rnrs libraries test suite.
Julian Graham [Sat, 6 Feb 2010 17:33:20 +0000 (12:33 -0500)]
add support for r6rs libraries
* module/ice-9/boot-9.scm: Include ice-9/r6rs-libraries.scm.
* module/ice-9/r6rs-libraries.scm: New file.
* module/Makefile.am (NOCOMP_SOURCES): Add r6rs-libraries.scm.
Andy Wingo [Mon, 3 May 2010 20:06:44 +0000 (22:06 +0200)]
only ensure local vars for definitions during expansion when compiling
* module/ice-9/psyntax.scm (chi-top): Only modify the compile-time
environment to indicate that there is a local binding if we are
running in compile mode. Otherwise some eval-when things might not
have gotten executed, and our current-module could be wrong.
* module/ice-9/psyntax-pp.scm: Regenerate.
Andy Wingo [Mon, 3 May 2010 14:34:12 +0000 (16:34 +0200)]
export, re-export etc as syntax-rules macros
* module/ice-9/boot-9.scm (export, re-export, export-syntax)
(re-export-syntax): Rewrite as syntax-rules macros.
Andy Wingo [Mon, 3 May 2010 14:31:32 +0000 (16:31 +0200)]
rewrite use-modules and use-syntax using syntax-case
* module/ice-9/boot-9.scm (use-modules): Rewrite as a syntax-case macro.
(use-syntax): Likewise.
(compile-interface-spec): Remove unused function
Andy Wingo [Mon, 3 May 2010 13:38:29 +0000 (15:38 +0200)]
rewrite define-module as a syntax-case macro
* module/ice-9/boot-9.scm (define-module): Rewrite as a syntax-case
macro, so that the expansion has proper module hygiene. Otherwise
process-define-module isn't properly resolved against the root module
-- a bytecode file that starts with a define-module would just try to
look up process-define-module from the current module.
(compile-define-module-args): Remove. Internal, and no one else used
it.
Andy Wingo [Sun, 2 May 2010 17:08:26 +0000 (19:08 +0200)]
remove duplicate quasisyntax.scm EXTRA_DIST
* module/Makefile.am (EXTRA_DIST): Remove quasisyntax.scm, as the
NOCOMP_SOURCES handles that case.
Julian Graham [Sun, 2 May 2010 18:58:15 +0000 (14:58 -0400)]
Test cases for `version-matches?'.
* test-suite/tests/modules.test ("module versions"): New tests for
`version-matches?'.
Andy Wingo [Sun, 2 May 2010 12:27:46 +0000 (14:27 +0200)]
add tour.texi to guile_TEXINFOS
* doc/ref/Makefile.am (guile_TEXINFOS): Add tour.texi.
Andy Wingo [Sun, 2 May 2010 12:18:58 +0000 (14:18 +0200)]
Update example disassemblies
* doc/ref/compiler.texi:
* doc/ref/vm.texi: Update example disassemblies for current compiler,
which uses assert-nargs-ee/locals.
Andy Wingo [Sun, 2 May 2010 11:41:31 +0000 (13:41 +0200)]
add assert-nargs-ee/locals instruction
* libguile/vm-i-system.c (assert-nargs-ee/locals): New instruction, a
combination of assert-nargs-ee and reserve-locals in the case in which
nreq and nlocs can both be represented in 8 bits.
* module/language/glil/compile-assembly.scm (glil->assembly): Add
compiler case.
* doc/ref/vm.texi (Function Prologue Instructions): Update docs.
Andy Wingo [Sun, 2 May 2010 11:15:22 +0000 (13:15 +0200)]
add underflow check in make-array
* libguile/vm-i-scheme.c (make-array): Check for underflow before making
the array.
Andy Wingo [Sun, 2 May 2010 11:14:58 +0000 (13:14 +0200)]
add SCM_UNLIKELY to CHECK_UNDERFLOW
* libguile/vm-engine.h (CHECK_OVERFLOW, CHECK_UNDERFLOW): Add
SCM_UNLIKELY blocks. Fix off-by-one error in CHECK_UNDERFLOW.
(PRE_CHECK_UNDERFLOW): New macro, for checking underflow before
accessing the current sp.
(POP): Use PRE_CHECK_UNDERFLOW.
Andy Wingo [Sun, 2 May 2010 10:46:50 +0000 (12:46 +0200)]
update compiler.texi
* doc/ref/compiler.texi (Compiler Tower): Update for removal of version
from <language>, and add joiner and make-default-environment fields.
Update examples.
(The Scheme Compiler): Update for `macroexpand' instead of
`sc-expand', and that the environment must be a module.
(Tree-IL): Update for new Tree-IL, and change from "vars" to
"gensyms".
(GLIL): Update for new GLIL, including preludes and prompts.
(Assembly): Update for current output (which seems quite verbose).
(Bytecode and Objcode): Update for current output, and some procedure
name changes.
Andy Wingo [Sun, 2 May 2010 09:22:23 +0000 (11:22 +0200)]
rename `vars' field in tree-il binding constructs to `gensyms'
* module/language/tree-il.scm (<tree-il>): Rename `vars' fields of
<let>, <letrec>, <fix>, and <lambda-case> to `gensyms'. For clarity,
and to match <lexical-ref>.
* module/language/tree-il.scm:
* module/language/tree-il/analyze.scm:
* module/language/tree-il/compile-glil.scm:
* module/language/tree-il/fix-letrec.scm:
* module/language/tree-il/inline.scm: Update all callers.
Andy Wingo [Sun, 2 May 2010 09:19:46 +0000 (11:19 +0200)]
fix a comment about environments and the scheme compiler
* module/language/scheme/compile-tree-il.scm: Fix a comment about the
format of environments.
Andy Wingo [Sun, 2 May 2010 09:19:13 +0000 (11:19 +0200)]
remove `version' field from <language>
* module/system/base/language.scm (<language>): Remove the `version'
field from languages. It just wasn't useful.
* module/language/assembly/spec.scm:
* module/language/brainfuck/spec.scm:
* module/language/bytecode/spec.scm:
* module/language/ecmascript/spec.scm:
* module/language/elisp/spec.scm:
* module/language/glil/spec.scm:
* module/language/objcode/spec.scm:
* module/language/scheme/spec.scm:
* module/language/tree-il/spec.scm:
* module/language/value/spec.scm: Remove #:version from all language
definitions. Shorten some language names (e.g. "Guile Scheme" ->
"Scheme").
Andy Wingo [Sat, 1 May 2010 15:02:39 +0000 (17:02 +0200)]
update documentation for vm instructions
* doc/ref/vm.texi: Update with documentation for new-ish instructions,
and reorganize the sections a bit.
* doc/ref/compiler.texi (GLIL): Fix up a couple xrefs.
Andy Wingo [Fri, 30 Apr 2010 22:49:06 +0000 (00:49 +0200)]
simplify make-struct
* libguile/vm-i-scheme.c: Use DROPN idiom.
Andy Wingo [Fri, 30 Apr 2010 22:31:18 +0000 (00:31 +0200)]
optimize and bugfix make-struct VM opcode
* libguile/_scm.h (SCM_OBJCODE_MINOR_VERSION): Bump for make-struct
change.
* libguile/struct.c (scm_i_alloc_struct): Use scm_words instead of
scm_gc_malloc to simplify the code and inline the call to GC_MALLOC.
* module/language/tree-il/compile-glil.scm (*primcall-ops*): Compile
make-struct/no-tail to make-struct.
* module/language/tree-il/primitives.scm (define-primitive-expander):
Allow a conditional branch of #f to aboirt inlining.
(make-struct): Expand into make-struct/no-tail in the case that
tail-size is 0.
* libguile/vm-i-scheme.c (make-struct): Adapt to always assume tail-size
is 0. Inline allocation if possible. Don't decrement the SP past live
objects on the stack, which could cause GC to miss references. Use the
NULLSTACK macro.
Andy Wingo [Tue, 27 Apr 2010 21:04:39 +0000 (23:04 +0200)]
fix bug in compile-glil.scm for return opcode-hack
* module/language/tree-il/compile-glil.scm (*primcall-ops*): Fix entry
for `return'. Thanks to Jon Herron for the report.
Andy Wingo [Tue, 27 Apr 2010 20:57:54 +0000 (22:57 +0200)]
add module-export-all!
* module/ice-9/boot-9.scm (module-export-all!): New function, exports
all current and future local variables from a module.
Andy Wingo [Tue, 27 Apr 2010 20:04:33 +0000 (22:04 +0200)]
Merge branch 'wip-module-namespaces'
Andy Wingo [Tue, 27 Apr 2010 20:04:24 +0000 (22:04 +0200)]
comment some global variables in modules.c
* libguile/modules.c: Comment some global variables.
Neil Jerram [Mon, 26 Apr 2010 21:09:20 +0000 (22:09 +0100)]
Fix inconsistent sectioning, causing make to fail
* doc/ref/guile.texi (Top): Remove @raisesections and @lowersections
around scheme-ideas.texi.
* doc/ref/scheme-ideas.texi (About Data, ...): Instead remove one
"sub" from every node here apart from the chapter node.
* doc/ref/scheme-ideas.texi (Evaluating, Eval Variable, Eval
Procedure, Eval Special, Lexical Scope, Scoping Example): Turn
subheadings back into subsubsections, and reinstate corresponding
menus. (These had to become headings, rather than (sub)*sections, when
the top level item in scheme-ideas.texi was a section. Now it's a
chapter again, they can go back to being (sub)*sections.)
Neil Jerram [Mon, 26 Apr 2010 04:24:24 +0000 (05:24 +0100)]
Bring the manual organisation section a little closer to reality
FWIW I'm not sure I like this bullety presentation - but for now this
just aligns the descriptions a bit closer to the actual chapters and
chapter contents.
* doc/ref/intro.texi (Organisation of this Manual): Cover `Hello
Guile!' and `Hello Scheme!' chapters. Thin out text for
`Programming in Scheme'. Renumber other chapters.
Neil Jerram [Mon, 26 Apr 2010 03:27:01 +0000 (04:27 +0100)]
Assorted minor manual changes
* doc/ref/guile.texi (Programming in Scheme): Remove "awful" and add
"as opposed to having to dive into C code", to explain what we
really mean here. Remove incorrect para about the `Hello Scheme!'
material.
* doc/ref/intro.texi (Interactive Programming): Change "allows" to "is
designed for" - sounds less accidental!
* doc/ref/scheme-ideas.texi (Hello Scheme!): Remove unnecessary
"reference", and inappropriate "randomness".
Neil Jerram [Mon, 26 Apr 2010 01:43:54 +0000 (02:43 +0100)]
More `Guile and the GNU Project' text
* doc/ref/intro.texi (Guile and the GNU Project): More text about
extensibility and software freedom.
Neil Jerram [Sun, 25 Apr 2010 17:53:40 +0000 (18:53 +0100)]
Move description of manual organisation from Preface to Introduction
This material isn't "meta-" enough to be in the Preface, and it
supports (by its structure) some of the points that the Introduction
makes about Guile, so I think it belongs here.
* doc/ref/intro.texi (Introduction): Add `Organisation of this Manual'
menu item and material to here...
* doc/ref/preface.texi (Preface): ...from here.
Neil Jerram [Sun, 25 Apr 2010 17:28:19 +0000 (18:28 +0100)]
Remove weird instruction
* doc/ref/intro.texi: Remove `Do not confuse the two.' (Or else
what?)
Neil Jerram [Sun, 25 Apr 2010 17:12:01 +0000 (18:12 +0100)]
Fix typo
* doc/ref/compiler.texi (Bytecode and Objcode): Remove extraneous
comma.
Neil Jerram [Sun, 25 Apr 2010 16:56:56 +0000 (17:56 +0100)]
Move `Reporting Bugs' section out of Introduction
I think it's too detailed, when compared with the other Introduction
sections. It probably also refers to concepts that haven't been
mentioned yet, but are mentioned in the following quick tour chapter;
so let's move it there.
* doc/ref/guile.texi: Move @raisesections and @lowersections for
tour.texi material from here to inside tour.texi.
* doc/ref/intro.texi (Introduction): Don't mention reporting problems
in first para. Move menu item and material for `Reporting Bugs'
from here...
* doc/ref/tour.texi (Hello Guile!): ...to here. Also mention
reporting problems in the introductory para.
Neil Jerram [Sun, 25 Apr 2010 16:01:01 +0000 (17:01 +0100)]
Move whirlwind tour material to its own chapter
* doc/ref/guile.texi (Top): New top level `Hello Guile!' menu item;
include new file tour.texi.
* doc/ref/intro.texi (Introduction): Remove whirlwind tour menu item
and material from here...
* doc/ref/tour.texi: ...to new file here.
Neil Jerram [Sun, 25 Apr 2010 12:20:17 +0000 (13:20 +0100)]
Move Scheme introduction (Guile-independent) to its own chapter
This magically fixes all the internal wordings that say "chapter"
rather than "section", and separates Guile-independent and skippable
material from material that is Guile-specific and
probably-not-skippable - which I think is helpful.
* doc/ref/guile.texi (Top): New `Hello Scheme!' menu item, and removed
`Basic Ideas' item. Move include of scheme-ideas.texi before
`Programming in Scheme' chapter, using @raisesections and
@lowersections. Also move scheme-reading.texi to same place.
* doc/ref/scheme-ideas.texi: Change name from `Basic Ideas' (which is
a bit boring) to `Hello Scheme!'. Move `Further Reading' menu item
here.
Andy Wingo [Fri, 23 Apr 2010 15:16:56 +0000 (17:16 +0200)]
module-public-interface is a field in the module record
* module/ice-9/boot-9.scm (module-public-interface)
(set-module-public-interface!): Instead of using
'%module-public-interface, use a field in the module instead.
(make-module, make-autoload-interface): Adapt.
* module/ice-9/deprecated.scm (module-public-interface):
(set-module-public-interface!): Add shims so that manually munging
%module-public-interface should continue to work.
Andy Wingo [Fri, 23 Apr 2010 15:22:00 +0000 (17:22 +0200)]
fix some uses of %module-public-interface
* module/ice-9/r5rs.scm:
* module/ice-9/safe-r5rs.scm:
* module/oop/goops/save.scm:
* module/oop/goops/simple.scm:
* module/oop/goops/stklos.scm: Fix some uses of
%module-public-interface.
Andy Wingo [Fri, 23 Apr 2010 15:03:34 +0000 (17:03 +0200)]
module-public-interface in Scheme
* libguile/modules.c: Consolidate all variables to the top of the file.
(scm_module_public_interface): Dispatch to Scheme.
(scm_post_boot_init_modules): Resolve module-public-interface.
* module/ice-9/boot-9.scm (module-public-interface): Implement in
Scheme.
Andy Wingo [Fri, 23 Apr 2010 14:31:09 +0000 (16:31 +0200)]
add submodule binders
* module/ice-9/boot-9.scm (module-submodule-binder)
(set-module-submodule-binder!): New field on modules.
(make-module, make-autoload-interface): Adapt.
(module-ref-submodule): If we miss the submodules table, call the
submodules binder, if any.
* module/ice-9/deprecated.scm (module-ref-submodule): Check the
submodule binder before the deprecated look into the obarray.
Andy Wingo [Fri, 23 Apr 2010 14:13:06 +0000 (16:13 +0200)]
module-{ref,define}-submodule use the submodules table
* module/ice-9/boot-9.scm (module-ref-submodule)
(module-define-submodule!): Implement in terms of the
module-submodules table, instead of looking for bindings in the value
namespace.
* module/ice-9/deprecated.scm (module-ref-submodule):
(module-define-submodule!): Define deprecated versions of these that
duplicate the submodules table in the normal values namespace, for
back compatibility.
Andy Wingo [Thu, 22 Apr 2010 12:12:05 +0000 (14:12 +0200)]
add submodules field to modules
* module/ice-9/boot-9.scm (module-type, module-constructor): Add a field
to modules, a table that will hold submodules.
(make-module, make-autoload-interface): Adapt.
Andy Wingo [Fri, 23 Apr 2010 14:08:01 +0000 (16:08 +0200)]
use nested-ref-module in (system xref)
* module/system/xref.scm (program-callee-rev-vars): Use
nested-ref-module instead of nested-ref.
Andy Wingo [Fri, 23 Apr 2010 14:03:23 +0000 (16:03 +0200)]
nested module fixen to (ice-9 ls)
* module/ice-9/ls.scm (local-definitions-in, definitions-in): Use nested
module procedures, as appropriate.
(recursive-local-define): Fix attempt to treat null as false. Whoops..
Andy Wingo [Fri, 23 Apr 2010 13:58:08 +0000 (15:58 +0200)]
deprecated %app shims use module-define-submodule!
* module/ice-9/deprecated.scm (%app, app, modules): Don't use the module
interface to provide %app shims, use module-define-submodule! directly
to side-effect the root module.
Andy Wingo [Fri, 23 Apr 2010 13:55:32 +0000 (15:55 +0200)]
resolve-module uses -module variants
* module/ice-9/boot-9.scm (resolve-module): Use module-define-submodule!
when binding the root, and nested-ref-module for the hot lookup, which
is guaranteed to return a module or #f.
Andy Wingo [Fri, 23 Apr 2010 13:44:31 +0000 (15:44 +0200)]
use the define-module variants in module-name and make-modules-in
* module/ice-9/boot-9.scm (module-name): Use module-define-submodule!
instead of nested-define!.
(make-modules-in): Rewrite in terms of nested-define-module!.
Andy Wingo [Fri, 23 Apr 2010 13:41:34 +0000 (15:41 +0200)]
nested-ref et al use module-ref-submodule; add -module nested variants
* module/ice-9/boot-9.scm: Update comments above nested-ref to include
ref-module and define-module!.
(nested-ref, nested-set!, nested-define!, nested-remove!): Use
module-ref-submodule to traverse the module hierarchy.
(nested-ref-module, nested-define-module!): New functions, like
nested-ref and nested-define!, but operate on namespaces instead of
values.
(local-ref-module, local-define-module): New analogs of local-ref and
local-define, but for namespaces.
Andy Wingo [Fri, 23 Apr 2010 13:37:36 +0000 (15:37 +0200)]
add module-ref-submodule, module-define-submodule!
* module/ice-9/boot-9.scm (module-ref-submodule):
(module-define-submodule!): New stubs, will be used to separate
traversing the module tree from accessing values.
Andy Wingo [Fri, 23 Apr 2010 13:34:22 +0000 (15:34 +0200)]
tweak to resolve-module
* module/ice-9/boot-9.scm (resolve-module): If we found a module but it
didn't have a public interface and we're not autoloading, just return
the module directly instead of dispatching to make-modules-in.
Andy Wingo [Fri, 23 Apr 2010 14:07:14 +0000 (16:07 +0200)]
fix (app modules) usage in (ice-9 session)
* module/ice-9/session.scm (root-modules): Fix '(app modules) usage.
Andy Wingo [Thu, 22 Apr 2010 13:25:09 +0000 (15:25 +0200)]
deprecate %app
* module/ice-9/boot-9.scm (module-name): Don't rely on (%app modules),
use other tricks to name anonymous modules.
(resolve-module): Instead of relying on %app, close over the root of
the module hierarchy -- the module that was '(%app modules).
* module/ice-9/deprecated.scm (%app): Provide a compatible %app shim.
Andy Wingo [Tue, 20 Apr 2010 12:53:38 +0000 (14:53 +0200)]
refactorings for the module boot process
* module/ice-9/boot-9.scm (%app): Bind %app and (%app modules) within
the nested hierarchy before making (guile).
(the-root-module): Define to '(%app modules guile) together with
the-root-module's definition.
(resolve-module): Define a "phase 2" resolve-module that only works on the
root module.
(try-module-autoload): No need for stub definition, as modules.c does
not reference this binding.
(resolve-module): Redefine, after modules have been loaded, to
actually do its job, without any hacks for the pre-boot phase.
Move up the boot code before the definition of resolve-module's
helpers.
Andy Wingo [Tue, 20 Apr 2010 11:42:21 +0000 (13:42 +0200)]
add comments to resolve-module
* module/ice-9/boot-9.scm (resolve-module): Add comments.
Andy Wingo [Tue, 20 Apr 2010 11:41:41 +0000 (13:41 +0200)]
formally deprecate `app'
* module/ice-9/deprecated.scm (app): Deprecate.
* module/ice-9/boot-9.scm: Remove app definition.
Andy Wingo [Thu, 22 Apr 2010 13:08:13 +0000 (15:08 +0200)]
(app modules) -> (%app modules)
* module/ice-9/debugging/breakpoints.scm (module-if-already-loaded):
(all-loaded-modules):
* module/oop/goops/stklos.scm: Fix instances of (app modules) to be
(%app modules).
Andy Wingo [Tue, 20 Apr 2010 10:42:38 +0000 (12:42 +0200)]
fix comment about "local-define" and "local-remove".
* module/ice-9/boot-9.scm: Fix comment about "local-define!", whereas
it's "local-define". Same for "local-remove".
Andy Wingo [Tue, 20 Apr 2010 10:34:05 +0000 (12:34 +0200)]
module-type defined programmatically
* module/ice-9/boot-9.scm (make-record-type): Add an explanatory
comment.
(%print-module): Remove a hacky comment about redefinitions being
difficult, because now the module-printer is called by name from
module-type's printer.
(module-type): Define the module type, its constructor, predicate, and
accessors programmatically, at expansion time. Should reduce any
errors in transcription, between adding fields and adding accessors.
* libguile/modules.c (scm_lookup_closure_module): Move an explanatory
comment here from boot-9.scm.
Andy Wingo [Mon, 19 Apr 2010 18:19:24 +0000 (20:19 +0200)]
avoid primitive-eval in record-constructor
* module/ice-9/boot-9.scm (record-type-vtable): Add a third field, a
precomputed constructor. There is an unfortunate circularity here,
though.
(make-record-type): If the record has fewer than 20 fields,
return a constructor pre-generated to suit. Otherwise just check the
length, and dispatch to `apply' and not `primitive-eval'. FWIW the
current module record has something like 12 fields.
(record-constructor): If we're asking for the standard constructor,
return the precomputed constructor.
Andy Wingo [Mon, 19 Apr 2010 17:33:57 +0000 (19:33 +0200)]
make-record-type slight refactor
* test-suite/tests/records.test ("records"): Add tests for printers.
* module/ice-9/boot-9.scm (make-record-type): Refactor the code that
makes the default printer.
Andy Wingo [Mon, 19 Apr 2010 14:39:11 +0000 (16:39 +0200)]
filesystem trickery to scm_i_relativize_path in filesys.c; bugfix.
* libguile/filesys.h:
* libguile/filesys.c (scm_i_relativize_path): New function, moved here
from fports.c. Internal for now; we can make it external though if
people like its interface.
* libguile/fports.c (fport_canonicalize_filename): Move all of the
tricky bits to filesys.c. Also fixes a bug in which a delimiter wasn't
stripped.
Andy Wingo [Mon, 19 Apr 2010 12:00:23 +0000 (14:00 +0200)]
deprecate @bind
* module/ice-9/boot-9.scm:
* module/ice-9/deprecated.scm (@bind): Deprecate @bind, which was a
thread-unsafe dynamic scoping mechanism, used in the old elisp
support. Fluids are more correct, and are probably faster, given the
VM support for with-fluids.
* test-suite/tests/dynamic-scope.test: Remove.
* test-suite/tests/fluids.test: Move relevant tests from
dynamic-scope.test here, recast in terms of with-fluids.
Andy Wingo [Mon, 19 Apr 2010 11:34:29 +0000 (13:34 +0200)]
compile-file gets #:canonicalization arg, defaults to 'relative
* module/system/base/compile.scm (compile-file, compile-and-load): Add a
keyword arg #:canonicalization, which defaults to 'relative. In this
way, one might compile "../module/ice-9/boot-9.scm", but the path that
gets residualized into the .go is "ice-9/boot-9.scm".
Andy Wingo [Mon, 19 Apr 2010 11:18:07 +0000 (13:18 +0200)]
%file-port-name-canonicalization is a fluid
* libguile/fports.c (fport_canonicalize_filename):
(scm_init_fports): Change %file-port-name-canonicalization to be a
fluid.
Andy Wingo [Mon, 19 Apr 2010 11:14:43 +0000 (13:14 +0200)]
add %file-port-name-canonicalization option
* libguile/fports.c (%file-port-name-canonicalization): New global var.
(fport_canonicalize_filename): New helper. If
%file-port-name-canonicalization is 'absolute, then run file port
names through canonicalize_path; if it's 'relative, then canonicalize
the name, but strip off load paths; otherwise leave the port name
alone.
(scm_open_file): Use fport_canonicalize_filename.
(scm_init_fports): Define %file-port-name-canonicalization.
Andy Wingo [Mon, 19 Apr 2010 11:12:26 +0000 (13:12 +0200)]
formatting fix
* libguile/filesys.c (scm_canonicalize_path): Format fix.
Andy Wingo [Mon, 19 Apr 2010 10:05:27 +0000 (12:05 +0200)]
use procedure-minimum-arity in tests
* test-suite/tests/procprop.test ("procedure-arity"): Fix tests to use
procedure-minimum-arity.
Andy Wingo [Sat, 17 Apr 2010 14:28:52 +0000 (16:28 +0200)]
deprecate arity access via (procedure-properties proc 'arity)
* libguile/procprop.h (scm_sym_arity): Deprecate. I didn't move it to
deprecated.h though, because that might have some boot implications --
though I didn't check.
* libguile/procprop.c (scm_procedure_properties)
(scm_set_procedure_properties_x, scm_procedure_property)
(scm_set_procedure_property_x): Deprecate access to a procedure's
arity via procedure-properties. Users should use
procedure-minimum-arity.
* module/ice-9/channel.scm (eval):
* module/ice-9/session.scm (arity):
* module/language/tree-il/analyze.scm (validate-arity): Fix up instances
of (procedure-property x 'arity) to use procedure-minimum-arity.
Andy Wingo [Sat, 17 Apr 2010 14:03:51 +0000 (16:03 +0200)]
add procedure_minimum_arity
* libguile/procprop.h:
* libguile/procprop.c (scm_procedure_minimum_arity): New public
function, will replace (procedure-property foo 'arity).
* libguile/programs.c (scm_i_program_arity): Rework to always provide
the most permissive arity.
Andy Wingo [Sat, 17 Apr 2010 13:17:24 +0000 (15:17 +0200)]
remove program-name, program-documentation
* libguile/programs.h:
* libguile/programs.c (scm_program_name): Remove. procedure-name is
sufficient.
* module/system/vm/program.scm (program-name): Remove from exports list.
(program-documentation): Remove; procedure-documentation is
sufficient.
* libguile/debug.c (scm_procedure_name): Remove special case for
programs.
* module/language/tree-il/analyze.scm (validate-arity): Use
procedure-name.
* module/ice-9/documentation.scm (object-documentation): Just use
procedure-documentation, without special cases for programs.
Andy Wingo [Sat, 17 Apr 2010 13:02:56 +0000 (15:02 +0200)]
scm_i_program_properties is internal; just use procedure-properties
* libguile/programs.h:
* libguile/programs.c (scm_i_program_properties): Make internal.
(scm_program_name): Use scm_i_program_properties.
* libguile/procprop.c (scm_procedure_properties): Use
scm_i_program_properties, for programs.
* libguile/procs.c (scm_procedure_documentation): Use procedure-property
to get to 'documentation, not program-property.
* module/system/vm/program.scm (program-properties, program-property):
Remove from the exports list.
(program-documentation): Use procedure-property.
* module/texinfo/reflection.scm (macro-arguments)
(macro-additional-stexi)
(object-stexi-documentation): Use procedure-property, not
program-property.
Andy Wingo [Sat, 17 Apr 2010 12:47:47 +0000 (14:47 +0200)]
tweaks to procprop.c
* libguile/procprop.c (scm_procedure_property)
(scm_set_procedure_property_x): Fix up some variable naming.
Andy Wingo [Sat, 17 Apr 2010 12:45:32 +0000 (14:45 +0200)]
procedure-properties incorporates program-properties
* libguile/procprop.c (overrides, overrides_lock): Rename from props and
props_lock.
(scm_procedure_properties): If no overrides have been set, default to
scm_program_properties (if it's a program).
(scm_set_procedure_properties_x): Error if 'arity is in the alist.
(scm_procedure_property): Just do a lookup in the
scm_procedure_properties.
(scm_set_procedure_properties_x): Init the overrides to
scm_procedure_properties.
Andy Wingo [Sat, 17 Apr 2010 12:04:49 +0000 (14:04 +0200)]
fix read.bm
* benchmark-suite/benchmarks/read.bm (%files-to-load): psyntax-pp.scm,
not psyntax.scm.
Neil Jerram [Fri, 16 Apr 2010 21:26:32 +0000 (22:26 +0100)]
Merge branch 'wip-manual-2'
Conflicts:
doc/ref/api-translation.texi
Andy Wingo [Fri, 16 Apr 2010 15:43:42 +0000 (17:43 +0200)]
fold in feedback to api-languages
* doc/ref/api-languages.texi: Fold in feedback.
Andy Wingo [Fri, 16 Apr 2010 08:35:51 +0000 (10:35 +0200)]
NEWS tweaks for nil
* NEWS: Some nil-related news fixes; after 1.9.10, I know, but hey ;-)
Andy Wingo [Fri, 16 Apr 2010 07:38:29 +0000 (09:38 +0200)]
more nil docs
* doc/ref/api-languages.texi (Nil): Be a bit more thorough, and
positive.
Andy Wingo [Thu, 15 Apr 2010 22:00:39 +0000 (00:00 +0200)]
add docs on `nil'
* doc/ref/api-languages.texi (Nil): Write about `nil'.
Andy Wingo [Thu, 15 Apr 2010 21:24:26 +0000 (23:24 +0200)]
fix bugs in ice-9 i18n demo (invalid input)
* doc/ref/api-i18n.texi (Accessing Locale Information): Crucial
bugfixes.
Andy Wingo [Thu, 15 Apr 2010 21:10:25 +0000 (23:10 +0200)]
fixes to api-i18n.texi
* doc/ref/api-i18n.texi (Character Case Mapping): Remove note about lack
of support for multibute characters.
Andy Wingo [Thu, 15 Apr 2010 21:09:29 +0000 (23:09 +0200)]
flesh out docs on multiple languages a bit more
* doc/ref/api-languages.texi: Move here from api-translation. Still
stubbed in parts, but it's getting better.
* doc/ref/Makefile.am: Adapt to api-languages.texi name change.
* doc/ref/guile.texi: Likewise.
Ludovic Courtès [Thu, 15 Apr 2010 20:21:40 +0000 (22:21 +0200)]
Bump version number for 1.9.10.
* GUILE-VERSION (GUILE_MICRO_VERSION): Increment.
Neil Jerram [Sun, 27 Dec 2009 13:20:05 +0000 (13:20 +0000)]
Improvements to Introduction chapter
* doc/ref/intro.texi (Introduction): Change "some" to "the".
(Guile and Scheme): "multithreading" -> "multithreaded".
(Combining with C): Mention "libguile" as library name.
(Guile and the GNU Project): New text.
(Interactive Programming): New text.
(Supporting Multiple Languages): New text, reflecting currently
supported languages.
(Obtaining and Installing Guile): Use @var for version placeholder.
Remove mention of separate tutorial.
Neil Jerram [Sat, 10 Apr 2010 12:32:42 +0000 (13:32 +0100)]
Merge branch 'master' into wip-manual-2
Conflicts:
doc/ref/api-procedures.texi
doc/ref/misc-modules.texi
(Caused by me removing `@page' from a couple of sections that have been modified
by others.)
Andy Wingo [Fri, 9 Apr 2010 20:33:46 +0000 (22:33 +0200)]
elisp.test cleanups
* test-suite/tests/elisp.test: Use quote and #nil instead of quasiquote
and ,#nil.
Andy Wingo [Fri, 9 Apr 2010 12:43:49 +0000 (14:43 +0200)]
re-enable elisp test
* test-suite/tests/elisp.test: Rework for #nil, to actually be enabled,
to always run, and to use the new compiler. Comment out some failing tests, to
be dealt with in the future.
Andy Wingo [Fri, 9 Apr 2010 12:44:28 +0000 (14:44 +0200)]
change remaining %nil -> #nil
* doc/ref/vm.texi:
* libguile/boolean.h:
* libguile/pairs.h:
* module/language/elisp/README:
* test-suite/tests/elisp-compiler.test:
* test-suite/tests/load.test: Change remaining mentions of %nil to #nil.
Andy Wingo [Fri, 9 Apr 2010 19:04:52 +0000 (21:04 +0200)]
elisp fixes for nil, and, or
* module/language/elisp/runtime/macro-slot.scm (or, and): Fix one-arg
case to return the arg as-is.
* module/language/elisp/runtime.scm (nil-value): Fix to be #nil.
Andy Wingo [Fri, 9 Apr 2010 12:26:31 +0000 (14:26 +0200)]
remove libguile/lang.h, deprecate %nil (in favor of #nil)
* libguile/Makefile.am:
* libguile/init.c:
* libguile/lang.c:
* libguile/lang.h: Remove lang.c and lang.h.
* libguile/pairs.h (SCM_NIL_P, SCM_NULL_OR_NIL_P): Moved here.
* module/ice-9/deprecated.scm (%nil): %nil definition moved here.
* libguile/alist.c:
* libguile/async.c:
* libguile/backtrace.c:
* libguile/boolean.c:
* libguile/dynl.c:
* libguile/eval.c:
* libguile/filesys.c:
* libguile/fluids.c:
* libguile/list.c:
* libguile/load.c:
* libguile/options.c:
* libguile/posix.c:
* libguile/print.c:
* libguile/promises.c:
* libguile/sort.c:
* libguile/throw.c:
* libguile/trees.c:
* libguile/vectors.c:
* libguile/vm.c:
* libguile/weaks.c:
* srfi/srfi-1.c: <libguile/lang.h> references removed.
Andy Wingo [Fri, 9 Apr 2010 12:17:04 +0000 (14:17 +0200)]
%nil -> #nil
* module/language/assembly.scm (object->assembly, assembly->object):
* module/language/elisp/compile-tree-il.scm (compile-pair):
* module/language/glil/decompile-assembly.scm (decompile-load-program):
Change instances of %nil to #nil.
Andy Wingo [Fri, 9 Apr 2010 12:15:16 +0000 (14:15 +0200)]
add read syntax for #nil
* libguile/evalext.c (scm_self_evaluating_p): #nil is self-evaluating.
* libguile/read.c (scm_read_nil, scm_read_sharp): Add read syntax for
#nil.