1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-01 04:10:18 +02:00
Commit graph

15149 commits

Author SHA1 Message Date
Andy Wingo
fb031aba42 fix a couple of leaks
* libguile/bytevectors.h:
* libguile/bytevectors.c (scm_c_take_gc_bytevector): Rename this
  internal function, from scm_c_take_bytevector.  This indicates that
  unlike the other scm_take_* functions, this one takes GC-managed
  memory.

* libguile/objcodes.c (scm_objcode_to_bytecode):
* libguile/vm.c (really_make_boot_program): Use
  scm_gc_malloc_pointerless, not scm_malloc.  Thanks to Stefan
  Israelsson Tampe!

* libguile/r6rs-ports.c:
* libguile/strings.c: Adapt to renames.
2011-08-18 12:53:28 +02:00
Andy Wingo
5261e74281 reword open-file docs
* doc/ref/api-io.texi (File Ports): Refactor open-file docs.  Thanks to
  Bake Timmons for the report.
2011-08-18 11:13:34 +02:00
Andy Wingo
81bda963e9 fix scm_tmpfile leak
* libguile/posix.c (scm_tmpfile): Fix to actually close the new
  tmpfile, causing its deletion, while keeping an fd to the file open.
  Fixes a leak both in memory and disk space on POSIX systems; MINGW
  systems will leak however.  A FIXME for later.
2011-08-17 23:54:58 +02:00
Andy Wingo
b8f191964e fix r6rs `map'
* module/rnrs/base.scm (map): Define a version of map that is safe for
  multiple returns, though slower.
2011-08-17 23:24:20 +02:00
Andy Wingo
6ffb5f9765 check that srfi-1 procedure arguments are procedures
* module/srfi/srfi-1.scm (check-arg, wrong-type-arg): Refactor arg type
  checkers to be macros, and do the minimal amount of work in the
  functions themselves.  Use these checkers consistently for all
  procedure arguments in this module.  This catches user errors early;
  see bug 33628.
2011-08-17 23:09:39 +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
Andy Wingo
8761623524 srfi-9 record compatibility with boot-9 records
* module/srfi/srfi-9.scm (define-record-type): Instead of defining the
  RTD using make-vtable, use make-struct with the record-type-vtable,
  and record the type name and fields names in the vtable.  This way
  SRFI-9 records are compatible with boot-9 records.  Also we use a
  generic printer, instead of generating one anew.
2011-08-17 10:47:04 +02:00
Andy Wingo
42f9581238 fix leak in get_current_locale()
* libguile/i18n.c (get_current_locale): Hold the locale name in a
  GC-managed string, not a mallocated string.  Thanks to Stefan
  Israelsson Tampe for the report.
2011-08-16 13:16:21 +02:00
Andy Wingo
e7a81c7acd fix take-right and drop-right for improper lists
* libguile/srfi-1.h:
* libguile/srfi-1.c (scm_srfi1_drop_right, scm_srfi1_take_right): Remove
  these internal functions, replacing with Scheme implementations.

* module/srfi/srfi-1.scm (take-right, drop-right): Add these impls from
  the reference code.  They do the right thing for improper lists,
  according to the spec, but they diverge for circular lists.  Oh well.

* test-suite/tests/srfi-1.test ("drop-right", "take-right"): Add more
  tests.
2011-08-12 23:26:15 +02:00
Andy Wingo
335c8a89a2 fix tree-il->scheme test
* module/language/tree-il.scm (tree-il->scheme): Fix incorporation of
  `lambda' in a `case-lambda'.

* test-suite/tests/tree-il.test ("tree-il->scheme"): Add a test.
2011-08-04 19:23:49 +02:00
Andy Wingo
2b582a285a (web http): locale-independent parsing and serialization of dates
* module/web/http.scm (parse-month, parse-rfc-822-date):
  (parse-rfc-850-date, parse-asctime-date, parse-date):
  (write-date): Parse and write dates without regard to the current
  locale, using a custom parser.  Also permits parsing of the deprecated
  RFC 850 and asctime() date formats.
2011-08-04 15:07:27 +02:00
Andy Wingo
abab34ce4d srfi-19 refactor
* module/srfi/srfi-19.scm (priv:locale-number-separator, priv:locale-am)
  (priv:locale-am): Inline definitions.

  Strip priv: prefix from module vars, as it's unnecessary, except for
  in a couple cases.
2011-08-04 12:53:07 +02:00
Andy Wingo
a6e1e05094 avoid duplicate stats when searching for files in a path
* libguile/load.c (search_path): Extract from scm_search_path, to
  give the caller the stat buffer of the found path.
  (scm_search_path, scm_sys_search_load_path): Adapt accordingly.
  (compiled_is_fresh): Take the stat buffers directly.
  (scm_primitive_load_path, scm_init_eval_in_scheme): Adapt to
  search_path / compiled_is_fresh changes to avoid duplicate states in
  search-path.
2011-08-03 12:43:29 +02:00
Andy Wingo
e4f6e855b6 fix unnecessary call to canonicalize_path in load-path fast case
* libguile/load.c (scm_primitive_load_path): Don't canonicalize the
  filename unless we need to look in the fallback path.  Fixes a stat
  explosion; see http://savannah.gnu.org/bugs/?33815.
2011-08-03 11:46:56 +02:00
Andy Wingo
0f75cc7809 simplify narrow_stack.
* libguile/stacks.c (narrow_stack): Simplify outer narrowing by a number
  of frames.  Thanks to
  http://article.gmane.org/gmane.lisp.guile.devel/12685.
2011-07-29 09:17:47 +02:00
Andy Wingo
89f886122a style fix in read.c
* libguile/read.c (scm_read_sexp): No need to assign to tmp here.
2011-07-29 09:14:04 +02:00
Andy Wingo
3b08b1c24d minor style fix in bytevectors.c
* libguile/bytevectors.c (SCM_BYTEVECTOR_HEADER_BYTES): Use sizeof
  scm_t_bits, not sizeof SCM.  It's the same, but it seems like the
  right thing.
2011-07-29 09:11:24 +02:00
Andy Wingo
2700aa43f2 fix a leak on startup from script.c
* libguile/script.c (scm_get_meta_args): Free nargv.  Thanks to
  http://article.gmane.org/gmane.lisp.guile.devel/12685.  We leak narg
  though.
2011-07-29 09:10:37 +02:00
Andy Wingo
7c888dfa6e fix read beyond end of hashtable size array in hashtab.c
* libguile/hashtab.c (make_hash_table): Fix read beyond end of
  hashtable_size array.  Thanks to
  http://article.gmane.org/gmane.lisp.guile.devel/12685.
2011-07-28 19:07:53 +02:00
Andy Wingo
eff3dd99f7 fix write beyond array end in arrays.c
* libguile/arrays.c (scm_i_read_array): Fix write past end of array
  while reading array type tag.  Fix non-ascii type tag elements.
  Thanks to http://article.gmane.org/gmane.lisp.guile.devel/12685.
2011-07-28 19:04:38 +02:00
Andy Wingo
2b14df4bc7 fix list validation bug in @abort
* libguile/control.c (scm_at_abort): Fix to ensure that we store the
  return of scm_ilength in a signed integer, even if later we copy it to
  an unsigned.  See
  http://article.gmane.org/gmane.lisp.guile.devel/12685.
2011-07-28 18:17:45 +02:00
Andy Wingo
bd61f2e64f remove dead code in scm_ceiling_quotient
* libguile/numbers.c (scm_ceiling_quotient): Remove dead code.  See
  http://article.gmane.org/gmane.lisp.guile.devel/12685.
2011-07-28 17:59:56 +02:00
Andy Wingo
74ec8d786f fix scm_i_tag_name
* libguile/gc.c (scm_i_tag_name): Fix to work as intended, though it was
  not called.  See http://article.gmane.org/gmane.lisp.guile.devel/12685.
2011-07-28 17:52:29 +02:00
Andy Wingo
02620dd9a6 export <macro> from goops, to appease texinfo reflection
* module/oop/goops.scm (<macro>): Actually define this class.  Also,
  group the export with the other SMOB types.
2011-07-26 11:48:37 +02:00
Andy Wingo
ab4bc85398 Merge remote-tracking branch 'origin/stable-2.0'
Conflicts:
	GUILE-VERSION
	test-suite/tests/srfi-4.test
2011-07-25 18:26:37 +02:00
Andy Wingo
f29c300507 fix GC_get_suspend_signal on Mac OS
* libguile/scmsigs.c (GC_get_suspend_signal): Fix the back-compatibility
  shim for this function to work on some other cases; I hadn't realized
  that gcconfig.h could set SIG_SUSPEND.  Thanks to Aleix Conchillo
  Flaqué for the report.
2011-07-25 18:25:14 +02:00
Ludovic Courtès
f4b7d918ef guild: Close over `$bindir/guile'.
* configure.ac: Substitute `guile_program_name'.

* meta/guild.in: Use `@bindir@/@guile_program_name@' by default.

* meta/uninstalled-env.in: Define $GUILE.
2011-07-23 22:43:38 +02:00
Ludovic Courtès
0d2e3fc1e7 Change guild --help' and --version' output to be more GNUish.
* meta/guild.in (display-version): Display the version, not the
  effective version.

* module/scripts/help.scm (list-commands)[help]: Add proper footer, as
  per the GCS.
2011-07-23 22:43:38 +02:00
Ludovic Courtès
8698e81007 doc: Remove redundant footnote about the former name of `guild'.
* doc/ref/scheme-using.texi (Using Guile Tools): Remove redundant
  footnote introduced in e108c961fe.
  Mention the version where the new name was introduced.
2011-07-23 22:43:38 +02:00
Ludovic Courtès
3cf634fa7c Export `main' from (scripts help).
* module/scripts/help.scm: Export `main'.
2011-07-23 22:43:36 +02:00
Andy Wingo
4f0ea6e3ce add support for guild help FOO
* module/scripts/help.scm (main): Add support for guild help FOO.
2011-07-23 18:50:22 +02:00
Andy Wingo
f4a76a315a add (scripts help)
* meta/guild.in (display-version): Use (ice-9 command-line)'s
  version-etc.
  (main): Dispatch --help to guild help.

* module/scripts/help.scm: New file, a copy of list.scm, but with a
  better name.

* module/Makefile.am: Add help.scm to the list.

* module/scripts/list.scm: Change to be an alias to "help".
  (list-scripts): Restore this API.
2011-07-23 18:24:16 +02:00
Andy Wingo
a1a2ed5342 more work on "guild list"
* module/scripts/: Add %summary entries, and in many cases,
  %include-in-guild-list entries to inhibit a script from appearing in
  "guild list".  Update list.scm to respect this new variable.
2011-07-23 17:50:41 +02:00
Andy Wingo
d322dc92ec remove scripts PROGRAM
* module/scripts/PROGRAM.scm: Remove this useless template, which was
  cluttering `guild list'.  We'll perhaps cull the list a bit more in
  2.2.

* module/Makefile.am: Adapt.
2011-07-23 13:54:28 +02:00
Andy Wingo
5d48015adf a prettier `guild list'
* module/scripts/list.scm (strip-extensions): Don't list programs
  without extensions.
  (main): Be prettier.  Parse out a %summary from modules, for a brief
  synopsis.
2011-07-23 13:52:51 +02:00
Andy Wingo
9957641b60 add a site dir to %load-compiled-path
* libguile/Makefile.am (libpath.h): Define SCM_SITE_CCACHE_DIR.  Defined
  as site-ccache/ instead of site/ccache/ to indicate that we don't expect
  further subdirectories, and also to avoid confusion about whether
  extensions/ is a site-specific or not.

* libguile/load.c (scm_init_load_path): Add SCM_SITE_CCACHE_DIR to the
  default load-compiled path.
2011-07-21 10:36:13 +02:00
Andy Wingo
072624134b open-socket-for-url returns port in latin1 encoding
* module/web/client.scm (open-socket-for-uri): Set port encoding to
  latin1, to see if this fixes Nalin Garut's problems.
2011-07-21 09:42:20 +02:00
Andy Wingo
ecfb148137 fix web-request.test
* test-suite/tests/web-request.test ("example-1"): Fix expected format
  of `host' header.
2011-07-18 10:37:46 +02:00
Andy Wingo
037a680321 ensure presence of Host header in HTTP/1.1 requests
* module/web/request.scm (build-request): Make sure that HTTP/1.1
  requests have the Host header set, per RFC 2616 section 9.

* test-suite/tests/web-request.test ("example-1"): Add test.
2011-07-15 13:36:52 +02:00
Andy Wingo
680c8c5a99 add (web client)
* module/web/client.scm: New module, a simple synchronous web client.

* module/Makefile.am (WEB_SOURCES): Add to the build.
2011-07-15 13:36:47 +02:00
Ludovic Courtès
126a322431 Fix `open' mode bits on GNU/Hurd.
* libguile/filesys.c (scm_open): Fix check for read-write flags for
  systems such as GNU/Hurd, where O_RDWR == (O_WRONLY | O_RDONLY)
  and O_RDONLY != 0.
2011-07-13 00:02:00 +02:00
Ludovic Courtès
3565df4546 Define `O_NOTRANS' on GNU/Hurd.
* libguile/filesys.c (scm_init_filesys): Define `O_NOTRANS' when
  available.
2011-07-13 00:02:00 +02:00
Ludovic Courtès
1fe9920adc Disable TLS on NetBSD up to 5.x included.
* acinclude.m4 (GUILE_THREAD_LOCAL_STORAGE): Disable TLS on
  `x86_64-unknown-netbsd5.1' too.
2011-07-13 00:02:00 +02:00
Ludovic Courtès
2a8b3b8050 Add document describing the release process.
* doc/release.org: New file.
2011-07-13 00:02:00 +02:00
Andy Wingo
ae88d9bcf6 fix CPL of <extended-generic-with-setter> and <extended-accessor>
* libguile/goops.c (fix_cpl): Fix bug in placement of debug assertion.
  (create_standard_classes): Put <extended-generic> before
  <generic-with-setter> in <extended-generic-with-setter>'s direct
  supers, so that the slot allocation is a superset of
  <generic-with-setter>, which results in the `setter' being allocated
  in the same place.

  Likewise fix <extended-accessor> to place <extended-generic> before
  <generic-with-setter>, not just <generic>.
2011-07-07 13:02:59 +02:00
Andy Wingo
319dd08936 fix invocation of duplicate handlers for merge-generics
* libguile/modules.c (resolve_duplicate_binding): Fix unbound -> #f
  conversion for the imported bindings.  Pass the existing entry in the
  import obarray as the resolved var (7th arg), and properly pass #f as
  the value (8th arg) if there is no such binding.  Fixes
  merge-generics; before, the <boolean> type test (indicating no
  previous value) was not being triggered.  This bug has been present
  since 2007 at least, though it was not in 1.8.

* test-suite/tests/modules.test ("duplicate bindings"): Add a test that
  the var and val are both #f.  These types are used by GOOPS.
2011-07-07 13:02:45 +02:00
Andy Wingo
a8c10aa131 goops.scm cleanups
* module/oop/goops.scm (make-generic, make-extended-generic):
  (ensure-generic, make-accessor, ensure-accessor): Use optional
  arguments for #:name.  `make-extended-generic' also accepts empty
  extension lists.
2011-07-07 12:17:08 +02:00
Andy Wingo
c1e3e9aaff more precision for ,time
* module/system/repl/command.scm (time): Use the high-precision timers
  instead of stime(2).  Changes the output format of `,time' too;
  perhaps there is a better way.
2011-07-07 09:57:19 +02:00
Ludovic Courtès
86e449a699 Fix typo in (language tree-il spec).
* module/language/tree-il/spec.scm (join): Use EXPS in the error case.
2011-07-07 00:57:58 +02:00
Ludovic Courtès
f67f85817c Export `<macro>' from (oop goops).
* module/oop/goops.scm: Export `<macro>'.
2011-07-07 00:57:19 +02:00