define-condition: return the name of the defined condition.
- [DH] NEWS
- [DH] src/code/condition.lisp
- [DH] tests/condition.impure.lisp
(May 16, 2012 10:51 PM)
Better error for malformed type declarations.
Give proper error messages for things like
(declare (type (integer 1 . 2) a)).
- [DH] NEWS
- [DH] src/code/parse-defmacro-errors.lisp
- [DH] tests/compiler.pure.lisp
(May 16, 2012 04:30 PM)
Better error message for malformed IGNORE declarations.
Give better errors for things like (ignore (a)) and
(ignore (function . b)).
Fixes lp#1000239.
- [DH] NEWS
- [DH] src/compiler/ir1tran.lisp
- [DH] tests/compiler.pure.lisp
(May 16, 2012 03:04 PM)
Optimize copy-tree.
copy-tree used to always call itself, even on linear lists, which
caused stack exhaustion on long lists. Make it copy linear lists
linearly, and recur only when necessary. This also makes it somewhat
faster.
Fixes lp#98926.
- [DH] NEWS
- [DH] src/code/list.lisp
(May 14, 2012 01:12 AM)
open intervals and type derivation
When dealing with open intervals, preserving the openness of a bound in
a result depends on the operation being strictly monotonic, rather than
merely monotonic. However, many operations which at first sight seem
strictly monotonic are in fact not, including:
- squaring (expt least-positive-double-float 2) = (expt 0d0 2)
- coercion (coerce (1+ double-float-epsilon) 'single-float)
= (coerce 1d0 'single-float)
Modify various coercion and interval functions to include conservatism
in these situations. (Fixes lp#997528)
- [DH] NEWS
- [DH] src/compiler/float-tran.lisp
- [DH] src/compiler/srctran.lisp
- [DH] tests/compiler.impure.lisp
(May 12, 2012 12:40 PM)
Fix --dynamic-space-size 1GB on x86.
Use unsigned longs instead of signed longs for handling
--dynamic-space-size, on x86 it can easily be exhausted.
- [DH] NEWS
- [DH] src/runtime/runtime.c
(May 9, 2012 10:47 PM)
Optimize truncate, ceiling and friends when divisor is 1 or -1.
If divisor is 1, return (values x 0), if it's -1 (values (- x) 0). If
it's a floating point truncation, like ftruncate or fceiling,
(values (- (float x)) 0).
- [DH] NEWS
- [DH] src/compiler/srctran.lisp
(May 7, 2012 12:18 PM)
Update ASDF to 2.21.
Fixes lp#982286.
- [DH] NEWS
- [DH] contrib/asdf/asdf.lisp
- [DH] contrib/asdf/asdf.texinfo
(May 5, 2012 09:38 AM)
don't unconditionally unparse CHARACTER-SET types into MEMBER types
Doing so means dumping a list containing most of unicode for each
function that return something like
(code-char (+ <const> <(integer 0)>))
which has a derived type (CHARACTER-SET ((<const> . 1114111))).
Instead, pick whichever is more compact, using number of characters
vs number of character code ranges as the deciding factor.
This means that users can see SB-KERNEL:CHARACTER-SET types in
eg. output from DESCRIBE or as return values from
SB-INTROSPECT:FUNCTION-TYPE -- which is suboptimal, but less bad
than such types slowing us down as horribly as they do prior to this
change.
At some point, however, we should document and export SB-EXT:CHARSET
or something -- but I don't want to think of the issues associated
with a public interface right now.
- [DH] NEWS
- [DH] src/code/late-type.lisp
- [DH] tests/character.pure.lisp
(May 4, 2012 09:43 AM)
better timeout handling in EXIT and %EXIT-OTHER-THREADS
Account the timeout against all the threads being joined, not each
separately.
Also move handling of "main thread exiting even though another
thread got the call" handling to %EXIT.
...and one missing #!+sb-doc
- [DH] package-data-list.lisp-expr
- [DH] src/code/cold-init.lisp
- [DH] src/code/late-extensions.lisp
- [DH] src/code/target-thread.lisp
- [DH] src/code/toplevel.lisp
(May 3, 2012 10:25 AM)
sb-posix: abort(3), exit(3), and _exit(2)
Also fix docstring of SB-EXT:EXIT, which referred to exit as being section 2.
- [DH] NEWS
- [DH] contrib/sb-posix/defpackage.lisp
- [DH] contrib/sb-posix/interface.lisp
- [DH] contrib/sb-posix/macros.lisp
- [DH] src/code/cold-init.lisp
(May 2, 2012 01:46 PM)
more deprecation
* Add "Deprecated Interfaces" chapter to the manual.
* Add list of deprecated interfaces along with a policy note to a
comment near DEFINE-DEPRECATED-FUNCTION.
* Add a proper deprecation warning for SB-C::MERGE-TAIL-CALLS.
* Fix the deprecation warning for WITH-SPINLOCK. (Accidentally
referred to WITH-RECURSIVE-SPINLOCK before.)
- [DH] doc/manual/deprecated.texinfo
- [DH] doc/manual/sbcl.texinfo
- [DH] src/code/early-extensions.lisp
- [DH] src/code/thread.lisp
- [DH] src/compiler/policies.lisp
- [DH] src/compiler/policy.lisp
(May 2, 2012 11:48 AM)
Better equidistributed and faster/less consing integer RANDOM.
Up to now the implementation of RANDOM with an integer argument just
generated a few more random bits than the length of the argument and
took this value MOD the argument. This led to a slightly uneven
distribution of the possible values unless the argument was a power of
two. Moreover, for bignums, the algorithm was quadratic both in time and
space dependent on the number of bits of the argument.
Instead generate random integers using an accept-reject loop and change
the bignum implementation to an algorithm that is linear in time and
space.
I took some inspiration from WHN's attempt at an accept-reject loop
implementation in commit 0a7604d54581d2c846838c26ce6a7993629586fa and
following.
Thanks to Christophe Rhodes for reviewing this patch!
Some details:
The implementation works correctly with both a random chunk size equal
to the word size and equal to half the word size. This is currently
necessary as a 32-bit pseudo random generator is used both under 32 and
under 64 bit word size.
In the generic RANDOM case, fixnum and bignum limits are differentiated:
With a fixnum limit an accept-reject loop on a masked random chunk is
always used. Under 64 bit word size two random chunks are used only if
the limit is so large that one doesn't suffice. This never conses.
With a bignum limit four cases are differentiated to minimize consing.
If just one random chunk is needed to supply a sufficient number of bits
the implementation only conses if the result is indeed a bignum:
* If the limit is a power of two, a chunk is generated and shifted to
get the correct number of bits.
* If the limit is not a power of two an accept-reject loop with shifting
is used.
If more than one random chunk is needed, a bignum is always consed even
if it happens to normalize to a fixnum:
* If the limit is a power of two a straightforward algorithm is used to
fill a newly created bignum with random bits.
* If the limit is not a power of two an accept-reject loop is used that
detects rejection early by starting from the most significant bits,
thus generating on the average only one random chunk more than needed
to fill the result once.
The test for power of two is non-consing, too.
In the case of a compile-time constant integer argument (of at most word
size) a DEFTRANSFORM triggers, that, in the general case, compiles an
accept-reject loop. For values of the limit where this sufficiently
reduces the rejection probability the largest multiple of the limit
fitting in one or two random chunks is used instead inside the loop.
To bring the result in the correct range a division is then necessary
(which the compiler converts into a multiplication). Powers of two are
optimized by leaving out the rejection test. In those cases where a word
has more bits than a random chunk, the generated expression uses two
chunks only if necessary.
- [DH] NEWS
- [DH] build-order.lisp-expr
- [DH] package-data-list.lisp-expr
- [DH] src/code/bignum-random.lisp
- [DH] src/code/random.lisp
- [DH] src/code/target-random.lisp
- [DH] src/compiler/float-tran.lisp
- [DH] tests/random.pure.lisp
(May 1, 2012 04:59 PM)
runtime clean up.
coreparse.c: Move #define _BSD_SOURCE up, so that it won't conflict
with subsequent files, and #undef it after it's used to
include sys/mman.h
search.c(search_for_type): Remove unused variable addr.
interrupt.c: Remove double parentheses in if((x==y)).
run-program.c: Include sys/wait.h
- [DH] src/runtime/coreparse.c
- [DH] src/runtime/interrupt.c
- [DH] src/runtime/run-program.c
- [DH] src/runtime/search.c
(May 1, 2012 04:42 PM)
Add some tests for basic RANDOM functionality.
There are currently few, if any, such tests, so ahead of profound
changes to integer RANDOM add some. They are neither systematic nor
comprehensive but should be better than nothing.
- [DH] tests/random.pure.lisp
(May 1, 2012 04:07 PM)
Fix the DEFTRANSFORM of RANDOM for hairy integer types.
With integer types that are neither an interval nor a single known value
the DEFTRANSFORM used to generate an expression that had two problems:
First, it yielded very uneven distributions of random values for most
arguments to RANDOM that are not very small. Second, it used a too small
RANDOM-CHUNK under 64 bits word size thus never generating numbers
larger than (1- (EXPT 2 32)) even if RANDOM's argument was larger than
(EXPT 2 32).
Fix this by giving up the transform in these cases.
Add a new file "tests/random.pure.lisp" containing tests for this.
- [DH] src/compiler/float-tran.lisp
- [DH] tests/random.pure.lisp
(May 1, 2012 01:57 PM)
add SB-UNIX:UNIX-EXIT back, use the deprecation framwork for it and SB-EXT:QUIT
Also extend the deprecation framwork to support multiple replacements:
SB-EXT:QUIT should be replaced either by SB-EXT:EXIT or SB-EXT:ABORT-THREAD,
depending on the way it was being used.
- [DH] package-data-list.lisp-expr
- [DH] src/code/cold-init.lisp
- [DH] src/code/condition.lisp
- [DH] src/code/early-extensions.lisp
- [DH] src/code/unix.lisp
(May 1, 2012 11:30 AM)