mit-scheme.git
27 years agoFix bug: marked messages that had been deleted from the server were
Chris Hanson [Tue, 30 Sep 1997 02:21:32 +0000 (02:21 +0000)]
Fix bug: marked messages that had been deleted from the server were
remaining marked after downloading of message bodies.

27 years agoThe following change in how WIN32 graphics devices are flushed gives
Stephen Adams [Fri, 26 Sep 1997 19:53:02 +0000 (19:53 +0000)]
The following change in how WIN32 graphics devices are flushed gives
non-flickering update almost like double-buffering for programs which
have to draw multiple frames from scratch.

If graphics buffering is enabled, then a GRAPHICS-FLUSH operation
comes from the user's program.  The change is to synchronously redraw
the screen in this (i.e. buffered+flush) case.  Subsequent operations
can clear and draw without an asynchronous redraw operation copying
the subsequent partial image to the screen.

This is not quite double-buffering since forced redisplay during the
buffered drawing (for example, uncovering part of the window) will
cause the partly draw backing bitmap to be copied to the screen.

User programs with buffering and frequent explicit flushes are likely
to be slower.

27 years agoAdded hlsim documentation.
Stephen Adams [Tue, 26 Aug 1997 15:20:29 +0000 (15:20 +0000)]
Added hlsim documentation.

27 years agoFix bug: low-level file reading code was occasionally signalling
Chris Hanson [Sun, 24 Aug 1997 04:05:55 +0000 (04:05 +0000)]
Fix bug: low-level file reading code was occasionally signalling
errors for no apparent reason.  The cause: the ReadFile API can return
an error indication when it is called at end-of-file.  However, in
ONLY this case, the returned "bytesRead" value is zero.

27 years agoTrim any trailing end-of-line from system-call error strings.
Chris Hanson [Sun, 24 Aug 1997 04:03:53 +0000 (04:03 +0000)]
Trim any trailing end-of-line from system-call error strings.

27 years agoClip ranges immediately after a group is constructed, in order to
Chris Hanson [Sat, 23 Aug 1997 06:30:37 +0000 (06:30 +0000)]
Clip ranges immediately after a group is constructed, in order to
eliminate old markings.

27 years agoWork around problem in NT: prompting for a directory with a wildcard
Chris Hanson [Sat, 23 Aug 1997 05:20:15 +0000 (05:20 +0000)]
Work around problem in NT: prompting for a directory with a wildcard
was causing an error.  On unix, this works because FILE-DIRECTORY?
accepts such specifications as arguments -- but on NT, it doesn't.

27 years agoInitial revision
Chris Hanson [Sat, 23 Aug 1997 02:52:23 +0000 (02:52 +0000)]
Initial revision

27 years agoEliminate several calls to the C library in favor of native Win32 API
Chris Hanson [Sat, 23 Aug 1997 02:52:10 +0000 (02:52 +0000)]
Eliminate several calls to the C library in favor of native Win32 API
calls.  This was started to work around a bug in the Watcom C library,
but is generally desirable to eliminate unnecessary dependencies on
the C library.

The bug that started this is that FILE-DIRECTORY? returned #F on
directories with the FILE_ATTRIBUTE_ARCHIVE bit set.

27 years agoAdd new file "ntfs.h".
Chris Hanson [Sat, 23 Aug 1997 02:48:18 +0000 (02:48 +0000)]
Add new file "ntfs.h".

27 years agoEliminate conditionalization on OS_open_append_file; this procedure
Chris Hanson [Fri, 22 Aug 1997 16:33:14 +0000 (16:33 +0000)]
Eliminate conditionalization on OS_open_append_file; this procedure
compiles and runs just fine and probably should not have been
conditionalized in the first place.

27 years agoAdjusted indentation to be consistent with 7.4 version.
Stephen Adams [Tue, 12 Aug 1997 19:37:32 +0000 (19:37 +0000)]
Adjusted indentation to be consistent with 7.4 version.

27 years agoAdd switch to disable canonicalization of symbol case by reader.
Chris Hanson [Fri, 8 Aug 1997 21:29:38 +0000 (21:29 +0000)]
Add switch to disable canonicalization of symbol case by reader.

27 years agoFix bug in Scheme mode C-c C-s that could cause already-deleted
Chris Hanson [Sun, 3 Aug 1997 06:44:39 +0000 (06:44 +0000)]
Fix bug in Scheme mode C-c C-s that could cause already-deleted
buffers to be selected.  I don't understand why these buffers are
still in this list because there is code to remove them.

27 years agoDon't lose if directories in info-directory-list are lacking the
Chris Hanson [Sat, 2 Aug 1997 06:49:05 +0000 (06:49 +0000)]
Don't lose if directories in info-directory-list are lacking the
trailing slash.

27 years agoFix bug in last change - apply STRING->SYMBOL to the string, not the
Stephen Adams [Thu, 31 Jul 1997 18:33:07 +0000 (18:33 +0000)]
Fix bug in last change - apply STRING->SYMBOL to the string, not the
`constant' expression containing the string.

27 years ago7.4: Fixed STRING->SYMBOL expansion to test that it's argument is a
Stephen Adams [Thu, 31 Jul 1997 10:40:38 +0000 (10:40 +0000)]
7.4: Fixed STRING->SYMBOL expansion to test that it's argument is a
constant whose value is a string rather than applying STRING?
directly (which has been broken since it was added in 1992.)  Fixed
INTERN likewise.

8.0: treat INTERN similarly to STRING->SYMBOL: Add INTERN as a
integrated to a global reference.  Added type rule and constant
folding rule for intern. (This is better than constant folding at
integration time since it deals with constant propagation.)

27 years agoThe previous change to make the output with '(ABSOLUTE <N> ...)
Stephen Adams [Mon, 28 Jul 1997 18:19:05 +0000 (18:19 +0000)]
The previous change to make the output with '(ABSOLUTE <N> ...)
produce the correct number of digits for numbers with no significant
digits introduced problems with NORMAL rounded and ENGINEERING
formatted output.  All NORMAL rounded output for numbers of the form
ddd.ff were being output as "000.".  Some numbers formatted with
'(ABSOLUTE <N> ENGINEERING) looked like "000e-3".

This has been fixed by

  (1) setting the cutoff for NORMAL rounded numbers to be a value that
      will allow the digit production to run to completion
      (flo:significand-digits - 2).

  (2) adding special cases in the output procedures to deal with empty
      digit strings.

Currently:

Zero still prints as "0." by the initial sign/infinity/NaN dispatch.

Rounded output in NORMAL style for numbers with no significant digits
prints as "0." or "-0.".

Rounded output in SCIENTIFIC / ENGINEERING style for numbers with no
significant digits prints as "0eE" or "-0eE", e.g. "-0e3".

It might be preferable to keep "0." distinguished for zero, but I'm
not sure how for NORMAL formatted output.  (To my eyes, "0.0" looks
more `zero' than "0.", and ".0" implies a small magnitude.)

A small regression test has been appended in a comment to help avoid
problems in future.  Feel free to add tests.

27 years agoProvide the ability for a user to specify how the digits generated by
Chris Hanson [Sat, 26 Jul 1997 07:40:41 +0000 (07:40 +0000)]
Provide the ability for a user to specify how the digits generated by
the flonum printer are converted into a string.

27 years agoFix another bug in the Dragon4 code (the bug exists in the original
Chris Hanson [Sat, 26 Jul 1997 07:14:37 +0000 (07:14 +0000)]
Fix another bug in the Dragon4 code (the bug exists in the original
paper).  The bug caused the following behavior:

    (fluid-let ((flonum-unparser-cutoff '(absolute 2 normal)))
      (number->string 0.005))
    ;Value 3: ".01"

    (fluid-let ((flonum-unparser-cutoff '(absolute 2 normal)))
      (number->string 0.00499))
    ;Value 4: ".005"

The problem is that in the second case the trailing digit "5" should
not be generated.  The fix works by preventing any digits being output
by the digit-generation loop when the first digit to be output would
be to the right of the cutoff point.

27 years agoReimplement encrypt-file and decrypt-file to eliminate the temporary
Chris Hanson [Fri, 25 Jul 1997 07:07:24 +0000 (07:07 +0000)]
Reimplement encrypt-file and decrypt-file to eliminate the temporary
storage of the plaintext in a buffer; this is both a security risk and
an unnecessary limitation on the size of the file.  Also, modify the
commands to provide more flexible handling of filenames.  Previously,
only the input file could be specified; now both the input and the
output can be specified, and the output is defaulted to a useful
value.

27 years agoFix bug in AFTER-FIND-FILE: code was assuming that every buffer had an
Chris Hanson [Mon, 21 Jul 1997 04:38:48 +0000 (04:38 +0000)]
Fix bug in AFTER-FIND-FILE: code was assuming that every buffer had an
AUTO-SAVE-PATHNAME.

Add new commands to encrypt and decrypt files using blowfish.

27 years agoAdd optional argument to KEYBOARD-READ which, if true, says that the
Chris Hanson [Mon, 21 Jul 1997 04:37:33 +0000 (04:37 +0000)]
Add optional argument to KEYBOARD-READ which, if true, says that the
key being read should not be recorded in the keyboard history.  This
option is used to prevent passwords from being stored in the history.

27 years agoFix bug: VC was causing a local binding of vc-mode-line-status to
Chris Hanson [Mon, 21 Jul 1997 04:36:12 +0000 (04:36 +0000)]
Fix bug: VC was causing a local binding of vc-mode-line-status to
appear in every buffer, when it should only be bound in buffers under
version control.

27 years agoFix bug: auto-save initialization was not looking for a local binding
Chris Hanson [Mon, 21 Jul 1997 04:34:58 +0000 (04:34 +0000)]
Fix bug: auto-save initialization was not looking for a local binding
of the variable auto-save-default.

27 years agoDon't use alternate pathnames when writing files; only when reading.
Chris Hanson [Mon, 21 Jul 1997 04:33:28 +0000 (04:33 +0000)]
Don't use alternate pathnames when writing files; only when reading.

27 years agoFix bug: end index in substring is exclusive, not inclusive.
Chris Hanson [Sun, 20 Jul 1997 06:38:55 +0000 (06:38 +0000)]
Fix bug: end index in substring is exclusive, not inclusive.
Repaginate.

27 years agoChanged error for non-root access to a warning, so at least we can get
Stephen Adams [Fri, 18 Jul 1997 04:03:01 +0000 (04:03 +0000)]
Changed error for non-root access to a warning, so at least we can get
a .crf file output.

27 years agoChanged FIXNUM->FLONUM back to using cast.
Stephen Adams [Fri, 18 Jul 1997 03:35:53 +0000 (03:35 +0000)]
Changed FIXNUM->FLONUM back to using cast.

I don't understand why the last change was made -- the cast should
have worked, since arg_fixnum() returns a long.  Perhaps I blew it and
tested it on 8.0 and just happen to have fixed the real problem at
about the same time.

27 years agoConditionalize fixnum dependency for allow single file for 7.4 and 8.0
Stephen Adams [Wed, 16 Jul 1997 02:51:07 +0000 (02:51 +0000)]
Conditionalize fixnum dependency for allow single file for 7.4 and 8.0

27 years agoChanged TC_TRUE to TC_CONSTANT
Stephen Adams [Wed, 16 Jul 1997 02:40:39 +0000 (02:40 +0000)]
Changed TC_TRUE to TC_CONSTANT

27 years agoChanged TC_TRUE to TC_CONSTANT in comment
Stephen Adams [Wed, 16 Jul 1997 02:40:13 +0000 (02:40 +0000)]
Changed TC_TRUE to TC_CONSTANT in comment

27 years agoChanged TC_TRUE to TC_CONSTANT.
Stephen Adams [Wed, 16 Jul 1997 02:38:57 +0000 (02:38 +0000)]
Changed TC_TRUE to TC_CONSTANT.

27 years agoConditionalized EMPTY_LIST_VALUE code.
Stephen Adams [Wed, 16 Jul 1997 02:37:41 +0000 (02:37 +0000)]
Conditionalized EMPTY_LIST_VALUE code.

27 years agoA hack: Introduced macro
Stephen Adams [Wed, 16 Jul 1997 02:36:59 +0000 (02:36 +0000)]
A hack: Introduced macro

case_TC_FIXNUMs

for generating case labels for selecting fixnums, whether there are
one or two typecodes.  This tidies up the support in the 8.0 sources
for eitehr case, and allows more files to be shared between 7.4 and
8.0

27 years agoConditionalized EMPTY_LIST initialization for code sharing between 7.4 and 8.0.
Stephen Adams [Wed, 16 Jul 1997 01:46:32 +0000 (01:46 +0000)]
Conditionalized EMPTY_LIST initialization for code sharing between 7.4 and 8.0.

27 years agoMoved GLOBAL_ENV to sdata.h.
Stephen Adams [Tue, 15 Jul 1997 23:26:32 +0000 (23:26 +0000)]
Moved GLOBAL_ENV to sdata.h.

27 years agoMerged in changes to make 7.4 and 8.0 more alike.
Stephen Adams [Tue, 15 Jul 1997 22:54:57 +0000 (22:54 +0000)]
Merged in changes to make 7.4 and 8.0 more alike.

27 years agoFixed the trap debugging primitive
Stephen Adams [Tue, 15 Jul 1997 22:31:53 +0000 (22:31 +0000)]
Fixed the trap debugging primitive
INSTRUCTION-ADDRESS->COMPILED-CODE-BLOCK to handle integer arguments
correctly.

27 years agoAdd ADDRESS_HEAP_P to match existing predicate ADDRESS_CONSTANT_P
Stephen Adams [Tue, 15 Jul 1997 22:06:24 +0000 (22:06 +0000)]
Add ADDRESS_HEAP_P to match existing predicate ADDRESS_CONSTANT_P

27 years agofile: purify.c
Stephen Adams [Tue, 15 Jul 1997 21:34:36 +0000 (21:34 +0000)]
file: purify.c
file: bchmmg.c
file: memmag.c

Define EMPTY_WEAK_CHAIN for use in terminating the weak chain rather
that EMPTY_LIST.

This allows purify.c, bchmmg.c and memmag.c to be shared by 7.4 and 8.0.

27 years agoEliminate NT compiler warning.
Stephen Adams [Tue, 15 Jul 1997 20:57:06 +0000 (20:57 +0000)]
Eliminate NT compiler warning.

27 years agoDisregard working directory when file is loaded; use directory that
Stephen Adams [Tue, 15 Jul 1997 18:32:04 +0000 (18:32 +0000)]
Disregard working directory when file is loaded; use directory that
file is loaded from instead.

27 years agoUpdate copyright date.
Stephen Adams [Tue, 15 Jul 1997 18:22:21 +0000 (18:22 +0000)]
Update copyright date.

27 years agoSmall changes to allow butils.scm to be shared between 7.4 and 8.0
Stephen Adams [Tue, 15 Jul 1997 17:54:48 +0000 (17:54 +0000)]
Small changes to allow butils.scm to be shared between 7.4 and 8.0

27 years agoMerge 7.4 and 8.0 versions on scomb.scm
Stephen Adams [Tue, 15 Jul 1997 17:29:56 +0000 (17:29 +0000)]
Merge 7.4 and 8.0 versions on scomb.scm

Changed UNDEFINED-CONDITIONAL-BRANCH to be UNSPECIFIC directly, rather
than trying to reconstruct the same machine-dependent bit-pattern.

27 years agoChange to get rid of minor difference between 7.4 and 8.0 versions of
Stephen Adams [Tue, 15 Jul 1997 16:33:38 +0000 (16:33 +0000)]
Change to get rid of minor difference between 7.4 and 8.0 versions of
unpars.scm:

Renamed
  COMPILED-ENTRY/FILENAME -> COMPILED-ENTRY/FILENAME-AND-INDEX
  COMPILED-CODE-BLOCK/FILENAME -> COMPILED-CODE-BLOCK/FILENAME-AND-INDEX

27 years agoMerged 7.4 and 8.0 udata.scm files.
Stephen Adams [Tue, 15 Jul 1997 16:05:24 +0000 (16:05 +0000)]
Merged 7.4 and 8.0 udata.scm files.
(Main benefit is the much faster compiled version of FORCE).

Removed FORCE from integrated primitives.

Added COMPILED-CODE-BLOCK/MARKED-START which returns the index that
COMPILED-CODE-BLOCK/CONSTANTS-START used to.
COMPILED-CODE-BLOCK/CONSTANTS-START now parses over the linkage
section.

Changed i386 disassembler to use COMPILED-CODE-BLOCK/MARKED-START.

27 years agoMerged the 7.4 and 8.0 versions of string.scm now that INDEX-FIXNUM?
Stephen Adams [Tue, 15 Jul 1997 05:16:25 +0000 (05:16 +0000)]
Merged the 7.4 and 8.0 versions of string.scm now that INDEX-FIXNUM?
is open-coded by both compilers.  Moved string.scm into a new package
(runtime string).

27 years agoUse FIXNUM_TO_DOUBLE rather than a cast. Casting a fixnum to a double
Stephen Adams [Tue, 15 Jul 1997 05:09:17 +0000 (05:09 +0000)]
Use FIXNUM_TO_DOUBLE rather than a cast.  Casting a fixnum to a double
fortuitously worked under 8.0 with `native' fixnum tags but didn't
work under 7.4.

27 years agoAdded open-coding for the primitive INDEX-FIXNUM?
Stephen Adams [Tue, 15 Jul 1997 03:01:26 +0000 (03:01 +0000)]
Added open-coding for the primitive INDEX-FIXNUM?

27 years agoAdded INDEX-FIXNUM? as integrated constant.
Stephen Adams [Tue, 15 Jul 1997 00:49:27 +0000 (00:49 +0000)]
Added INDEX-FIXNUM? as integrated constant.

27 years agoMade previos chaneg work under 7.4 and 8.0
Stephen Adams [Mon, 14 Jul 1997 19:38:35 +0000 (19:38 +0000)]
Made previos chaneg work under 7.4 and 8.0

27 years agoUse EMPTY_WEAK_CHAIN for weak pair chain instead of EMPTY_LIST.
Stephen Adams [Mon, 14 Jul 1997 17:59:57 +0000 (17:59 +0000)]
Use EMPTY_WEAK_CHAIN for weak pair chain instead of EMPTY_LIST.

27 years agoInitialize number parser.
Chris Hanson [Sun, 13 Jul 1997 07:24:46 +0000 (07:24 +0000)]
Initialize number parser.

27 years ago8.0 debugging changes.
Stephen Adams [Sat, 12 Jul 1997 04:23:26 +0000 (04:23 +0000)]
8.0 debugging changes.

Added a procedure COMPILED-CODE-BLOCK/NAME to guess the name of the
procedure in the compiled code block.  If the dbg info has only one
top-level procedure then use the name of that procedure, otherwise
return false.  Requires LOAD-DEBUGGING-INFO-ON-DEMAND? to be true to
load the dbg info.

Fixed HARDWARE-TRAP-FRAME/DESCRIBE to use the new 8.0 debugging
information - it was an oversight that it was still trying to use the
old debugging locator to identify the file name for the compiled code
block.  Also use COMPILED-CODE-BLOCK/NAME to identify the procedure.

Together, these changes mean that (with LOAD-DEBUGGING-INFO-ON-DEMAND?
true), SIGSEGVs and SIGFPEs can usually identify the offending
procedure by name.

27 years agoChanged INT:->INEXACT to use INTEGER->FLONUM and FIXNUM->FLONUM, now
Stephen Adams [Fri, 11 Jul 1997 03:24:10 +0000 (03:24 +0000)]
Changed INT:->INEXACT to use INTEGER->FLONUM and FIXNUM->FLONUM, now
that INTEGER->FLONUM has been fixed to work correctly.  Note that the
8.0 compiler can open-code FIXNUM->FLONUM.

27 years agoFIXNUM->FLONUM is open-coded, but only if argument is a known fixnum.
Stephen Adams [Fri, 11 Jul 1997 02:35:04 +0000 (02:35 +0000)]
FIXNUM->FLONUM is open-coded, but only if argument is a known fixnum.

27 years agoBug fixes:
Stephen Adams [Thu, 10 Jul 1997 09:25:06 +0000 (09:25 +0000)]
Bug fixes:

  . "1/"  returns #F instead of signalling divide by zero.

  . "1.2345e-306" and "1e-400" with FLONUM-PARSER-FAST? true no longer
     signal arithmetic errors.

  . STRING->NUMBER and SUBSTRING->NUMBER now check their arguments

Other changes: FINISH-REAL now exploits the fact that some integers
have exact floating point representations and so flonum arithmetic can
be used to compute the correct result.  Note that to maintain
correctness, i*10^-e must be calculated as i/10^e.  The results are a
modest improvement on free-formatted random flonums (typically 16
digit) in the range 1e-7 to 1e35:

Times for 10000 flonums generated by (random range)

range 1e-100 1e-10 1e-5 1. 1e5 1e10 1e35 1e40
old 10180 8200 8210 7490 5610 3970 3990 4030
new 10280 8350 4690 4390 3930 3230 3180 4170

With FLONUM-PARSER-FAST? true, using the division trick gives better
error rates over a larger range.  Number of errors in 10000 random
flonums

range 1e-20 1e-10 1e-6 1. 1e10 1e20 1e35 1e40
old 3573 2400 3309 2798 3025  685  722 2730
new 2594 2778 1907 1010  761  685  772 2730

27 years agoBug fixes:
Stephen Adams [Thu, 10 Jul 1997 09:16:23 +0000 (09:16 +0000)]
Bug fixes:

  . "1/"  returns #F instead of signalling divide by zero.

  . "1.2345e-306" and "1e-400" with FLONUM-PARSER-FAST? true no longer
     signal arithmetic errors.

  . STRING->NUMBER and SUBSTRING->NUMBER now check their arguments

Other changes: FINISH-REAL now exploits the fact that some integers
have exact floating point representations and so flonum arithmetic can
be used to compute the correct result.  Note that to maintain
correctness, i*10^-e must be calculated as i/10^e.  The results are a
modest improvement on free-formatted random flonums (typically 16
digit) in the range 1e-7 to 1e35:

Times for 10000 flonums generated by (random range)

range 1e-100 1e-10 1e-5 1. 1e5 1e10 1e35 1e40
old 10180 8200 8210 7490 5610 3970 3990 4030
new 10280 8350 4690 4390 3930 3230 3180 4170

With FLONUM-PARSER-FAST? true, using the division trick gives better
error rates over a larger range.  Number of errors in 10000 random
flonums

range 1e-20 1e-10 1e-6 1. 1e10 1e20 1e35 1e40
old 3573 2400 3309 2798 3025  685  722 2730
new 2594 2778 1907 1010  761  685  772 2730

27 years agoFix a couple of typos.
Chris Hanson [Thu, 10 Jul 1997 06:35:34 +0000 (06:35 +0000)]
Fix a couple of typos.

27 years agoAdded missing open-coders for:
Stephen Adams [Wed, 9 Jul 1997 15:12:44 +0000 (15:12 +0000)]
Added missing open-coders for:

SYSTEM-PAIR-SET-CAR! SYSTEM-PAIR-SET-CDR!
SYSTEM-HUNK3-SET-CXR0! SYSTEM-HUNK3-SET-CXR1! SYSTEM-HUNK3-SET-CXR2!

27 years agoImplemented FORCE as a compiled procedure. SF no longer integrates
Stephen Adams [Wed, 9 Jul 1997 14:40:07 +0000 (14:40 +0000)]
Implemented FORCE as a compiled procedure.  SF no longer integrates
FORCE as a primitive procedure.

There is a minor bootstrapping problem with the standard build
scripts since any pre-existing version of SF will integrate the
primitive FORCE, and SF is only run on files that have changed.
A solution is:

    1. rebuild the system
    2. remove any .bin files that call FORCE
    3. rebuild the system using bands produced in step 1.

Timings under Scheme 8.0 on plex:

Test Primitive Compiled
 [1]  10370ms   560ms
 [2]    180ms   130ms
 [3]       440ms   270ms

(let ((nums (list->stream (make-initialized-list 100001 identity-procedure)))
      (primes
       ((access make-prime-numbers-stream (->environment '(runtime stream))))))
  (show-time (lambda () (stream-ref nums 100000)))    ; [1]
  (show-time (lambda () (stream-ref nums 100000)))    ; [2]
  (show-time (lambda () (stream-ref primes 1000))))   ; [3]

27 years agoAdded rules for rewriting (INTEGER->FLONUM N <flags>) to (FIXNUM->FLONUM N).
Stephen Adams [Wed, 9 Jul 1997 06:44:01 +0000 (06:44 +0000)]
Added rules for rewriting (INTEGER->FLONUM N <flags>) to (FIXNUM->FLONUM N).

27 years agoImproved range of analysis for REMAINDER & INTEGER-REMAINDER.
Stephen Adams [Wed, 9 Jul 1997 02:25:53 +0000 (02:25 +0000)]
Improved range of analysis for REMAINDER & INTEGER-REMAINDER.
INT:comparisons reduce to FIX: version for suitable arguments.
INTEGER-ZERO? reduced to EQ? for exact integer arguments.

27 years agoChanged bignum_to_double to produce a correctly rounded result. The
Stephen Adams [Tue, 8 Jul 1997 19:12:51 +0000 (19:12 +0000)]
Changed bignum_to_double to produce a correctly rounded result.  The
code is a lot hairier since it implements IEEE style round to even,
but it is not much slower than the old `accumulate' loop since it
rarely has to look at more that two or three words.

The new version no longer signals an floating point overflow error on

(INTEGER->FLONUM (- (EXPT 2 1024) 1) #b10)

This means that (INTEGER->FLONUM N #b10) can again be used for computing
EXACT->INEXACT on exact integers, which should be 5-15x faster.

There were several places which has a loop to find the bit position of
the most significant bit in a word.  This code has been converted into
a macro, and tweaked to be a bit faster.  Presumably some machines
have this operation as an instruction.

27 years agoChange integer_length_in_bits to return a fixnum if possible.
Stephen Adams [Tue, 8 Jul 1997 06:25:59 +0000 (06:25 +0000)]
Change integer_length_in_bits to return a fixnum if possible.

27 years agoSpeed up RATIO->FLONUM and INT:->INEXACT by using (INTEGER->FLONUM N
Stephen Adams [Tue, 8 Jul 1997 06:04:02 +0000 (06:04 +0000)]
Speed up RATIO->FLONUM and INT:->INEXACT by using (INTEGER->FLONUM N
#b11) when N is small enough that it has an `exact' flonum
representation.  A prior log message comments on this, but the code
does not seem to take advantage.

DISCUSSION:

Question:  why is (INT:->INEXACT N) not simply (INTEGER->FLONUM N #b10) ?

(EXACT->INEXACT (expt 2 3000)) used to fail in INTEGER->FLONUM,
but now it returns MAXDOUBLE (due to ldexp), but an Infinity or an error
would seem better.

R4RS says: If an exact argument has no reasonably close inexact
equivalent, the a violation of an implementation restriction may be
reported.

I would read this as NOT returning MAXDOUBLE as, say, 2^3000 is not
`reasonably close' to any FP number.

A previous log entry says INTEGER->FLONUM does not round reliably.
This is because bignum_to_double in "bignum.c" accumulates, which may
cause error due to intermediate rounding.

Perhaps bignum_to_double should be changed to extract the top 53 bits
and explicitly calculate the exponent; another test would be required
in place of bignum_fits_in_word_p, which does not (and should not)
understand rounding carry.  Currently, calling bignum_to_double on

(- (expt 2 1024) 1)

signals a floating point overflow or returns an infinity depending on
which FPU exceptions are enabled.

If bignum_to_double was fixed it could be a lot faster than all the
current bignum arithmetic.

27 years agoFixed thinko in FIXNUM->FLONUM.
Stephen Adams [Tue, 8 Jul 1997 03:07:06 +0000 (03:07 +0000)]
Fixed thinko in FIXNUM->FLONUM.

27 years agoChanges in INT:->STRING to improve performance. 30% faster for huge
Stephen Adams [Tue, 8 Jul 1997 01:22:28 +0000 (01:22 +0000)]
Changes in INT:->STRING to improve performance.  30% faster for huge
bignums (10^1000), up to 2x-3x faster for small bignums (up to
10^100), slightly faster for fixnums.

 . Use a local version of DIGIT->CHAR since we don't need to check the
   radix.

 . PRINT-FIXNUM modified to be useful for generating digits in the
   middle of a number.

 . PRINT-MEDIUM and PRINT-LARGE work in units of several digits, the
   length of a unit pre-computed so that a unit can be printed using
   fixnum arithmetic.

 . PRINT-MEDIUM chops off groups of digits that can be printed by
   PRINT-FIXNUM.  The microcode primitive LISTIFY-BIGNUM is no longer
   used.

 . PRINT-LARGE has a special check to try to avoid the last multiply
   in building the power stack (which is asymptotically 2/3 of the
   cost of building the stack).  The recursion termination check is
   generalized to also catch sequences of digits with enough leading
   zeroes to be formatted by PRINT-FIXNUM (this can double the speed
   of printing numbers with many zeros).

27 years agoRename "c+e" to "all".
Chris Hanson [Mon, 7 Jul 1997 23:27:44 +0000 (23:27 +0000)]
Rename "c+e" to "all".

27 years agoChanges in INT:->STRING to improve performance. 30% faster for huge
Stephen Adams [Mon, 7 Jul 1997 20:24:45 +0000 (20:24 +0000)]
Changes in INT:->STRING to improve performance.  30% faster for huge
bignums (10^1000), up to 2x-3x faster for small bignums (up to
10^100), slightly faster for fixnums.

 . Use a local version of DIGIT->CHAR since we don't need to check the
   radix.

 . PRINT-FIXNUM modified to be useful for generating digits in the
   middle of a number.

 . PRINT-MEDIUM and PRINT-LARGE work in units of several digits, the
   length of a unit pre-computed so that a unit can be printed using
   fixnum arithmetic.

 . PRINT-MEDIUM chops off groups of digits that can be printed by
   PRINT-FIXNUM.  The microcode primitive LISTIFY-BIGNUM is no longer
   used.

 . PRINT-LARGE has a special check to try to avoid the last multiply
   in building the power stack (which is asymptotically 2/3 of the
   cost of building the stack).  The recursion termination check is
   generalized to also catch sequences of digits with enough leading
   zeroes to be formatted by PRINT-FIXNUM (this can double the speed
   of printing numbers with many zeros).

27 years agoIn bignum_remainder, replaced special case for remainder by `1' with a
Stephen Adams [Fri, 4 Jul 1997 16:02:18 +0000 (16:02 +0000)]
In bignum_remainder, replaced special case for remainder by `1' with a
special case for remainder by small power of two.

27 years agoPerformance enhancements:
Stephen Adams [Thu, 3 Jul 1997 21:55:23 +0000 (21:55 +0000)]
Performance enhancements:

1. Changed DRAGON4-FIXUP to use fast scaling similar to described in
   Burger and Dybvig (reference in file).  This makes an order of
   magnitude difference for unparsing flonums with large exponents.

2. Changed DRAGON4 to pass exponent to DRAGON4-FIXUP for scaling
   estimate.

3. Systematically replaced calls to generic operators with calls to
   int: variants (and rat:expt).  The vast majority of operations are
   on bignums.  Gives a gain of about 20%.

Timings (Non-GC runtime) in msec for 1000 calls on 200Mhz Pentium Pro.

Example Number Original Fast Scaling and INT:ops

3.141592653589793 840 820 580
1022. 320 300 230
1.234e300 4870 490 400
1.23456e-300 7130 680 540

It is still pretty sad that you can format only a few thousand numbers
per second.

PC-sampling shows that most of the time is spent as follows:

 (27% primitive 253 "INTEGER-MULTIPLY")
 (24% primitive 200 "GARBAGE-COLLECT")
 (24% primitive 248 "INTEGER-DIVIDE")
 (5%. primitive 260 "INTEGER-SUBTRACT")

27 years agoMake sure that RMAIL variables are initialized before they are used.
Chris Hanson [Thu, 3 Jul 1997 07:23:07 +0000 (07:23 +0000)]
Make sure that RMAIL variables are initialized before they are used.

27 years agoFix bug introduced by last change.
Chris Hanson [Fri, 27 Jun 1997 20:56:18 +0000 (20:56 +0000)]
Fix bug introduced by last change.

27 years agoToe the current ideological line.
Chris Hanson [Fri, 27 Jun 1997 18:51:46 +0000 (18:51 +0000)]
Toe the current ideological line.

27 years agoFix typo.
Stephen Adams [Fri, 27 Jun 1997 14:06:10 +0000 (14:06 +0000)]
Fix typo.

27 years agoFixed a bug in argument checking SUBSTRING. Introduced
Stephen Adams [Thu, 26 Jun 1997 23:40:24 +0000 (23:40 +0000)]
Fixed a bug in argument checking SUBSTRING.  Introduced
GUARANTEE-SUBSTRING and edited other procedures to use it.

27 years agoFixed a bug in argument checking SUBSTRING. Introduced
Stephen Adams [Thu, 26 Jun 1997 22:55:46 +0000 (22:55 +0000)]
Fixed a bug in argument checking SUBSTRING.  Introduced
GUARANTEE-SUBSTRING and edited other procedures to use it.

27 years agoDon't use the external Scheme DLL any more. This is important for the
Chris Hanson [Thu, 26 Jun 1997 07:05:11 +0000 (07:05 +0000)]
Don't use the external Scheme DLL any more.  This is important for the
moment as I have not yet figured out how to make working DLLs with the
new Watcom compiler.  However, the Scheme DLL probably doesn't matter
any more as we no longer care about Windows 3.1.

27 years agoWatcom 11: use __try/__except for new version of Watcom compiler, as
Chris Hanson [Thu, 26 Jun 1997 07:02:22 +0000 (07:02 +0000)]
Watcom 11: use __try/__except for new version of Watcom compiler, as
it is now fixed and works properly.

27 years agoWatcom 11: eliminate compiler warning.
Chris Hanson [Thu, 26 Jun 1997 06:59:54 +0000 (06:59 +0000)]
Watcom 11: eliminate compiler warning.

27 years agoWatcom 11: various changes.
Chris Hanson [Thu, 26 Jun 1997 06:56:24 +0000 (06:56 +0000)]
Watcom 11: various changes.

27 years agoWatcom 11: needs kernel and user librarys named explicitly now.
Chris Hanson [Thu, 26 Jun 1997 06:56:04 +0000 (06:56 +0000)]
Watcom 11: needs kernel and user librarys named explicitly now.

27 years agoChange for Watcom 11: documentation claims that 0 is not a valid value
Chris Hanson [Thu, 26 Jun 1997 06:55:29 +0000 (06:55 +0000)]
Change for Watcom 11: documentation claims that 0 is not a valid value
for the stack-size parameter to beginthreadx.

27 years agoChange RCS-FIND-DELTA to have an extra argument saying whether or not
Chris Hanson [Wed, 25 Jun 1997 07:26:48 +0000 (07:26 +0000)]
Change RCS-FIND-DELTA to have an extra argument saying whether or not
to signal an error if there is no such delta.  Use this feature to
make VC-NEXT-ACTION do the right thing when it is given a version
number that doesn't exist.

27 years agoChange RCS-FIND-DELTA to have an extra argument saying whether or not
Chris Hanson [Wed, 25 Jun 1997 07:25:08 +0000 (07:25 +0000)]
Change RCS-FIND-DELTA to have an extra argument saying whether or not
to signal an error if there is no such delta.

27 years agoExtensive changes corresponding to new release of SOS that uses
Chris Hanson [Wed, 25 Jun 1997 07:23:10 +0000 (07:23 +0000)]
Extensive changes corresponding to new release of SOS that uses
generic procedure support provided by the runtime system.

27 years agoExtensive changes corresponding to new release of SOS that uses
Chris Hanson [Wed, 25 Jun 1997 07:22:56 +0000 (07:22 +0000)]
Extensive changes corresponding to new release of SOS that uses
generic procedure support provided by the runtime system.

27 years agoAllow computed methods to return concrete methods as well as
Chris Hanson [Wed, 25 Jun 1997 06:18:30 +0000 (06:18 +0000)]
Allow computed methods to return concrete methods as well as
procedures, provided that the returned method's specializers are
restrictions of the computed method's specializers.

27 years agoDelete accessor slot properties after they are used. This prevents
Chris Hanson [Wed, 25 Jun 1997 05:31:31 +0000 (05:31 +0000)]
Delete accessor slot properties after they are used.  This prevents
them from holding on to the generic procedures, and from defining
identical methods for each subclass.

27 years agoFix typo.
Chris Hanson [Wed, 25 Jun 1997 04:03:55 +0000 (04:03 +0000)]
Fix typo.

27 years agoFix think-o.
Chris Hanson [Wed, 25 Jun 1997 04:02:57 +0000 (04:02 +0000)]
Fix think-o.

27 years agoAllow INSTANCE-PREDICATE to take a specializer as an argument rather
Chris Hanson [Wed, 25 Jun 1997 03:52:41 +0000 (03:52 +0000)]
Allow INSTANCE-PREDICATE to take a specializer as an argument rather
than just a class.

27 years agoError-check arguments to MAKE-CLASS. Make sure that dispatch tag of
Chris Hanson [Wed, 25 Jun 1997 03:51:58 +0000 (03:51 +0000)]
Error-check arguments to MAKE-CLASS.  Make sure that dispatch tag of
record-type class is correct.

27 years agoAllow record types to be used in place of classes wherever sensible.
Chris Hanson [Wed, 25 Jun 1997 03:44:50 +0000 (03:44 +0000)]
Allow record types to be used in place of classes wherever sensible.

27 years agoSignal CONDITION-TYPE:NO-SUCH-SLOT when given an invalid slot name.
Chris Hanson [Wed, 25 Jun 1997 03:43:03 +0000 (03:43 +0000)]
Signal CONDITION-TYPE:NO-SUCH-SLOT when given an invalid slot name.

27 years agoSignal CONDITION-TYPE:NO-SUCH-SLOT when given an invalid slot name.
Chris Hanson [Wed, 25 Jun 1997 03:28:58 +0000 (03:28 +0000)]
Signal CONDITION-TYPE:NO-SUCH-SLOT when given an invalid slot name.

27 years agoAdd CONDITION-TYPE:NO-SUCH-SLOT and modify record code to signal this
Chris Hanson [Wed, 25 Jun 1997 03:28:26 +0000 (03:28 +0000)]
Add CONDITION-TYPE:NO-SUCH-SLOT and modify record code to signal this
error when given an invalid slot name.