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

298 commits

Author SHA1 Message Date
Andy Wingo
283ab48d3f faster (make-prompt-tag); default-prompt-tag is a parameter
* module/ice-9/boot-9.scm (default-prompt-tag): Once parameters have
  booted, redefine as a parameter.
  (make-prompt-tag): Change from a gensym to a list.  Thanks to Mark
  Weaver for the suggestion.

* doc/ref/api-control.texi (Prompt Primitives): Update docs.
2012-03-07 19:02:00 +01:00
Andy Wingo
a62b5c3d54 call-with-{input,output}-string implemented in scheme
* module/ice-9/boot-9.scm (call-with-input-string)
  (call-with-output-string): Implement in Scheme.

* libguile/strports.c (scm_call_with_output_string):
  (scm_call_with_input_string): Dispatch to Scheme.
2012-03-07 13:34:06 +01:00
Andy Wingo
f6e6b5181a shuffle r4rs procedures into boot-9
* module/ice-9/boot-9.scm: Refine a comment about low-level port
  functions.  Move call-with-foo-port, with-input-from-foo, etc later in
  the file, and define using `parameterize' instead of `dynamic-wind'.
  Somewhat cleaner, and avoids thunk? checks for "swaports" in the old
  implementation.
2012-03-06 00:51:50 +01:00
Andy Wingo
124bc316a6 load parameters earlier in boot-9
* module/ice-9/boot-9.scm: Move parameters earlier in the boot process.
  The new with-output-to-port code will use it.
2012-03-06 00:51:49 +01:00
Andy Wingo
d867c7496c slight tweak to file-exists?, file-is-directory?
* module/ice-9/boot-9.scm (file-exists?, file-is-directory?): For the
  fallback cases, use open-input-file instead of open-file with
  OPEN_READ.
2012-03-06 00:51:49 +01:00
Andy Wingo
f7955da966 bootstrapping shenanigans in `warn'
* module/ice-9/boot-9.scm (warn): Don't use with-output-to-port, as
  we'll move that definition after the psyntax boot.
2012-03-06 00:51:49 +01:00
Andy Wingo
f28dc43c95 more clear comments in boot-9.scm
* module/ice-9/boot-9.scm: Update comment header for language
  primitives.
2012-03-06 00:51:49 +01:00
Andy Wingo
0f6f5fb7f8 remove deprecated close-io-port
* module/ice-9/boot-9.scm (close-io-port): Remove proc that was
  deprecated in 2.0.
2012-03-06 00:51:49 +01:00
Andy Wingo
418321524a inline ice-9/r4rs.scm into ice-9/boot-9.scm
* module/ice-9/boot-9.scm: Inline r4rs.scm, in anticipation of more
  refactorings.

* module/ice-9/r4rs.scm: Remove.
* module/Makefile.am: Update.
2012-03-06 00:51:49 +01:00
Andy Wingo
917b0e72f7 tune default hash table sizes
* libguile/modules.c: In my current image, there are 1790 bindings in
  the root module, which tips over to the next hash vector size, so
  declare that to prevent rehashing.
* libguile/srcprop.c (scm_init_srcprop): Don't preallocate a big
  source_whash table, as we might not need it (if everything is
  compiled, for example).
* module/ice-9/boot-9.scm (make-module): Don't preall-cate big hash
  tables for imported bindings.  Instead trust that resizing works
  correctly.
2012-02-19 20:46:14 +01:00
Andy Wingo
a41bed83ab Merge remote-tracking branch 'origin/stable-2.0'
Conflicts:
	libguile/read.c
	test-suite/tests/tree-il.test
2012-02-11 18:14:48 +01:00
Mark H Weaver
e7cf0457d7 Support => within case, and improve error messages for cond and case
* module/ice-9/boot-9.scm (cond, case): Reimplement using syntax-case,
  with improved error messages and support for '=>' within 'case' as
  mandated by the R7RS.  Add warnings for duplicate case datums and
  case datums that cannot be meaningfully compared using 'eqv?'.

* module/system/base/message.scm (%warning-types): Add 'bad-case-datum'
  and 'duplicate-case-datum' warning types.

* test-suite/tests/syntax.test (cond, case): Update tests to reflect
  improved error reporting.  Add tests for '=>' within 'case'.

* test-suite/tests/tree-il.test (partial evaluation): Update tests to
  reflect changes in how 'case' is expanded.

* doc/ref/api-control.texi (Conditionals): Document '=>' within 'case'.
2012-02-08 16:27:48 -05:00
Andy Wingo
0858753e82 Merge remote-tracking branch 'origin/stable-2.0'
Conflicts:
	GUILE-VERSION
	libguile/gc-malloc.c
	libguile/ports.c
2012-02-08 11:48:08 +01:00
Bake Timmons
91a214ebd9 Improve the usage of variable names in Scheme docstrings.
* module/ice-9/boot-9.scm:
* module/ice-9/popen.scm:
* module/ice-9/pretty-print.scm:
* module/ice-9/r4rs.scm:
* module/rnrs/io/ports.scm:
* module/texinfo/string-utils.scm:
* module/web/http.scm:
* module/web/request.scm:
* module/web/response.scm:
* test-suite/vm/run-vm-tests.scm: Make the variable names in Scheme docstrings more
  consistent.  Replace a few instances of @var with @code when appropriate.
2012-02-02 12:24:40 +01:00
Andy Wingo
dfadcf85cb Merge remote-tracking branch 'origin/stable-2.0'
Conflicts:
	libguile/debug.h
	module/ice-9/psyntax-pp.scm
	module/ice-9/psyntax.scm
	module/language/tree-il/peval.scm
	module/language/tree-il/primitives.scm
2012-01-30 20:27:35 +01:00
Andy Wingo
252acfe8e7 Merge commit '3d51e57cfb'
Conflicts:
	libguile/foreign.c
	libguile/hashtab.c
	module/ice-9/psyntax-pp.scm
	module/language/tree-il/compile-glil.scm
2012-01-30 18:52:46 +01:00
Andy Wingo
855db1905d Merge commit '9b0975f1dc'
Conflicts:
	libguile/foreign.c
	module/ice-9/psyntax-pp.scm
	module/ice-9/psyntax.scm
2012-01-30 18:25:07 +01:00
Andy Wingo
f9685f4373 globally unique marks and labels using syntax-session-id
* libguile/macros.c (scm_init_macros): Add definition of new
  syntax-session-id helper.

* module/ice-9/psyntax.scm: Capture a reference to syntax-session-id at
  boot time.  Uniquify marks and labels using the session id.

* module/ice-9/boot-9.scm: Shunt syntax-session-id off to (system
  syntax) once we finished booting.

* module/ice-9/compile-psyntax.scm: Override syntax-session-id when
  remaking psyntax to avoid spurious diffs.

* module/ice-9/psyntax-pp.scm: Regenerate.
2012-01-26 12:08:58 +01:00
Andy Wingo
68fcf71189 new syntax procedures to (system syntax)
* module/ice-9/boot-9.scm:
* module/ice-9/psyntax.scm (syntax-module, syntax-local-binding)
  (syntax-locally-bound-identifiers): After boot, move these definitions
  to a new (system syntax) module.

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

* doc/ref/api-macros.texi: Add some words about syntax-module and
  friends being in (system syntax).
2012-01-25 21:31:20 +01:00
Andy Wingo
1ace4fbf3d add syntax-module
* module/ice-9/psyntax.scm (syntax-module): New accessor for syntax
  objects.
* module/ice-9/psyntax-pp.scm: Regenerate.

* module/ice-9/boot-9.scm: Declare syntax-module.

* doc/ref/api-macros.texi: Document it.
2012-01-25 20:34:17 +01:00
Andy Wingo
3d51e57cfb add syntax-locally-bound-identifiers
* module/ice-9/boot-9.scm (syntax-locally-bound-identifiers): Declare
  variable.
* module/ice-9/psyntax.scm: Add locally-bound-identifiers helper, and
  define syntax-locally-bound-identifiers.
* module/ice-9/psyntax-pp.scm: Regenerated.
* doc/ref/api-macros.texi: Document the new procedure.
2012-01-25 20:34:16 +01:00
Andy Wingo
21ad60a1d2 current-filename canonicalizes path, remove add-to-path
* module/ice-9/boot-9.scm (current-filename): Canonicalize the path, so
  that the result is independent of the current directory, and so
  that `dirname' can traverse up the file system, as in the
  add-to-load-path example.
  (add-to-path): Remove.  The eval-when semantics make this macro too
  tricky to explain -- people will start using it on other path-like
  things, in lexical contours, whereas it only really makes sense with
  load-like paths at the toplevel.

* doc/ref/api-evaluation.texi (Loading): Fix link to load-with-path
  docs, and remove add-to-path docs.
2012-01-23 11:13:12 +01:00
Andy Wingo
925172cf52 add current-filename, add-to-path, add-to-load-path
* module/ice-9/boot-9.scm (current-filename, add-to-path)
  (add-to-load-path): New syntaxen.

* doc/ref/api-evaluation.texi (Loading): Move load-path related
  procedures to a new section:
  (Load Paths): Hither.  Document add-to-path and add-to-load-path.

* doc/ref/api-debug.texi (Source Properties): Document
  current-source-location and current-filename.

* doc/ref/api-modules.texi:
* doc/ref/guile-invoke.texi:
* doc/ref/scheme-using.texi: Update @ref for Load Paths change.
2012-01-21 00:08:17 +01:00
Andy Wingo
9accf3d98f add when, unless
* module/ice-9/boot-9.scm (when, unless): New forms.

* doc/ref/api-control.texi (Conditionals): Add docs.  Rename this
  node from "if cond case".

* doc/ref/r6rs.texi:
* doc/ref/scheme-ideas.texi:
* doc/ref/srfi-modules.texi: Update referrers.
2012-01-20 19:51:45 +01:00
Andy Wingo
9b0975f1dc add syntax-local-binding
* module/ice-9/boot-9.scm (syntax-local-binding): New binding.

* module/ice-9/psyntax.scm: Locally define a fluid that holds the
  "transformer environment".  with-transformer-environment calls a
  procedure with the transformer environment, or raises an error if
  called outside the extent of a transformer.  Bind
  transformer-environment in expand-macro.
  (resolve-identifier): Backport this helper from master.
  (syntax-local-binding): New procedure to return binding information of
  a bound identifier (a lexical, macro, a pattern variable, a displaced
  lexical, a global, or some other form).

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

* doc/ref/api-macros.texi (Syntax Transformer Helpers): Add docs for
  syntax-local-binding, and syntax-source, and move some other
  descriptions to this new section.
2012-01-19 12:38:27 +01:00
Chris K. Jester-Young
222056dcf2 Call scm-error with the correct argument order.
* module/ice-9/boot-9.scm (catch, with-throw-handler): Switch the order
  of the error key and function name arguments.
2012-01-15 12:36:46 -05:00
Andy Wingo
91ee7515da Merge remote-tracking branch 'origin/stable-2.0'
Conflicts:
	libguile/__scm.h
	libguile/array-map.c
	libguile/procprop.c
	libguile/tags.h
	module/ice-9/deprecated.scm
	module/ice-9/psyntax-pp.scm
	module/ice-9/psyntax.scm
	test-suite/standalone/test-num2integral.c
	test-suite/tests/regexp.test
2012-01-10 00:41:42 +01:00
Andy Wingo
449bf60b81 deprecate fluid-let-syntax in favor of syntax-parameterize
* module/ice-9/psyntax.scm (syntax-parameterize): Rename from
  fluid-let-syntax.

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

* module/ice-9/boot-9.scm (define-inlinable): Use syntax-parameterize
  (and define-syntax-parameter).

* module/ice-9/deprecated.scm (fluid-let-syntax): Add deprecated shim.
2012-01-06 19:36:58 +01:00
Ludovic Courtès
b3da54d181 Placate a number of `syntax-check' verifications.
- "filesystem" -> "file system"
  - remove doubled words
  - use EXIT_* macros instead of literal numbers
  - update `syntax-check' exclusion files
2012-01-05 23:38:10 +01:00
Andy Wingo
bfe35b90ff Merge remote-tracking branch 'origin/stable-2.0'
Conflicts:
	configure.ac
2011-12-13 10:20:44 +01:00
Andy Wingo
9670f238d4 current-input-port et al are srfi-39 parameters
* libguile/ports.c (scm_init_ports): Export the port fluids to Scheme,
  temporarily.

* module/ice-9/boot-9.scm (fluid->parameter): Turn `current-input-port'
  et al into srfi-39 parameters, backed by the exported fluids, then
  remove the fluids from the guile module.
  (%cond-expand-features): Add srfi-39.

* module/srfi/srfi-39.scm: Re-export features from boot-9.

* test-suite/tests/parameters.test: Add tests.
2011-12-10 21:37:19 +01:00
Ludovic Courtès
e7b2efd582 Add an exception printer for `getaddrinfo-error'.
* module/ice-9/boot-9.scm (getaddrinfo-error-printer): New procedure.
  Use it as the `getaddrinfo-error' exception printer.
2011-12-06 21:43:12 +01:00
Andy Wingo
04ec290f8b Merge remote-tracking branch 'origin/stable-2.0'
Conflicts:
	libguile/deprecation.c
	libguile/load.c
	libguile/print.c
2011-12-06 19:14:50 +01:00
Andy Wingo
2c27dd57c7 warnings written to warning port
* libguile/deprecation.c (scm_c_issue_deprecation_warning):
* libguile/load.c (auto_compile_catch_handler):
  (scm_sys_warn_auto_compilation_enabled, scm_primitive_load_path):
* module/ice-9/boot-9.scm (warn, %load-announce, duplicate-handlers)
  (load-in-vicinity):
* module/system/base/message.scm (warning): Write to the warning port.
  (*current-warning-port*): Alias the warning port.
2011-12-05 18:11:24 +01:00
Andy Wingo
3972de7675 add current-warning-port
* libguile/ports.h:
* libguile/ports.c (scm_current_warning_port)
  (scm_set_current_warning_port): New functions, wrapping the Scheme
  parameter.

* module/ice-9/boot-9.scm (current-warning-port): New parameter,
  defining a port for warnings.
2011-12-05 18:07:06 +01:00
Andy Wingo
13dd74c8ea setting a parameter returns the previous value
* module/ice-9/boot-9.scm (make-parameter): Setting a parameter by
  invoking it with an argument now returns the previous value.
2011-12-05 17:49:26 +01:00
Andy Wingo
90de5c4c2e add srfi-39 parameters to boot-9
* module/ice-9/boot-9.scm (<parameter>, make-parameter, parameter?)
  (parameter-fluid, parameter-converter, parameterize): New top-level
  bindings, implementing SRFI-39 parameters.  Currently,
  current-input-port and similar procedures are not yet parameters.

* test-suite/Makefile.am:
* test-suite/tests/parameters.test: Add tests, taken from srfi-39
  tests.
2011-12-05 14:25:25 +01:00
Andy Wingo
b2208d2e98 Merge remote-tracking branch 'origin/stable-2.0'
Conflicts:
	configure.ac
	libguile/fluids.c
	libguile/gc.c
	libguile/gc.h
	libguile/objcodes.c
	libguile/procprop.c
	libguile/vm.c
	module/ice-9/psyntax-pp.scm
	module/ice-9/psyntax.scm
2011-12-01 23:31:50 +01:00
Andy Wingo
f7bbc75d04 record-type-vtable is not a new root of the vtable hierarchy
* module/ice-9/boot-9.scm (record-type-vtable): Simplify to use
  make-vtable instead of make-vtable-vtable.
2011-11-24 11:47:36 +01:00
Andy Wingo
9447207f0c Use default value for make-fluid in Scheme files
* module/ice-9/boot-9.scm (%exception-handler)
  (%running-exception-handlers, read-eval?, *repl-stack*)
  (make-mutable-parameter):
* module/ice-9/getopt-long.scm (%program-name):
* module/language/elisp/runtime.scm (built-in-macro, defspecial):
* module/srfi/srfi-39.scm (make-parameter/helper):
* module/system/base/language.scm (*current-language*):
* module/system/base/message.scm (*current-warning-port*):
  (*current-warning-prefix*):
* module/system/base/target.scm (%target-type, %target-endianness)
  (%target-word-size):
* module/texinfo/plain-text.scm (*indent*, *itemizer*):
* benchmark-suite/lib.scm (prefix-fluid):
* test-suite/lib.scm (prefix-fluid): Give fluids a useful default
  value.
2011-11-23 12:54:09 +01:00
Andy Wingo
dceb78294d hack the port-column of current-output-port after printing a prompt
* module/ice-9/boot-9.scm (repl-reader): Reset the output-column to 0
  after printing the prompt.  Fixes bug 9664.
2011-11-16 23:13:55 +01:00
Andy Wingo
49689a3f2d fix scope bug in <module> definition in boot-9
* module/ice-9/boot-9.scm (define-record-type): Fix scope bug when
  generating identifiers.
2011-11-07 11:45:15 +01:00
Andy Wingo
ea3ca4e4d0 syntax-parameterize, not fluid-let-syntax
* module/ice-9/psyntax.scm (syntax-parameterize): Rename from
  fluid-let-syntax.

* module/ice-9/boot-9.scm (define-inlinable): Use syntax-parameterize
  (and define-syntax-parameter).
2011-11-07 11:38:47 +01:00
Andy Wingo
f698b7286f minor psyntax refactors
* module/ice-9/psyntax.scm (syntax-type): Remove redundant lexical
  case.
  (syntax-rules, define-syntax-rule): Use `_' instead of `dummy' for the
  keyword.

* module/ice-9/boot-9.scm (define-syntax-rule): Remove redundant
  definition.
2011-11-04 14:12:35 +01:00
Andy Wingo
633f3a18b7 remove mutex in make-object-property
* module/ice-9/boot-9.scm (make-object-property): Remove the mutex; weak
  tables are now threadsafe.
2011-10-24 12:54:22 +02:00
Andy Wingo
ca12824581 Merge remote-tracking branch 'origin/stable-2.0'
This was a pretty big merge involving a fair amount of porting,
especially to peval and its tests.  I did not update psyntax-pp.scm,
that comes in the next commit.

Conflicts:
	module/ice-9/boot-9.scm
	module/ice-9/psyntax-pp.scm
	module/language/ecmascript/compile-tree-il.scm
	module/language/tree-il.scm
	module/language/tree-il/analyze.scm
	module/language/tree-il/inline.scm
	test-suite/tests/tree-il.test
2011-09-29 18:02:28 +02:00
Andy Wingo
0c65f52c6d more define-syntax-rule usage
* module/ice-9/boot-9.scm:
* module/ice-9/control.scm:
* module/ice-9/futures.scm:
* module/ice-9/optargs.scm:
* module/ice-9/poll.scm:
* module/ice-9/receive.scm:
* module/ice-9/threads.scm:
* module/ice-9/vlist.scm:
* module/language/assembly/compile-bytecode.scm:
* module/language/ecmascript/compile-tree-il.scm:
* module/language/tree-il.scm:
* module/oop/goops.scm:
* module/oop/goops/simple.scm:
* module/oop/goops/stklos.scm:
* module/srfi/srfi-1.scm:
* module/srfi/srfi-35.scm:
* module/srfi/srfi-39.scm:
* module/srfi/srfi-45.scm:
* module/srfi/srfi-67/compare.scm:
* module/sxml/match.scm:
* module/system/repl/error-handling.scm:
* module/system/repl/repl.scm:
* module/system/vm/inspect.scm:
* module/texinfo.scm:
* module/web/server.scm: Use define-syntax-rule, where it makes sense.
2011-09-02 11:36:14 +02:00
Andy Wingo
8b66aa8f54 Merge remote-tracking branch 'origin/stable-2.0'
Conflicts:
	libguile/bytevectors.c
	libguile/bytevectors.h
	libguile/objcodes.c
	libguile/r6rs-ports.c
	libguile/strings.c
	libguile/vm.c
2011-08-31 09:34:54 +02:00
Andy Wingo
6b1c5d9d67 fix order of importing modules and resolving duplicates handlers
* module/ice-9/boot-9.scm (define-module*): Resolve duplicates handlers
  only after importing modules.  Fixes a bug in which a module with
  #:use-module (oop goops) but whose merge-generics handler got resolved
  to noop instead of the real merge-generics handler.  I can't think of
  an easy way to test this, though.

  Thanks to David Pirotte for the report!
2011-08-18 12:56:14 +02:00
Andy Wingo
2844ab8564 fix recursive define-inlinable expansions
* module/ice-9/boot-9.scm (define-inlinable): Prevent expansion from
  diverging by using fluid-let-syntax, as Dybvig suggests.
2011-08-17 22:35:24 +02:00