mit-scheme.git
13 years agoAdded SWAT emulation, just sufficient to run Pole Zero.
Matt Birkholz [Sun, 12 Dec 2010 23:34:18 +0000 (16:34 -0700)]
Added SWAT emulation, just sufficient to run Pole Zero.

Changed scm-layout from an integer-based layout to a fixnum-based
layout called fix-layout.  Added a "fix-" prefix to everything that
should be using fixnums.  Thus there are many name changes:

    scm-layout -> fix-layout
       drawing -> fix-drawing
  rect -> fix-rect
    drawn-item -> fix-ink

I could not resist the brevity of "ink".  "Item" is rather vague.

Changes not otherwise mentioned below:

    Took care not to define-integrable when parameters are referenced
    multiple times.  Used integrate-operator instead.

    Used guarantee-TYPE procedures rather than check-TYPE converters.

    Punted :: for combining type and method names.  A hyphen will do.

    Used the new ignore declaration.

    Punted package initialization declarations in gtk.pkg.  Added
    `(initialize-package!)' forms at the ends of files as necessary.

    Followed the MAKE- convention to name procedures that create demos
    or examples.

    Signal callbacks now rely on their first parameter, the weakly
    held instance, rather than capture it in their closures.  The
    first argument used to be the toolkit object's address.

* doc/gtk/gtk.texinfo: Incremented the minor VERSION.  Moved many
implementation notes to a new Implementation Notes node.  Condensed
the chapters about each example into subsections of the Introduction.
Added a subsection about the SWAT emulation.  Added an Installation
chapter/node.  Generally, re-wrote to the luser perspective.  Used the
packaging in gtk.pkg, esp. the lists of names exported to (gtk), to
form a complete, if terse, API Reference.  Pulled some luser
documentation out of the Scheme code.

* src/Makefile.in: Added ffi to the LIARC_BOOT_BUNDLES so that gtk can
be compiled during LiarC's bootstrap.

* src/README.txt: Moved gtk to the "miscellaneous extras".

* src/Setup.sh: Added sos to lib/.

* src/configure.ac: Made $with_gtk tri-valued: yes, no, auto.  It
defaults to "auto".  Moved pkg-config check to src/microcode/
achost.ac.  Added gtk to FFIS.

* src/cref/: object.scm, redpkg.scm: Added support for declare forms
at top-level in .pkg files, and depends-on forms in package
descriptions.  Added corresponding slots to the package, package-
description, and pmodel structures.  A depends-on form lists files (by
default: .ext files) that should be generated before the package is
syntaxed.  The top-level declare(s) are applied to all files.

* src/etc/compile.scm: Worked on LiarC support, moving the ffi to the
list of boot dirs.  Added a compile-ffi procedure for the build target
of FFI Makefiles like src/gtk/Makefile-fragment.

* src/etc/functions.sh (maybe_rm): Do not skip symlinks.
src/config.sub and src/config.guess were not getting cleaned up.  Add
them to FILES so they will be removed.

* src/gtk/: .gitignore, Clean.sh, Makefile-fragment: Added the
swat-pole-zero.scm symlink.

* src/gtk/Makefile-fragment: Use the compile-ffi procedure from
src/etc/compile.scm to compile the Gtk system.  Use the host
MIT_SCHEME_EXE to generate the shim.  Added a new liarc-build target
that compiles the gtk bundle.

* src/gtk/Includes/: Many useful declarations.

* src/gtk/demo.scm: Renamed "fix-demo.scm".

* src/gtk/ed-ffi.scm: Catch up changes to file packaging.

* src/gtk/fix-demo.scm: Was "demo.scm".  Added a spinning arc-ink.

* src/gtk/fix-layout.scm: Was "scm-layout.scm".  Many drawn-items were
re-implemented as draw-inks.

* src/gtk/gobject.scm: Added gobject-live?, gobject-unref!,
gdk-window-process-updates guarantee-gdk-window.  Arrange for signal
callbacks to hold their instances weakly.  Add-gc-cleanup now returns
the weak-pair it is using, so it can be reused by g-signal-connect.
Banish ferror; error will do.

* src/gtk/gtk-ev.scm: Init a ScmWidget's requisition member; it no
longer has a size-request method to do it.  Use the new bit?
procedure to test bits in bit masks.  Punted the second trace level.
Moved initialization out of make- procedure and into an
initialize-instance method.

* src/gtk/gtk-new.pkg: A temporary copy of gtk.pkg with the new
declare and depends-on expressions.

* src/gtk/gtk-object.scm: Added many new procedures and classes:
gtk-widget-realized?, gtk-widget-get-colormap, gtk-widget-show,
gtk-widget-connect-realize, gtk-bin-child, gtk-container-remove,
gtk-label-set-width-chars, <gtk-check-button>, <gtk-frame>,
gtk-window-set-opacity.  Use the new bit? predicate.

Added a set-gtk-object-destroy-callback! procedure for the convenience
of gtk-object initialize-instance methods, for lack of "after" method
combination.

Take care when setting a style's font: copy the new
PangoFontDescription and free the old one.

Made gtk-widget-get-colormap and set-gtk-widget-bg-color! generic
procedures so that fix-layout can override them.

Noted that a gtk-container keeps its children in reverse order.
Centralized maintenance of the list.  Operate on it atomically --
without-interrupts for now.

Moved gtk-object initialization from make- procedures to
initialize-instance methods for many widget types, so they can be
subclassed.

* src/gtk/gtk-shim.h: Punted the only method and all of the method
callback ids.  The ScmWidget methods are now implemented by signal
callbacks.

* src/gtk/gtk.cdecl: Punted the widget method callbacks and added the
corresponding signal callbacks.  Added several other new C function
and callback declarations.  Moved some to a new
Includes/gtklabel.cdecl.

* src/gtk/gtk.pkg: Moved package (gtk pango) to earlier in the build.
Eliminated initialization declarations.  Added new packages (gtk
swat), (swat) and (swat pole-zero), and many new bindings.

* src/gtk/gtk.scm: Gathered new syntax and fix: definitions for
system-wide use, expecting this file to be loaded at syntax as well as
load time.  Added new bit-mask operators: bit-mask, bit-mask-indices,
and bit?.  Moved the rect- procedures to fix-layout.scm.  Replaced
check-!null with error-if-null.  Punted ferror and fwarn.  Moved Pango
hacks to pango.scm.

* src/gtk/gtk.sf: Use the new sf-package-set procedure, eliminating
60+ lines largely redundant to the info in gtk.pkg.

* src/gtk/hello.scm: Added an instance parameter to each callback.

* src/gtk/keys.scm: Use the new bit? predicate.  Moved documentation
to gtk.texinfo.

* src/gtk/main.scm: Appended call to initialize-package!.

* src/gtk/make.scm: Incremented the Gtk subsystem's minor version number.

* src/gtk/pango-cairo.scm: Punted until real Cairo support is added.

* src/gtk/pango.scm: Added more argument checking, and a
pango-layout-set-font-description procedure.  Collected other
Pango-related procedures, e.g. from gtk.scm.  Moved luser
documentation to gtk.texinfo.

* src/gtk/scm-layout.scm: Renamed "fix-layout.scm".

* src/gtk/scm-widget.scm: Use g_object_ref_sink on a new ScmWidget.
Added set-scm-widget-set-scroll-adjustments-callback!.  Punt method
callbacks.  All methods are now implemented by signal callbacks.

* src/gtk/scmwidget.c.stay: Override the realize method, which assumes
the widget has no window.  Add a set_scroll_adjustments signal.

* src/gtk/swat.scm: The new SWAT emulator.

* src/gtk/thread.scm: Just signal an error if there are no runnable
threads and no next-scheduled-timeout.

* src/microcode/achost.ac: Added the pkg-config check.  Conditionally
add prgtkio.so to MODULE_TARGETS.

* src/microcode/configure.ac: Removed redundant pkg-config check --
redundant now that it is in achost.ac.

* src/microcode/prgtkio.c: The "uxselect.h" header no longer exists.

* src/runtime/ffi.scm: Added guarantee-alien-function and
error:not-alien-function.  Fixed guarantee-alien to follow suit.
Added tracing to free-malloced-aliens.

* src/runtime/runtime.pkg: Added package (runtime thread-queue) and
guarantee-alien-function.

* src/runtime/thread-queue.scm: A queue that blocks threads.

* src/sf/: butils.scm, make.scm, sf.pkg: Added the sf-package-set
procedure, which uses CREF.

13 years agoAdded scm-layout event handlers and gdk-key support.
Matt Birkholz [Thu, 8 Jul 2010 22:06:07 +0000 (15:06 -0700)]
Added scm-layout event handlers and gdk-key support.

A more complete wrapping eliminates the need for c-includes in the
"Hello, World!" example and scm-layout demo.

* doc/gtk/gtk.texinfo: The FFI syntax is no longer used in hello.scm.

* src/gtk/Tags.sh: Fixed the exuberant ctags commandline to avoid
wiping out the Scheme file extensions list, thus punting *.scm.

* src/gtk/demo.scm: Use new callback and event wrappers.

* src/gtk/gtk-object.scm: Use integrate-operator where a parameter is
referenced multiple times.

(gtk-widget-font): Return a PangoFontDescription alien.

(set-gtk-button-clicked-callback!)
(set-gtk-window-delete-event-callback!): More wrapping, to get
C-callback syntax out of hello.scm and demo.scm.

* src/gtk/gtk.pkg: Added keys.scm.  Export new callback and event
wrappers to (gtk).

* src/gtk/gtk.sf: Added keys.scm.

* src/gtk/gtk-ev.scm: Punt impish delete_event callback from hello.

* src/gtk/hello.scm: Simplify.  Use new wrappers.

* src/gtk/keys.scm: New.

* src/gtk/scm-layout.scm: Punted null-alien in favor of 0.  Added an
"event-handlers" vector per widget.  Provide specific event handler
setters, which can translate from toolkit to Scheme constants, so the
provided handlers do not need C- syntax.

(scm-layout-event-handler): Handle expose events directly.  Lookup the
rest in the event-handlers vector.

13 years agoFor Edwin: gtk-widget-font, scm-layout-scroll-step, etc.
Matt Birkholz [Thu, 24 Jun 2010 18:26:26 +0000 (11:26 -0700)]
For Edwin: gtk-widget-font, scm-layout-scroll-step, etc.

* doc/gtk/gtk.texinfo: Followed the example of ffi.texinfo.  Added
VERSION.  Changed name from "Users'" to "Reference" Manual.  Clarified
how to run the examples.

* src/Makefile.in: Use @FFIS@ to init FFIS, allowing gtk to be built
conditionally.  Install lib/conses.png only when the Gtk interface is
built.

* src/Setup.sh: The lib/lib/prgtkio.so symlink is no longer needed.

* src/configure.ac: Added support for a --with-gtk option, to
conditionally include Gtk.  Added --enable-debugging, needed in
microcode/achost.ac.

* src/gtk/.gitignore: Make git ignore the gtk-shim build byproducts.

* src/gtk/Includes/, src/gtk/gtk.cdecl: Added and deleted various
declarations.

* src/gtk/demo.scm: Renamed the event handler "demo-event-handler".
Added a call to gtk-widget-grab-focus.

* src/gtk/ed-ffi.scm: Added pango.scm.

* src/gtk/gobject.scm: Added punt-gc-cleanup, for alien objects that
can be explicitly destroyed as well as GCed.  Allow for C-enum values
that do not fit in a fixnum.  Treat them as integers.

* src/gtk/gtk-object.scm: Defined and used gtk-object-flags, despite
their being deprecated.  Added peek-gtk-adjustment, for debugging.
Added gtk-widget-queue-draw, -get-pango-context, -create-pango-layout,
-set-size-request.

Added gtk-widget-font, -bg-color, -fg-color, -base-color, and
-text-color, and their setters, mostly from scm-layout.scm.

Added gtk-scrolled-window-set-policy and -set-placement.

Replace guarantee-gtk-window with check-gtk-window.  Use
error:wrong-type-argument in the check-TYPE procedures.

Fixed the C types peeked by gtk-window-get-default-size.

* src/gtk/gtk.pkg: Added several new exports, and a new (gtk pango)
package.  Moved color and font support from (gtk layout) to (gtk
gtk-object).

* src/gtk/gtk.scm: Added rect-union!.  Use integer operators on pixel
coordinates and sizes.  Moved most of the Pango code to the new
pango.scm file.

* src/gtk/gtk.sf: Suppress option loading noise.  Syntax each file in
its respective package, as its dependencies require.

* src/gtk/hello.scm: Quiet warnings.  Punt call to error; keeping it
simple.  This code appears in the manual.

* src/gtk/main.scm: Punt private copy of ucode-primitive syntax
transformer.

* src/gtk/pango.scm: New, implementing <pango-layout> as a <gobject>.

* src/gtk/scm-layout.scm: Created a second, "detailed" trace level.
Allow logical device coordinates and sizes to be integers, not just
fixnums.  Added set-scm-layout-scroll-step! and scm-layout-realized?.
Init on-screen-area to an un(der)defined rect.  Adjust scrollbars only
when realized and necessary.

Moved the color support to gtk-object.scm.  None of it depends on
scm-layout anymore -- just gtk-widget.  Re-worked the
_get_modifier_style,modify,_modify_style abstraction to accommodate
set-rcstyle-font!.

Combined common scrolling code from set-scm-layout-scroll-pos!,
scm-layout-adjustment-value-changed.

Allow drawing-add-item! to splice in an item just under/before
another, given item.

Keep drawn-item changes (damage old area, move, damage new area)
thread-atomic, else another thread can interfere.

* src/gtk/thread.scm (kill-gtk-thread): Send ONE thread event, and
clear gtk-thread first.

* src/microcode/configure.ac: Put prgtkio.so on MODULE_TARGETS, not
_BASES.  The latter does too much.

13 years agoRemoved $Id:$ tags.
Matt Birkholz [Sat, 5 Jun 2010 06:37:13 +0000 (23:37 -0700)]
Removed $Id:$ tags.

13 years agoMerge with 9.0.1+FFI.
Matt Birkholz [Sat, 5 Jun 2010 06:29:12 +0000 (23:29 -0700)]
Merge with 9.0.1+FFI.

* doc/gtk/Makefile.in: Set TEXINFO_ROOT.

* doc/gtk/gtk.texinfo: Fix name of shim, and example commandlines.

* src/gtk/Clean.sh: No need to delete conses.png.  Clean in ../lib,
not ../lib/lib/.

* src/gtk/Includes/gdkdrawable.cdecl: Punt reserved members.  There is
no need to account for all of them.  The groveler will use sizeof.

* src/gtk/Makefile-fragment: Punt the lib/lib stuff.  The shims do not
have to be in the same directory as the modules.  No need to produce
conses.png from conses.png.uu anymore.  Separate syntaxing and
compiling (and loading), in the .sf/.cbf/make way.

* src/gtk/Tags.sh: Bloody Exuberant Ctags compatibility.

* src/gtk/conses.png.uu, src/gtk/conses.png: Git can distribute
conses.png.

* src/gtk/: compile.scm, load.scm, gtk.sf, gtk.cbf, make.scm: Separate
syntaxing and compiling (and loading), in the .sf/.cbf/make way.

* src/microcode/configure.ac: Add prgtkio.so to new MODULE_BASES, not
MODULE_TARGETS.

* src/microcode/prgtkio.c: Re-styled -- mainly uncrushing the * operator.

* src/sf/sf.pkg, src/sf/butils.scm: Added sf-with-dependencies.

13 years agoSupport scm-layout colors: fg, bg, text and base.
Matt Birkholz [Thu, 30 Jul 2009 04:36:51 +0000 (21:36 -0700)]
Support scm-layout colors: fg, bg, text and base.

* doc/.gitignore, src/.gitignore, src/TAGS, src/gtk/ed-ffi.scm:

Added the Gtk build products/byproducts, Emacs and Edwin source file
declarations.

* src/gtk/Includes/: gdkcolor.cdecl, gdktypes.cdecl, gdkwindow.cdecl,
  gtk.cdecl, gtkrc.cdecl, gtkstyle.cdecl, gtkwidget.cdecl,
  gtkwindow.cdecl, pango-layout.cdecl:

Declare additional C functions and constants.

* src/gtk/Makefile-fragment:

Make C-generate products dependent on ALL .cdecl files, including all
of Includes/*.cdecl.

* src/gtk/compile.scm:

Factored some common code into a tricked-out sf procedure: sf+.

* src/gtk/gtk-object.scm:

Added new widget and window functions.  Do more argument type
checking.

* src/gtk/gtk.cdecl:

Removed gtk_window_new, gtk_window_set_title and
gtk_window_set_default_size to Includes/gtkwindow.cdecl.

* src/gtk/gtk.pkg:

Export new widget, window and color procedures.

* src/gtk/scm-layout.scm:

Uncomment trace statements; implement trace as a syntactic keyword.
Comment out visual and colormap GdkWindowAttr settings.  Added
accessors and mutators for the widget's four GTK_STATE_NORMAL colors.

13 years agoFixed gtk-thread crash. Raised pixbuf-loader interface.
Matt Birkholz [Fri, 15 May 2009 15:16:36 +0000 (08:16 -0700)]
Fixed gtk-thread crash.  Raised pixbuf-loader interface.

* src/.gitignore:

Added exceptions for src/gtk/Clean.sh and src/gtk/Tags.sh.

* src/gtk/gobject.scm:

Wrap <pixbuf-loader>s' GdkPixbufs with a <pixbuf>, a new type of
<gobject> that will free a GdkPixbuf when it is GCed.  Provide hooks
so that users of <pixbuf-loader>s do not have to register low-level C
callbacks.  Support "late" hooking by cacheing size and pixbuf and
providing them immediately to latecomers.  (The update hook, on the
other hand, might never call.)  The close hook is run in the loader's
thread (or the latecomer's) after gdk_pixbuf_loader_close has been
closed, and any error status collected.

* src/gtk/: gobject.scm, gtk-object.scm, scm-layout.scm:

Use "cleanup" instead of "finalize" to avoid confusion with Gtk's
notion of finalization.  Assume gc-cleanups are without-interrupts.
Do NOT run gc-cleanups in a gc-daemon; run them in gtk-thread.  Added
more tracing; named more lambdas.

* src/gtk/gtk.pkg:

Declare new pixbuf-loader interface.  Rename (gtk object) package
"(gtk gtk-object)".  Punt gobject-finalize! (same as gobject-unref).
Move (gtk main) to load after (gtk gobject), so the gc-cleanup list is
initialized before gtk-thread is launched.

* src/gtk/main.scm:

Added program "name" parameter to gtk-init, to correctly (re)construct
the command line.

* src/gtk/scm-layout.scm:

Use the new pixbuf-loader hooks instead of low-level gsignals.
"%trace" -> "trace" for consistency.

* src/gtk/thread.scm:

Disable interrupts BEFORE calling out with run-gtk as now required by
the FFI.  Run gc-cleanups whenever the gc-timestamp increases.  Punt
signal-thread-events, which was trouble when run WITH interrupts.
maybe-signal-io-thread-events after run-gtk should be sufficient.

* src/gtk/thread.scm, src/runtime/thread.scm:

"tracing?" -> "trace?" for consistency.

13 years agoGNOME Toolkit Interface, as released 2009-03-18.
Matt Birkholz [Fri, 15 May 2009 07:09:40 +0000 (00:09 -0700)]
GNOME Toolkit Interface, as released 2009-03-18.

* doc/Makefile.in:

Include gtk in SUBDIRS.

* doc/configure.ac:

Include gtk/Makefile.

* doc/gtk/Makefile.in:

Build the Users' Manual for the GTK.

* doc/gtk/gtk.texinfo:

The Users' Manual for the GTK.

* doc/index.html:

Include mit-scheme-gtk/index.html.

* src/Clean.sh:

Clean up new symlinks config.sub and config.guess, used by
AZ_CANONICAL_HOST in configure.ac.

* src/Makefile.in:

Added new file category "FFIS".  Include gtk in FFIS.

`make generate' in FFIS before compiling their Scheme source, so
they can C-include later -- much later.

`make build' in FFIS after dumping the new bands, so the FFIS are
compiled with the shims installed in lib/lib/.  The new bands are
not strictly necessary, but they complete lib/lib/, so the
commandline in FFI Makefiles can be this simple:
`../microcode/scheme --library ../lib'.

Added similar commands to the all-liarc target, though I have yet
to build a lairc-based system.

Install conses.png in lib/ for the scm-layout-demo.

* src/README.txt:

Describe gtk as part of the core.

* src/Setup.sh:

Include gtk in INSTALLED_SUBDIRS.  Include rcs in OTHER_SUBDIRS,
so `make tags' does not fail.

Symlink to microcode/config.sub and config.guess, so configure.ac
can share with microcode/configure.ac.  Create lib/lib/prgtkio.so
and lib/gtk symlinks too.

* src/configure.ac:

Include AC_CANONICAL_HOST and related C compilation variables,
esp. SHIM_CFLAGS and SHIM_LDFLAGS, shared with
microcode/configure.ac via microcode/achost.ac.  Echo the
create-makefiles.sh commandline.  Generate gtk/Makefile.  Added
gtk to liarc BUNDLEs.

* src/etc/create-makefiles.sh:

Include gtk in BUNDLES.

* src/etc/optiondb.scm:

Define loadable option GTK.

* src/etc/std-makefile-prefix:

Added C compilation variables, esp. COMPILE_SHIM and LINK_SHIM.

* src/gtk/Clean.sh:

Clean up after building the shim.

* src/gtk/Includes/: cairo-xlib.cdecl, cairo.cdecl,
  gdk-pixbuf-core.cdecl, gdk-pixbuf-loader.cdecl,
  gdk-pixbuf.cdecl, gdk.cdecl, gdkcolor.cdecl, gdkcursor.cdecl,
  gdkdrawable.cdecl, gdkevents.cdecl, gdkfont.cdecl, gdkgc.cdecl,
  gdkkeys.cdecl, gdkkeysyms.cdecl, gdkrgb.cdecl, gdktypes.cdecl,
  gdkwindow.cdecl, genums.cdecl, gerror.cdecl, glib.cdecl,
  gobject.cdecl, gparam.cdecl, gparamspecs.cdecl, gquark.cdecl,
  gsignal.cdecl, gtk.cdecl, gtkadjustment.cdecl, gtkbox.cdecl,
  gtkenums.cdecl, gtkobject.cdecl, gtkstyle.cdecl,
  gtktypeutils.cdecl, gtkvbox.cdecl, gtkwidget.cdecl, gtype.cdecl,
  gtypes.cdecl, gvalue.cdecl, gvaluetypes.cdecl,
  pango-context.cdecl, pango-font.cdecl, pango-layout.cdecl,
  pango-types.cdecl, pango.cdecl, pangocairo.cdecl:

C declarations corresponding to SOME of
/usr/include/g{lib,tk}-2.0/**/*.h.

* src/gtk/Makefile-fragment:

Generate the gtk shim, and build Scheme code that uses it.  Keep
the ScmWidget methods in a .c.stay file so it does not get cleaned
up by `Clean.sh maintainer-clean' nor `Clean.sh c-clean'.  Create
conses.png from conses.png.uu because I cannot distribute a binary
in a patchfile.

* src/gtk/Tags.sh:

Include auxiliary ScmWidget code, and NOT gtk-const.scm.

* src/gtk/compile.scm:

Build the GTK system.  Expects the shim to be available in ../lib.

* src/gtk/conses.png.uu:

Because I cannot distribute a binary in a patchfile.

* src/gtk/: demo.scm, gtk-ev.scm, hello.scm, pango-cairo.scm:

Peripheral hacks.

* src/gtk/: gobject.scm, gtk-object.scm, gtk.pkg, gtk.scm, load.scm,
  main.scm, scm-layout.scm, scm-widget.scm:

The core of the GTK system.

* src/gtk/gtk.cdecl:

The C types and externs needed in the GTK shim.

* src/gtk/gtk-shim.h:

C declarations for gtk-shim.c, gtk-const.c and scmwidget.c.  Includes
the ScmWidget and ScmWidgetClass struct declarations.

* src/gtk/scmwidget.c.stay:

ScmWidget methods.  The ".stay" suffix keeps this code from being
"cleaned up" by `Clean.sh maintainer-clean' or `Clean.sh c-clean'.

* src/gtk/thread.scm:

The Scheme thread that "runs" the toolkit.

* src/microcode/configure.ac, src/microcode/achost.ac:

Moved the AC_CANONICAL_HOST code from microcode/configure.ac to
microcode/achost.ac, so it can be shared with configure.ac.

Implement a --with-gtk argument.

* src/microcode/makegen/: Makefile.in.in, files-optional.scm:

Added new module prgtkio.so.

* src/microcode/makegen/makeinit.sh:

Use --batch-mode and `mit-scheme' instead of `scheme'.

* src/microcode/osio.h, microcode/prosio.c:

Changed the declarations of OS_select_registry_entry and
arg_select_registry so they can be used in the new prgtkio module.

* src/microcode/prgtkio.c:

The prgtkio module.  New primitives that arrange to run Scheme in an
idle task of a GMainLoop.

* src/microcode/utabmd.sh:

Use --batch-mode and `mit-scheme'.  Echo the commandline.

* src/microcode/uxio.c:

Added an OS_select_registry_entry function that extracts a file
descriptor and a mode from an indexed registry entry, for prgtkio.

* src/runtime/Makefile-fragment:

Install runtime-*.pkd so lusers can cref imports.

* src/runtime/thread.scm:

Added some tracing, conditioned on a tracing? binding.

13 years agoCheck URI record arguments more carefully in ->MUMBLE-URI.
Taylor R Campbell [Sat, 15 Jan 2011 04:36:39 +0000 (04:36 +0000)]
Check URI record arguments more carefully in ->MUMBLE-URI.

->ABSOLUTE-URI would formerly accept URI records representing
relative references, even though it would reject their string
representations.  Now it rejects both.

13 years agoLook in /usr/local/share/info for Info files in Edwin by default.
Taylor R Campbell [Tue, 4 Jan 2011 03:35:38 +0000 (03:35 +0000)]
Look in /usr/local/share/info for Info files in Edwin by default.

This is where the doc/ makefile actually installs them by default.

14 years agoMerge branch 'master' of git.sv.gnu.org:/srv/git/mit-scheme
Chris Hanson [Fri, 24 Dec 2010 04:57:35 +0000 (20:57 -0800)]
Merge branch 'master' of git.sv.gnu.org:/srv/git/mit-scheme

14 years agoFix floenv issues with MacOSX.
Chris Hanson [Fri, 24 Dec 2010 04:37:31 +0000 (20:37 -0800)]
Fix floenv issues with MacOSX.

14 years agoFFI support for 64bit architectures.
Matt Birkholz [Tue, 21 Dec 2010 17:28:03 +0000 (10:28 -0700)]
FFI support for 64bit architectures.

* src/ffi/generator.scm: Declare long callback IDs, large enough to
avoid truncation warnings when the toolkit type is also large.  Use
%ld instead of %d for sizeof and member offsets, and cast them to
long.  On x86_64, these have types ulong and long respectively.

* src/microcode/: pruxffi.c, pruxffi.h: (callback_run_kernel)
(callback_run_handler): Declare long callback_id params.  Use %ld.

* src/runtime/ffi.scm (radix): Parameterize alien operations to
support 64bit or 32bit addresses.

14 years agoFix tag table entry for flonum for 64-bit platforms.
Joe Marshall [Sat, 18 Dec 2010 01:32:08 +0000 (17:32 -0800)]
Fix tag table entry for flonum for 64-bit platforms.

14 years agoFix copying of ACCESS.
Joe Marshall [Fri, 17 Dec 2010 23:31:36 +0000 (15:31 -0800)]
Fix copying of ACCESS.

14 years agoFix STRIP-SUBJECT-RE on "Re: ".
Taylor R Campbell [Fri, 10 Dec 2010 06:46:35 +0000 (06:46 +0000)]
Fix STRIP-SUBJECT-RE on "Re: ".

14 years agoFix datime.scm's time formats to accept up to 61 seconds in a minute.
Taylor R Campbell [Tue, 7 Dec 2010 23:37:59 +0000 (23:37 +0000)]
Fix datime.scm's time formats to accept up to 61 seconds in a minute.

Minutes in any UTC-based time system, which covers every system of
which representations are parsed in datime.scm, can have 59, 60, or
61 seconds; previously we refused to parse representations of the
61st second.

Unfortunately, our notion of `universal time' is still essentially
Common Lisp's ill-specified notion of universal time, and implemented
by POSIX's mind-bogglingly brain-damaged notion of `number of seconds
since the Epoch' which actually means `number of seconds since the
Epoch, minus the number of them that were leap seconds in UTC'.

14 years agoFix silly thinko in definition of STRIP-SUBJECT-RE.
Taylor R Campbell [Tue, 30 Nov 2010 19:16:08 +0000 (19:16 +0000)]
Fix silly thinko in definition of STRIP-SUBJECT-RE.

Also omit needless unsafe fixnum specialization.

14 years agoHandle EINTR from opendir.
Taylor R Campbell [Wed, 24 Nov 2010 18:29:14 +0000 (18:29 +0000)]
Handle EINTR from opendir.

14 years agoFix comment about euclidean division -- r may be zero.
Taylor R Campbell [Fri, 19 Nov 2010 18:54:11 +0000 (18:54 +0000)]
Fix comment about euclidean division -- r may be zero.

14 years agoWork around bug in glibc's fegetenv on amd64.
Taylor R Campbell [Fri, 19 Nov 2010 07:24:54 +0000 (07:24 +0000)]
Work around bug in glibc's fegetenv on amd64.

14 years agoMerge branch 'master' of ssh://git.sv.gnu.org/srv/git/mit-scheme
Taylor R Campbell [Fri, 19 Nov 2010 06:49:07 +0000 (06:49 +0000)]
Merge branch 'master' of ssh://git.sv.gnu.org/srv/git/mit-scheme

14 years agoReplace `masking exceptions' by `trapping exceptions'.
Taylor R Campbell [Fri, 19 Nov 2010 06:10:27 +0000 (06:10 +0000)]
Replace `masking exceptions' by `trapping exceptions'.

Reversing the sense makes it clearer -- `trap on division by zero' is
a positive request, versus `mask division by zero traps', i.e. `don't
trap on division by zero'.  This better reflects the IEEE 754 notion
of actions to take on exceptions.  Also, the sense of `mask' is often
confusing (Scheme's `interrupt mask' is not the interrupts that are
masked, but the bit mask of interrupts that are *enabled*; the BSD
fpgetmask and fpsetmask library routines control the bit mask of
floating-point exceptions for which trapping is enabled; but, on the
other hand, a POSIX process's `signal mask' is the set of signals
that are disabled).

14 years agoImplement a complete set of integer division operator pairs.
Taylor R Campbell [Fri, 19 Nov 2010 05:02:58 +0000 (05:02 +0000)]
Implement a complete set of integer division operator pairs.

Given a numerator n and a denominator d, each operator pair computes
an integral quotient q and the induced remainder r = n - d q such
that |r| < |d|.  There are five pairs: ceiling, euclidean, floor,
round, and truncate.  Ceiling, floor, round, and truncate compute the
rounded quotient as their names suggest.  Euclidean division is floor
division for positive denominators, and ceiling division for negative
denominators, so that it exhibits the stronger property 0 <= r < |d|.

14 years agoFix example code in "Type and range checking".
Matt Birkholz [Fri, 12 Nov 2010 21:30:57 +0000 (14:30 -0700)]
Fix example code in "Type and range checking".

14 years agoCreate lib/lib symlinks in microcode/configure.
Matt Birkholz [Fri, 12 Nov 2010 21:18:15 +0000 (14:18 -0700)]
Create lib/lib symlinks in microcode/configure.

* src/Setup.sh, src/microcode/configure.ac: Create the src/lib/lib/
symlinks in microcode/configure, which has the list of enabled
modules.

14 years agoFixed src/README.txt. Portable C Installation instructions.
Matt Birkholz [Fri, 12 Nov 2010 21:16:11 +0000 (14:16 -0700)]
Fixed src/README.txt.  Portable C Installation instructions.

* doc/user-manual/user.texinfo: Added node "Portable C Installation".
Added "Type and range checking" describing the no-type-checks and
no-range-checks declarations.

* src/README.txt: Added a preface for the newbie that runs across this
file in a binary distribution.  Removed "CVS".  Added "portable C
distribution" and "MIT_SCHEME_EXE".  Removed mention of "bin/" in
binary distributions, and "SCHEME_LARGE" and "SCHEME_COMPILER"
variables in build scripts; these are no longer used.  Replaced
"system" with "program" or "build tree" or whatnot, reserving "system"
for the thing that runs the "operating system".  Punted sections
"Building from source... ```The Hard Way''" and "... Tabula Rasa''",
which were mostly about re-compiling / re-linking the microcode.  The
solution to such problems is now automated by the compile-microcode
step in the Unix installation instructions.

14 years agoMake BSD feraiseexcept actually raise the exception.
Taylor R Campbell [Tue, 2 Nov 2010 01:42:15 +0000 (01:42 +0000)]
Make BSD feraiseexcept actually raise the exception.

Forcing a floating-point operation by storing the (double) sum of
two volatile variables in a volatile variable is pretty kludgey,
but it works.

14 years agoReplace FPE_RESET_TRAPS by generic clear_float_exceptions.
Taylor R Campbell [Tue, 2 Nov 2010 01:41:18 +0000 (01:41 +0000)]
Replace FPE_RESET_TRAPS by generic clear_float_exceptions.

14 years agoMore fixes to floenv.h.
Taylor R Campbell [Mon, 1 Nov 2010 06:56:06 +0000 (06:56 +0000)]
More fixes to floenv.h.

14 years agoVarious fixes to floenv.h's emulation of fenv.h in terms of ieeefp.h.
Taylor R Campbell [Mon, 1 Nov 2010 06:34:36 +0000 (06:34 +0000)]
Various fixes to floenv.h's emulation of fenv.h in terms of ieeefp.h.

Still kinda broken.  More to come.

14 years agoFix name of UPDATE-FLOAT-ENVIRONMENT primitive's C procedure.
Taylor R Campbell [Mon, 1 Nov 2010 06:33:58 +0000 (06:33 +0000)]
Fix name of UPDATE-FLOAT-ENVIRONMENT primitive's C procedure.

14 years agoCheck more carefully for fenv_t and fexcept_t.
Taylor R Campbell [Mon, 1 Nov 2010 06:33:38 +0000 (06:33 +0000)]
Check more carefully for fenv_t and fexcept_t.

14 years agoCheck for the C99 fenv operations in microcode/configure.
Taylor R Campbell [Mon, 1 Nov 2010 05:18:42 +0000 (05:18 +0000)]
Check for the C99 fenv operations in microcode/configure.

14 years agoFix typo.
Taylor R Campbell [Mon, 1 Nov 2010 05:10:56 +0000 (05:10 +0000)]
Fix typo.

14 years agoCheck for fenv_t and fexcept_t in microcode/configure.
Taylor R Campbell [Mon, 1 Nov 2010 05:03:59 +0000 (05:03 +0000)]
Check for fenv_t and fexcept_t in microcode/configure.

14 years agoImplement support for a floating-point environment.
Taylor R Campbell [Mon, 1 Nov 2010 04:37:31 +0000 (04:37 +0000)]
Implement support for a floating-point environment.

14 years agoAdded c-cast, struct member peeks, param syntax checking.
Matt Birkholz [Sun, 31 Oct 2010 00:05:05 +0000 (17:05 -0700)]
Added c-cast, struct member peeks, param syntax checking.

* src/ffi/cdecls.scm (valid-param): Check that the param name does not
contain `-', nor any other non-C identifier chars.  These names go
into the generated .c files.

* src/ffi/syntax.scm (expand-peek): Allow peeks at struct members to
create or set an alien, just as peeking an array member does already.

* src/ffi/ffi.scm (c-cast): New.  Basically set-%alien/ctype! with a
convenient return value.

(alien/address, copy-alien-address!, alien-null?, alien-null!, alien=?):
Declare these as integrable operators, not via define-integrable.
Their arguments are referenced multiple times.

* src/runtime/runtime.pkg (runtime ffi): Export c-cast to ().

14 years agoMinor robustness improvement to microcode/makegen/makeinit.sh.
Taylor R Campbell [Fri, 29 Oct 2010 06:01:08 +0000 (06:01 +0000)]
Minor robustness improvement to microcode/makegen/makeinit.sh.

Don't clean up on SIGQUIT.

Use the wretched ${@:+"${@}"} idiom for APPLY.

14 years agoConvert INTERRUPTABLE_EXTENT to use `do { ... } while (0)'.
Taylor R Campbell [Fri, 29 Oct 2010 05:57:41 +0000 (05:57 +0000)]
Convert INTERRUPTABLE_EXTENT to use `do { ... } while (0)'.

14 years agoOmit procedure arity check in HASH-TABLE/MODIFY!.
Taylor R Campbell [Sun, 24 Oct 2010 06:27:02 +0000 (06:27 +0000)]
Omit procedure arity check in HASH-TABLE/MODIFY!.

This causes problems in the cold load, and doesn't enhance the safety
of the relevant code.  It only marginally increases the debuggability
of the mistake it catches.

14 years agoMake #@n always read as a quotation of the nth hashed object.
Taylor R Campbell [Sun, 24 Oct 2010 06:16:33 +0000 (06:16 +0000)]
Make #@n always read as a quotation of the nth hashed object.

Previously, #@n sometimes read as the nth hashed object, and
sometimes read as a quotation of it.  The advantage of the old
behaviour is that non-scode objects could be mentioned inside
quotations with #@n.  Personally, most of the time I referred to
non-scode objects inside quotations with #@n was as '#@n to work
around the problems this fixes:

(lambda (x) x)
;Value 12: #[compound-procedure 12]

(#@12 0)
;The object #[compound-procedure 12], passed as an argument to make-combination, is not an operator expression.

(list 1 2 3)
;Value 18: (1 2 3)

(pp #@18)
;The object 1 is not applicable.

14 years agoKludge to fix pct-encoding of authority part of IMAP URLs in IMAIL.
Taylor R Campbell [Sun, 24 Oct 2010 01:21:02 +0000 (01:21 +0000)]
Kludge to fix pct-encoding of authority part of IMAP URLs in IMAIL.

14 years agoFix FLUID-LET of ACCESS.
Taylor R Campbell [Sun, 17 Oct 2010 20:33:23 +0000 (20:33 +0000)]
Fix FLUID-LET of ACCESS.

14 years agoAdd previously omitted SRFI 33 operation TEST-BIT-FIELD?.
Taylor R Campbell [Sun, 17 Oct 2010 20:32:28 +0000 (20:32 +0000)]
Add previously omitted SRFI 33 operation TEST-BIT-FIELD?.

14 years agoNew operations on the two's-complement representation of integers.
Taylor R Campbell [Sun, 17 Oct 2010 20:00:34 +0000 (20:00 +0000)]
New operations on the two's-complement representation of integers.

These include the SRFI 33 operations, as well as some other useful
operations.

Although these are implemented as primitives with native definitions
for bignums, the primitives are not yet open-coded for the fixnum
case.  Eventually they should be open-coded, so that you don't need
to make a choice between safe code using the integer operations and
fast code using FIX:AND, FIX:LSH, &c.  Some operations are easy to
open-code for the fixnum case, such as all the bitwise operations.
Others are not so easy, such as SHIFT-LEFT, and it would be better to
open-code common aggregate operations such as EXTRACT-BIT-FIELD for
the fixnum case.  In any case, at least we now have names for the
safe operations.

14 years agoBack out i386 rewriting rule to optimize OBJECT->FIXNUM operands.
Taylor R Campbell [Sun, 17 Oct 2010 02:01:19 +0000 (02:01 +0000)]
Back out i386 rewriting rule to optimize OBJECT->FIXNUM operands.

This causes conpar.scm, for example, to be miscompiled.

14 years agoNuke old Unix-specific I/O selection primitives.
Taylor R Campbell [Sun, 17 Oct 2010 01:43:56 +0000 (01:43 +0000)]
Nuke old Unix-specific I/O selection primitives.

These have been unused for a decade and broken for half that.

14 years agoSimplify and fix X-DISPLAY-PROCESS-EVENTS primitive.
Taylor R Campbell [Sat, 16 Oct 2010 06:13:43 +0000 (06:13 +0000)]
Simplify and fix X-DISPLAY-PROCESS-EVENTS primitive.

This primitive no longer supports options for blocking vs
non-blocking or selecting vs not selecting; these are now the
responsibility of the caller.

The cached event trick previously used the value of the
uninitialized variable `event', rather than the event that was
cached.  Now it correctly uses the event that was cached.

14 years agoFix and simplify recent change to xterm_dump_rectangle.
Taylor R Campbell [Fri, 15 Oct 2010 03:28:33 +0000 (03:28 +0000)]
Fix and simplify recent change to xterm_dump_rectangle.

14 years agoFinish fix in last change to entity unparsers.
Taylor R Campbell [Thu, 14 Oct 2010 05:32:03 +0000 (05:32 +0000)]
Finish fix in last change to entity unparsers.

14 years agoFix bug in recent change to entity unparsers.
Taylor R Campbell [Thu, 14 Oct 2010 05:17:20 +0000 (05:17 +0000)]
Fix bug in recent change to entity unparsers.

14 years agoFix uninitialized reference in xterm_dump_rectangle.
Taylor R Campbell [Thu, 14 Oct 2010 04:59:39 +0000 (04:59 +0000)]
Fix uninitialized reference in xterm_dump_rectangle.

14 years agoImplement user-defined unparser methods for entities.
Taylor R Campbell [Thu, 14 Oct 2010 04:50:52 +0000 (04:50 +0000)]
Implement user-defined unparser methods for entities.

New DEFINE-STRUCTURE option PRINT-ENTITY-PROCEDURE is like
PRINT-PROCEDURE, except that the second argument to the procedure
is not a structure instance itself but an entity whose extra is a
structure instance.

New procedure SET-RECORD-TYPE-ENTITY-UNPARSER-METHOD! is like
SET-RECORD-TYPE-UNPARSER-METHOD! with the same difference.

New optional argument to MAKE-RECORD-TYPE specifies an entity
unparser method.

Existing code should be unaffected by the changes, including
existing compiled code that used DEFINE-STRUCTURE.

14 years agoMake the debugger robust to errors while printing.
Taylor R Campbell [Thu, 14 Oct 2010 04:42:21 +0000 (04:42 +0000)]
Make the debugger robust to errors while printing.

14 years agoFix some signedness issues in the X11 primitives.
Taylor R Campbell [Thu, 14 Oct 2010 03:02:18 +0000 (03:02 +0000)]
Fix some signedness issues in the X11 primitives.

Times are always unsigned; reflect this.

Screen coordinates are signed, and not always nonnegative; project
negative ones onto the border.  Widths and heights are technically
signed too, according to my Xlib.h, but I haven't observed negative
values, and negative values can't possibly make sense, whereas I have
observed negative coordinates in the wild (button down in-window,
button up out-of-window).

14 years agoFix harmless typo in recent change to cache IMAIL message properties.
Taylor R Campbell [Tue, 12 Oct 2010 02:31:58 +0000 (02:31 +0000)]
Fix harmless typo in recent change to cache IMAIL message properties.

14 years agoRefuse to signal a subprocess that has terminated.
Taylor R Campbell [Mon, 11 Oct 2010 02:47:43 +0000 (02:47 +0000)]
Refuse to signal a subprocess that has terminated.

Once Scheme has called wait*(2) on a process that has terminated, its
pid may be recycled, so attempting to send a signal to it may cause a
signal to be sent to some random process!

New tests for subprocess support include a regression test for this.

14 years agoBack out accidentally committed changes to i386.m4 fenv routines.
Taylor R Campbell [Fri, 8 Oct 2010 04:48:27 +0000 (04:48 +0000)]
Back out accidentally committed changes to i386.m4 fenv routines.

14 years agoFix recent change to FLUID-LET to support unassigning.
Taylor R Campbell [Fri, 8 Oct 2010 04:13:46 +0000 (04:13 +0000)]
Fix recent change to FLUID-LET to support unassigning.

Fixes

(define x 0)
(fluid-let ((x)) ...)
;The object (), passed as an argument to safe-car, is not a pair.

14 years agoAdd hook in dynamically loaded modules for unloading actions.
Taylor R Campbell [Thu, 7 Oct 2010 15:26:15 +0000 (15:26 +0000)]
Add hook in dynamically loaded modules for unloading actions.

Dynamically loaded modules can't use reload cleanups, because they
may be unloaded by pruxdld's reload cleanup before their reload
cleanups get to run, causing DISK-RESTORE to attempt to execute
unmapped code.  Instead, pruxdld will now call dload_finalize_file
if it is defined in the file.

Use this mechanism in prx11.  Fixes DISK-RESTORE after launching
and exiting Edwin.  (Does not fix DISK-RESTORE of an image that was
saved while Edwin was running.  That is much harder.)

14 years agoFix comments in i386.m4 and x86-64.m4 about executable stack.
Taylor R Campbell [Thu, 7 Oct 2010 05:59:36 +0000 (05:59 +0000)]
Fix comments in i386.m4 and x86-64.m4 about executable stack.

14 years agoFix recent change to SHALLOW-FLUID-BIND.
Taylor R Campbell [Thu, 7 Oct 2010 05:47:30 +0000 (05:47 +0000)]
Fix recent change to SHALLOW-FLUID-BIND.

This works around lossage with unassigned variables:

   (define x)
   (fluid-let ((x 0)) ...)
   ;Unassigned variable: x

This relies on the deprecated semantics of SET! that returns the
variable's old value (or old reference trap, if unassigned).

14 years agoFix PC-in-builtin detection.
Taylor R Campbell [Thu, 7 Oct 2010 02:33:06 +0000 (02:33 +0000)]
Fix PC-in-builtin detection.

n_builtins must be incremented if it is ever to exceed 0...

14 years agoMinor hack to revive the 6.001 REPL.
Taylor R Campbell [Thu, 7 Oct 2010 00:42:26 +0000 (00:42 +0000)]
Minor hack to revive the 6.001 REPL.

14 years agoCache parsed date, subject, author, and recipient in memory in IMAIL.
Taylor R Campbell [Thu, 7 Oct 2010 00:36:52 +0000 (00:36 +0000)]
Cache parsed date, subject, author, and recipient in memory in IMAIL.

This is not really the right thing, but it substantially speeds up
sorting, and slightly speeds up summarization, without requiring the
memory overhead of keeping whole headers strongly in memory.

What IMAIL should really do is

(1) store headers (and bodies and body structures and so on) strongly
in memory, and use a secondary GC daemon to discard them when space is
short; and

(2) use a generic, compact, on-disk cache, for every folder, of the
important information for each message: date, subject, author,
recipient, message-id, thread-id.

14 years agoDon't invoke B-M for one-character patterns in SUBSTRING-SEARCH-ALL.
Taylor R Campbell [Thu, 7 Oct 2010 00:33:50 +0000 (00:33 +0000)]
Don't invoke B-M for one-character patterns in SUBSTRING-SEARCH-ALL.

14 years agoMerge branch 'master' of ssh://git.sv.gnu.org/srv/git/mit-scheme
Taylor R Campbell [Wed, 6 Oct 2010 04:57:39 +0000 (04:57 +0000)]
Merge branch 'master' of ssh://git.sv.gnu.org/srv/git/mit-scheme

14 years agoChange URI abstraction to handle percent encoding in the authority.
Chris Hanson [Thu, 30 Sep 2010 10:13:36 +0000 (03:13 -0700)]
Change URI abstraction to handle percent encoding in the authority.
Change terminology slightly to match RFC.

14 years agoApply patch from Eric Christopherson to allow calling mit-scheme.app/Contents/Resourc...
Chris Hanson [Thu, 30 Sep 2010 09:20:15 +0000 (02:20 -0700)]
Apply patch from Eric Christopherson to allow calling mit-scheme.app/Contents/Resources/mit-scheme from command line.

14 years agoSimplify idiom for implementing dynamic binding.
Taylor R Campbell [Mon, 13 Sep 2010 15:34:17 +0000 (15:34 +0000)]
Simplify idiom for implementing dynamic binding.

14 years agoNew macro BEGIN0.
Taylor R Campbell [Mon, 13 Sep 2010 15:28:31 +0000 (15:28 +0000)]
New macro BEGIN0.

(BEGIN0 <expression> <command> ...) evaluates <expression>, executes
<command> ..., and then returns the value of <expression>.

(Cf. Common Lisp's PROG1.)

14 years agoMoved declaration inside a block in order to conform to C89.
Arthur A. Gleckler [Thu, 9 Sep 2010 06:15:43 +0000 (23:15 -0700)]
Moved declaration inside a block in order to conform to C89.
(Thanks to Taylor for pointing out the need for this.)

14 years agoUse <error_unimplemented_primitive> in case uint64 is not available.
Arthur A. Gleckler [Tue, 7 Sep 2010 15:03:28 +0000 (08:03 -0700)]
Use <error_unimplemented_primitive> in case uint64 is not available.

14 years agoConditionalized compilation of the flonum casting primitives.
Arthur A. Gleckler [Tue, 7 Sep 2010 05:57:30 +0000 (22:57 -0700)]
Conditionalized compilation of the flonum casting primitives.
The primitives `cast-ieee754-double-to-integer' and
`cast-integer-to-ieee754-double' are omitted when the type
<uint64_t> is not available.

14 years agoAdded <AC_INT64_T> and <AC_UINT64_T> to "configure.ac". The latter is
Arthur A. Gleckler [Mon, 6 Sep 2010 05:32:55 +0000 (22:32 -0700)]
Added <AC_INT64_T> and <AC_UINT64_T> to "configure.ac".  The latter is
now required by "flonum.c" because of the new primitives I added, and
CPH asked me to include the former, too.

14 years agoShrink hashtb.{bin,com,bci} further with judicious use of syntax.
Taylor R Campbell [Sun, 5 Sep 2010 18:57:11 +0000 (18:57 +0000)]
Shrink hashtb.{bin,com,bci} further with judicious use of syntax.

14 years agoWork around bug that makes DECLARE and SYNTAX-RULES not mix.
Taylor R Campbell [Sun, 5 Sep 2010 18:23:04 +0000 (18:23 +0000)]
Work around bug that makes DECLARE and SYNTAX-RULES not mix.

14 years agoFix total botch of last commit.
Taylor R Campbell [Sun, 5 Sep 2010 05:04:47 +0000 (05:04 +0000)]
Fix total botch of last commit.

Make the GC cleverer about reallocating the ephemeron array, in order
to avoid potentially quadratic-time behaviour in MAKE-EPHEMERON and
fasloading files with ephemerons in them.

Now fasls and bands with ephemerons in them should really work, this
time with feeling...

14 years agoNew fasl version to support ephemerons.
Taylor R Campbell [Sat, 4 Sep 2010 05:10:17 +0000 (05:10 +0000)]
New fasl version to support ephemerons.

In the process, complete the transition to the STACK_END fasl format.

In the EPHEMERON fasl format, the fasl header has an extra field for
the number of ephemerons stored in the fasl, for which the fasloader
reserves space in ephemeron_array.

The fasdumper chooses between the C_CODE, STACK_END, or EPHEMERON
fasl format for maximum compatibility:

- If there are any ephemerons in the fasl, the fasdumper chooses the
  EPHEMERON format.  Older microcodes don't know about ephemerons and
  thus can't handle such fasls anyway.

- If dumping a band, the fasdumper chooses the STACK_END format,
  since the only differences between the C_CODE format and the
  STACK_END format matter only for bands.  Support for reading the
  STACK_END format was added in version 15 of the microcode; any
  newly created bands are not likely to be used in older microcodes
  than that anyway.

- Otherwise, the fasdumper chooses the C_CODE format, like before.

14 years agoRemoved NaN tests because they cause traps on Linux. (It turns out
Arthur A. Gleckler [Fri, 3 Sep 2010 03:57:08 +0000 (20:57 -0700)]
Removed NaN tests because they cause traps on Linux.  (It turns out
that they are supposed to on OS X, too, but a bug prevents that).
Taylor is considering adding support for controlling the
floating-point exception mask and flags, in which case we'll be able
to manipulate NaN values and I can add these tests back.

14 years agoAdded tests for infinities.
Arthur A. Gleckler [Thu, 2 Sep 2010 06:56:41 +0000 (23:56 -0700)]
Added tests for infinities.

14 years agoFixed typo in comments.
Arthur A. Gleckler [Thu, 2 Sep 2010 05:57:36 +0000 (22:57 -0700)]
Fixed typo in comments.

14 years agoAdded trivial tests for conversion to floating-point infinities by
Arthur A. Gleckler [Thu, 2 Sep 2010 05:43:46 +0000 (22:43 -0700)]
Added trivial tests for conversion to floating-point infinities by
`cast-integer-to-ieee754-single' and `cast-integer-to-ieee754-double'.

14 years agoFixed code formatting.
Arthur A. Gleckler [Thu, 2 Sep 2010 05:29:34 +0000 (22:29 -0700)]
Fixed code formatting.

14 years ago* Renamed `cast-flonum-to-integer' to `cast-ieee754-double-to-integer'.
Arthur A. Gleckler [Thu, 2 Sep 2010 05:23:39 +0000 (22:23 -0700)]
* Renamed `cast-flonum-to-integer' to `cast-ieee754-double-to-integer'.

* Renamed `cast-integer-to-flonum' to `cast-integer-to-ieee754-double'.

* Changed both to use <uint64_t> instead of <unsigned long> for
conversion.  That way, they should work on 32-bit systems.  (Thanks to
Taylor for pointing out that bug.)

* Added `cast-ieee754-single-to-integer' and `cast-integer-to-ieee754-single'.

* Updated existing tests.

* Added tests for casts to and from single-precision floating-point numbers.

14 years agoRemoved the divisions by zero that I had used to create floating-point
Arthur A. Gleckler [Thu, 2 Sep 2010 03:48:14 +0000 (20:48 -0700)]
Removed the divisions by zero that I had used to create floating-point
infinities since those are supposed to trap, not actually return
infinities.  On OS X, the trap doesn't happen, but I shouldn't depend
on a bug.

14 years agoMerge branch 'master' of git://git.savannah.gnu.org/mit-scheme
Arthur A. Gleckler [Wed, 1 Sep 2010 04:17:30 +0000 (21:17 -0700)]
Merge branch 'master' of git://git.savannah.gnu.org/mit-scheme

14 years agoAdded primitives `cast-flonum-to-integer' and `cast-integer-to-flonum'
Arthur A. Gleckler [Wed, 1 Sep 2010 04:16:03 +0000 (21:16 -0700)]
Added primitives `cast-flonum-to-integer' and `cast-integer-to-flonum'
and tests.

14 years agoSofter landing for system-library-directory-pathname if sudirectory doesn't exist.
Joe Marshall [Tue, 31 Aug 2010 20:25:58 +0000 (13:25 -0700)]
Softer landing for system-library-directory-pathname if sudirectory doesn't exist.

14 years agoMerge branch 'master' of ssh://git.sv.gnu.org/srv/git/mit-scheme
Taylor R Campbell [Tue, 31 Aug 2010 15:26:30 +0000 (15:26 +0000)]
Merge branch 'master' of ssh://git.sv.gnu.org/srv/git/mit-scheme

14 years agoExploit OBJECT->FIXNUM's independence of tag on i386 and x86-64.
Taylor R Campbell [Tue, 31 Aug 2010 15:25:00 +0000 (15:25 +0000)]
Exploit OBJECT->FIXNUM's independence of tag on i386 and x86-64.

14 years agoKill infinite parsing loop by using + inside *, not * inside *.
Taylor R Campbell [Tue, 31 Aug 2010 15:24:00 +0000 (15:24 +0000)]
Kill infinite parsing loop by using + inside *, not * inside *.

14 years agoFixed comment in shadowing test.
Arthur A. Gleckler [Tue, 31 Aug 2010 05:15:15 +0000 (22:15 -0700)]
Fixed comment in shadowing test.

14 years agoMerge branch 'master' of ssh://git.sv.gnu.org/srv/git/mit-scheme
Taylor R Campbell [Mon, 30 Aug 2010 21:02:38 +0000 (21:02 +0000)]
Merge branch 'master' of ssh://git.sv.gnu.org/srv/git/mit-scheme

14 years agoFix missing -f in test.
Chris Hanson [Mon, 30 Aug 2010 09:10:55 +0000 (02:10 -0700)]
Fix missing -f in test.

14 years agoAdd unit test to confirm that shadowing fix worked.
Chris Hanson [Mon, 30 Aug 2010 06:25:17 +0000 (23:25 -0700)]
Add unit test to confirm that shadowing fix worked.

14 years agoMerge branch 'master' of git.sv.gnu.org:/srv/git/mit-scheme
Chris Hanson [Mon, 30 Aug 2010 05:52:55 +0000 (22:52 -0700)]
Merge branch 'master' of git.sv.gnu.org:/srv/git/mit-scheme

14 years agoExtend hash table entry types to support ephemeral hash tables.
Taylor R Campbell [Sun, 29 Aug 2010 17:28:53 +0000 (17:28 +0000)]
Extend hash table entry types to support ephemeral hash tables.

Add some tests for correctness against red/black trees.

Still missing are tests for weak and ephemeral entries types.

14 years agoFix SVM's write_cc_entry_offset.
Taylor R Campbell [Sat, 28 Aug 2010 20:58:19 +0000 (20:58 +0000)]
Fix SVM's write_cc_entry_offset.

Since this is used only to initialize trampolines, the starting
instruction is irrelevant, and will be garbage anyway because the
trampoline blocks are always freshly allocated.