sbcl.git
11 years agoremove stray debugging code from condition-related patches
Christophe Rhodes [Sun, 14 Apr 2013 05:49:57 +0000 (06:49 +0100)]
remove stray debugging code from condition-related patches

11 years agoHandle :ALLOCATION of condition slots correctly
Jan Moringen [Fri, 5 Apr 2013 09:59:37 +0000 (11:59 +0200)]
Handle :ALLOCATION of condition slots correctly

Previously, DEFINE-CONDITION failed to pass the :ALLOCATION slot
option to MAKE-CONDITION-SLOT.

A test case has been added.

fixes lp#1049404

11 years agoEvaluate condition default initargs once, even after redefinition
Jan Moringen [Fri, 5 Apr 2013 10:24:37 +0000 (12:24 +0200)]
Evaluate condition default initargs once, even after redefinition

There were two causes of this failure

* %DEFINE-CONDITION did not clear CONDITION-CLASSOID-HAIRY-SLOTS when
  a condition was redefined. This led to multiple copies of slots in
  CONDITION-CLASSOID-HAIRY-SLOTS and thus to initforms being evaluated
  multiple times. %DEFINE-CONDITION now clears
  CONDITION-CLASSOID-HAIRY-SLOTS before populating it again.

* (MAKE-INSTANCE CONDITION-CLASS) produced the call tree
  MAKE-INSTANCE
  + ALLOCATE-INSTANCE SLOT-OBJECT
    + MAKE-CONDITION
  + INITIALIZE-INSTANCE SLOT-OBJECT
    + SHARED-INITIALIZE SLOT-OBJECT
  MAKE-CONDITION  and SHARED-INITIALIZE both called initfunctions
  leading to multiple evaluations

A test case has been added.

fixes lp#1164969

11 years agoUse AMOP representation of canonicalized default initargs for conditions
Jan Moringen [Fri, 5 Apr 2013 10:31:06 +0000 (12:31 +0200)]
Use AMOP representation of canonicalized default initargs for conditions

This fixes two issues:

1. CLASS-DIRECT-DEFAULT-INITARGS did not work for condition
   classes (bug 1164970)

2. Constant functions as default initargs of condition classes did not
   work correctly (bug 539517)

The following things have been changed:

* CONDITION-CLASSOID-DEFAULT-INITARGS is now called
  CONDITION-CLASSOID-DIRECT-DEFAULT-INITARGS to better reflect its
  purpose.

* Previously, default initargs of condition classes where stored in a
  plist the values of which where constant initforms or
  initfunctions. Now default initargs of condition classes are always
  of the form

    (INITARG INITFORM THUNK)

  as described in AMOP.

* The SHARED-INITIALIZED :AFTER CONDITION-CLASS T method now stores
  the direct default initargs in the class plist. These are now of the
  correct form as described in the previous bullet point.

* The DOPLIST macro used to be defined in src/pcl/macros.lisp. It is
  now in src/code/early-extensions.lisp and exported from SB-INT. This
  was necessary to use DOPLIST in src/code/condition.lisp.

* Unit test for both problems have been added.

fixes lp#539517, fixes lp#1164970

11 years agoDisassemble: print the function size in bytes.
Stas Boukarev [Fri, 12 Apr 2013 15:27:50 +0000 (19:27 +0400)]
Disassemble: print the function size in bytes.

Print "; Size: 981 bytes" at the beginning of DISASSEMBLE output.

11 years agoLOGBITP and LOGTEST optimizations from x86.
Martin Cracauer [Thu, 11 Apr 2013 15:34:03 +0000 (11:34 -0400)]
LOGBITP and LOGTEST optimizations from x86.

Copy Nathan Froyd's optimizations for LOGBITP and LOGTEST
on x86 architecture into x86-64.

Committing change submitted by Doug Katzman.

11 years agoDon't signal an error on (setf (documentation nil 'function) "doc").
Stas Boukarev [Mon, 8 Apr 2013 10:12:55 +0000 (14:12 +0400)]
Don't signal an error on (setf (documentation nil 'function) "doc").

Signal a style-warning instead when trying to set documentation of NIL
for all other documentation types (except TYPE).

Reported by Zach Beane. Regression since 2e52fa05.

11 years agoCheck bounds of ELT on &more in safe code.
Stas Boukarev [Mon, 1 Apr 2013 13:59:28 +0000 (17:59 +0400)]
Check bounds of ELT on &more in safe code.

Disable &more optimizations for ELT if safety = 3.

11 years agotype=: Compare &key parameters of function types.
Stas Boukarev [Sun, 31 Mar 2013 17:27:14 +0000 (21:27 +0400)]
type=: Compare &key parameters of function types.

Compare key parameters in type=-args, mostly so that deftransforms
with key arguments could be redefined at runtime.

11 years agoStop emitting references to inexistant #n= forms in the pretty printer
Paul Khuong [Sat, 30 Mar 2013 20:06:32 +0000 (21:06 +0100)]
Stop emitting references to inexistant #n= forms in the pretty printer

 * Special logic was introduced in 2003 to avoid pprinting backquote-comma
   forms as ", foo" when ",foo" is unambiguous; the bug has likely been
   around since then.

 * Reported by Douglas Katzman on launchpad, and reduced by James M. Lawrence
   (lp#1161218)

11 years agoFix a compilation failure on svref of a symbol macro
Paul Khuong [Sat, 30 Mar 2013 18:22:46 +0000 (19:22 +0100)]
Fix a compilation failure on svref of a symbol macro

 Introduced in 0892423b (faster SVREF and (SETF SVREF) compilation)

 Thanks to James M. Lawrence for the quick report, with a reduced
 test case.

11 years agoremove sb-studio from commercial support section of the manual
Christophe Rhodes [Fri, 29 Mar 2013 20:24:51 +0000 (20:24 +0000)]
remove sb-studio from commercial support section of the manual

(thanks to Titus Barik)

11 years ago1.1.6: will be tagged as "sbcl-1.1.6"
Christophe Rhodes [Fri, 29 Mar 2013 19:38:35 +0000 (19:38 +0000)]
1.1.6: will be tagged as "sbcl-1.1.6"

11 years agotest environment fix for 64-bit PowerPC/Linux
Christophe Rhodes [Tue, 26 Mar 2013 12:45:35 +0000 (12:45 +0000)]
test environment fix for 64-bit PowerPC/Linux

(from Eric Marsden sbcl-devel 2012-03-26)

11 years agoDeclare types of END and TEST in N{LIST,VECTOR}-SUBSTITUTE-IF[-NOT]*
Jan Moringen [Tue, 5 Mar 2013 18:46:01 +0000 (19:46 +0100)]
Declare types of END and TEST in N{LIST,VECTOR}-SUBSTITUTE-IF[-NOT]*

The types of END and TEST are known because the respective callers are
defined with DEFINE-SEQUENCE-TRAVERSER which checks/COERCEs
appropriately.

11 years agoLazy length computation in DEFINE-SEQUENCE-TRAVERSER
Jan Moringen [Tue, 5 Mar 2013 18:13:06 +0000 (19:13 +0100)]
Lazy length computation in DEFINE-SEQUENCE-TRAVERSER

DEFINE-SEQUENCE-TRAVERSER used to unconditionally establish a binding
of LENGTH{,1,2} to the length of the processed sequence(s). This was
wasteful in the case of user-defined sequences whos implementations
could not access this information.

DEFINE-SEQUENCE-TRAVERSER now uses SYMBOL-MACROLET to provide LENGTH{,1,2}
symbols which evaluate to the respective sequence lengths, but the
sequence length is only computed when needed.

Uses of DEFINE-SEQUENCE-TRAVERSER now have to avoid forcing
LENGTH{,1,2} and thus END{,1,2} handling only appears in the list- and
vector-code-paths. The affected sequence functions are REDUCE,
DELETE[-IF[-NOT]], REMOVE[-IF[-NOT]], REMOVE-DUPLICATES,
DELETE-DUPLICATES, SUBSTITUTE[-IF[-NOT]], NSUBSTITUE[-IF[-NOT]],
COUNT[-IF[-NOT]], MISMATCH and SEARCH.

11 years agoRemove redundant LENGTH calls in NSUBSTITUTE[-IF[-NOT]]
Jan Moringen [Mon, 4 Mar 2013 10:26:35 +0000 (11:26 +0100)]
Remove redundant LENGTH calls in NSUBSTITUTE[-IF[-NOT]]

NSUBSTITUTE, NSUBSTITUTE-IF and NSUBSTITUTE-IF used to contain

  (let ((length (length sequence))) ...

in the code path for lists. In the macroexpansion it became clear that
this recomputed and shadowed the LENGTH variables already established
by DEFINE-SEQUENCE-TRAVERSER.

A very brief test with list lengths between 5 and 500 suggests that
the speedup produced by removing the redundant computation can be
around 5 to 20 %.

11 years agoFix typo in comment in src/compiler/seqtran.lisp
Jan Moringen [Mon, 4 Mar 2013 10:25:24 +0000 (11:25 +0100)]
Fix typo in comment in src/compiler/seqtran.lisp

11 years agominor NEWS fixups
Christophe Rhodes [Fri, 22 Mar 2013 12:14:33 +0000 (12:14 +0000)]
minor NEWS fixups

11 years agoFix SEQUENCE:SEARCH, test seq. functions with user-defined sequences
Jan Moringen [Sun, 10 Mar 2013 15:28:55 +0000 (16:28 +0100)]
Fix SEQUENCE:SEARCH, test seq. functions with user-defined sequences

Extending the tests in tests/seq.impure.lisp to user-defined sequences
revealed that the previous implementation produced incorrect results
for some inputs.

SEQUENCE:WITH-SEQUENCE-ITERATOR now accepts NIL in the list of
variables and generates ignored bindings for these elements.

The new implementation is also slightly faster (at least for the
inputs in tests/seq.impure.lisp).

fixes lp#1153312

11 years agomicro-optimize sane-package a tiny bit more
Christophe Rhodes [Sat, 16 Mar 2013 12:05:31 +0000 (12:05 +0000)]
micro-optimize sane-package a tiny bit more

11 years agofaster SVREF and (SETF SVREF) compilation
Nikodemus Siivola [Sun, 17 Mar 2013 11:54:17 +0000 (13:54 +0200)]
faster SVREF and (SETF SVREF) compilation

11 years agomake-array transform error on unknown element-type.
Stas Boukarev [Sun, 17 Mar 2013 08:53:47 +0000 (12:53 +0400)]
make-array transform error on unknown element-type.

Check for the type to be known, otherwise give up transforming.
Based on a patch by James Kalenius.
Fixes lp#1156095.

11 years agoOptimize pprinting of heavily nested lists.
Stas Boukarev [Sat, 16 Mar 2013 12:33:29 +0000 (16:33 +0400)]
Optimize pprinting of heavily nested lists.

Declare types of PREFIX and SUFFIX slots of PRETTY-STREAM to be
(simple-array character (*)), not just simple-string.

11 years agoReduce consing for find-package.
Stas Boukarev [Sat, 16 Mar 2013 12:09:03 +0000 (16:09 +0400)]
Reduce consing for find-package.

Don't use return-from inside restart-case, it causes consing even when
the branch with restart-case is not taken.

11 years agoOptimize CAD*R for &MORE args.
Stas Boukarev [Thu, 14 Mar 2013 11:29:10 +0000 (15:29 +0400)]
Optimize CAD*R for &MORE args.

Call %rest-ref when possible, and SECOND-FOURTH are optimized by
extension too.

11 years agoAccessing &MORE arguments checks bounds.
Stas Boukarev [Thu, 14 Mar 2013 10:09:54 +0000 (14:09 +0400)]
Accessing &MORE arguments checks bounds.

(funcall (lambda (&rest args) (car args))) => garbage,
because &more accessing didn't check bounds.

Fixes lp#1154946.

11 years agoBetter errors for package operations.
Stas Boukarev [Thu, 14 Mar 2013 08:11:13 +0000 (12:11 +0400)]
Better errors for package operations.

Add some missing errors, make other errors to be of type
sb-kernel:simple-package-error.

Fixes lp#1154776.

DELETE-PACKAGE should be signalling a continuable error, but wasn't
since 1.0.37.44.

11 years agoSlightly better arglist for defmethod.
Stas Boukarev [Wed, 13 Mar 2013 08:29:26 +0000 (12:29 +0400)]
Slightly better arglist for defmethod.

(defmethod name &rest args) instead of just (defmethod &rest args).

11 years agoformat: Signal an error for ~<~@>
Stas Boukarev [Sun, 10 Mar 2013 16:15:53 +0000 (20:15 +0400)]
format: Signal an error for ~<~@>

CLHS doesn't allow @ to appear in the closing directive of ~<~>.

Patch by Jan Moringen.
Fixes lp#1153148

11 years agoclear-output: call stream-clear-output on gray streams.
Stas Boukarev [Sun, 10 Mar 2013 15:05:59 +0000 (19:05 +0400)]
clear-output: call stream-clear-output on gray streams.

clear-output should call sb-gray:stream-clear-output instead of
sb-gray:stream-force-output.

Fixes lp#1153257.

11 years agoNew keyword argument for SB-C:DEFKNOWN: :overwrite-fndb-silently
Paul Khuong [Mon, 4 Mar 2013 05:13:28 +0000 (00:13 -0500)]
New keyword argument for SB-C:DEFKNOWN: :overwrite-fndb-silently

 While not useful in the compiler itself, some libraries (not only
 contribs) define their own VOPs, transforms, etc., and the error
 when clobbering pre-existing defknowns made these libraries hard
 to reload.

 Use with :allow-other-keys for backward compatibility.

11 years agoFix a test-case in threads.impure.lisp on -sb-thread.
Stas Boukarev [Sun, 3 Mar 2013 11:09:40 +0000 (15:09 +0400)]
Fix a test-case in threads.impure.lisp on -sb-thread.

A test was using make-thread without ensuring that sb-thread is enabled.

Fixes lp#1141795

11 years agoPrevent a make-array transform from modifying source forms.
Stas Boukarev [Sat, 2 Mar 2013 20:54:34 +0000 (00:54 +0400)]
Prevent a make-array transform from modifying source forms.

That causes repeated compilations of inlined functions to accumulate
changes made by the transform.

Thanks to Bart Botta.
(regression since 1.0.42.11-bis)

11 years agoImprove the failure output of the test :range-reduction :x87.
Lutz Euler [Sat, 2 Mar 2013 19:49:30 +0000 (20:49 +0100)]
Improve the failure output of the test :range-reduction :x87.

Namely, output the function, argument, expected and actual result.

11 years agoSilence a warning from the test harness for unthreaded builds.
Lutz Euler [Sat, 2 Mar 2013 18:52:19 +0000 (19:52 +0100)]
Silence a warning from the test harness for unthreaded builds.

"The variable THREADS is defined but never used.", so, in WITH-TEST only
bind THREADS under #+SB-THREAD as all places where this variable is used
are guarded by this feature expression, too.

11 years ago1.1.5: will be tagged as "sbcl-1.1.5"
Christophe Rhodes [Tue, 26 Feb 2013 11:42:11 +0000 (11:42 +0000)]
1.1.5: will be tagged as "sbcl-1.1.5"

11 years agoRevert "upgrade asdf to 2.29, per request by Faré (sbcl-devel 2013-02-16)"
Christophe Rhodes [Mon, 25 Feb 2013 10:25:32 +0000 (10:25 +0000)]
Revert "upgrade asdf to 2.29, per request by Faré (sbcl-devel 2013-02-16)"

This reverts commit 5bf941f419b6cd275feb3ee44ca264596fbd9e8e.

11 years agoprohibit adding name of a package to itself as a local nickname
Nikodemus Siivola [Thu, 21 Feb 2013 11:18:34 +0000 (13:18 +0200)]
prohibit adding name of a package to itself as a local nickname

  Seems useless, confusing, and probably unintentional. Make it a
  continuable error, though. Thanks to Rudi Schlatte for thinking
  about this.

  So, NO MORE:

   (in-package :foo)
   (add-package-local-nickname :foo :bar)
   'foo::x ; => BAR::X

11 years agosuffix PACKAGE-LOCALLY-NICKNAMED-BY with -LIST
Nikodemus Siivola [Thu, 21 Feb 2013 10:46:07 +0000 (12:46 +0200)]
suffix PACKAGE-LOCALLY-NICKNAMED-BY with -LIST

  Less confusing, and more in line with PACKAGED-NICKNAMED-BY-LIST &co.

  (Thanks to Rudi Schlatte for heads-up.)

11 years agoupgrade asdf to 2.29, per request by Faré (sbcl-devel 2013-02-16)
Christophe Rhodes [Wed, 20 Feb 2013 11:49:48 +0000 (11:49 +0000)]
upgrade asdf to 2.29, per request by Faré (sbcl-devel 2013-02-16)

11 years agoupdate LIST-QUEUE-CONTENTS docstring, add note
Nikodemus Siivola [Fri, 8 Feb 2013 00:45:18 +0000 (19:45 -0500)]
update LIST-QUEUE-CONTENTS docstring, add note

11 years agoReplace sb-concurrency:queue implementation.
James M. Lawrence [Wed, 14 Nov 2012 00:18:43 +0000 (19:18 -0500)]
Replace sb-concurrency:queue implementation.

Singly-linked queue is faster and conses less.

11 years agoit's print-read consistency, not read/print consistency
Nikodemus Siivola [Thu, 7 Feb 2013 20:16:47 +0000 (22:16 +0200)]
it's print-read consistency, not read/print consistency

  Doesn't really matter, I guess, but let's not confuse terminology if
  we can avoid it. (Kudos to Zach Beane for pointing this out.)

11 years agofix manual build
Nikodemus Siivola [Mon, 4 Feb 2013 16:49:36 +0000 (18:49 +0200)]
fix manual build

11 years agoFix (setf documentation) regression.
Stas Boukarev [Tue, 5 Feb 2013 15:25:46 +0000 (19:25 +0400)]
Fix (setf documentation) regression.

When built with sb-doc enabled (the default), it crashes the build
because it uses a not yet defined function, sb-impl::fun-name.

Reported by Janis Dzerins.

11 years agoTest-suite results colorization.
Stas Boukarev [Tue, 5 Feb 2013 10:53:06 +0000 (14:53 +0400)]
Test-suite results colorization.

Failures in red, unexpected success in green. Works on Windows and on
terminals with ANSI escape code support.
Can be disabled with --no-color.

11 years agoFix (documentation closure) test.
Stas Boukarev [Mon, 4 Feb 2013 12:08:07 +0000 (16:08 +0400)]
Fix (documentation closure) test.

Take into account the idea that
(setf (documentation #'function t) "doc")
(setf (documentation 'function 'function) "doc")

should do the same.

11 years agoBuild on newer glibc.
Stas Boukarev [Mon, 4 Feb 2013 12:06:22 +0000 (16:06 +0400)]
Build on newer glibc.

Newer glibc don't like the usage of #define __USE_GNU, use _GNU_SOURCE
instead.
Fixes lp#1095036

11 years agoFix (documentation #'function t)
Stas Boukarev [Mon, 4 Feb 2013 11:21:22 +0000 (15:21 +0400)]
Fix (documentation #'function t)

(defun test () "xx" nil)
(setf (documentation 'test 'function) "test")
(list (documentation #'test t) (documentation 'test 'function)))
returned ("xx" "test").

11 years agoRemove a style-warning from sb-bsd-sockets.asd when #-sb-testing-contrib.
Francois-Rene Rideau [Tue, 1 Jan 2013 21:35:05 +0000 (16:35 -0500)]
Remove a style-warning from sb-bsd-sockets.asd when #-sb-testing-contrib.

11 years agoadd SB-POSIX:MAP-ANON
Nikodemus Siivola [Thu, 24 Nov 2011 12:36:15 +0000 (14:36 +0200)]
add SB-POSIX:MAP-ANON

11 years agotypo fix in sb-sprof.
Christophe Rhodes [Sun, 3 Feb 2013 14:14:55 +0000 (14:14 +0000)]
typo fix in sb-sprof.

Also update NEWS for fix of #1113859

11 years agograb-bag of SB-SPROF improvements.
Nikodemus Siivola [Sun, 3 Feb 2013 10:28:32 +0000 (12:28 +0200)]
grab-bag of SB-SPROF improvements.

 (1) Thread distribution handler must not check *SAMPLING*, as it
     is thread-local.

 (2) Return the values from the final round when looping.

 (3) Better warning on no sampling process: list the reasons users can
     do something about.

 (4) Update WITH-PROFILING docstring to reflect reality.

 (5) When printing *SAMPLES*, don't print the array.

11 years agomake SB-SPROF:WITH-PROFILING not loop by default
Attila Lendvai [Tue, 6 Apr 2010 15:24:54 +0000 (17:24 +0200)]
make SB-SPROF:WITH-PROFILING not loop by default

 ...and in non-loop mode it properly returns the result values of the
 macro body.

11 years agomention :TIME in *SAMPLING-MODE* docstring
Nikodemus Siivola [Sun, 3 Feb 2013 09:03:12 +0000 (11:03 +0200)]
mention :TIME in *SAMPLING-MODE* docstring

11 years agorestart-case: Spurious unused variable warnings.
Stas Boukarev [Sun, 3 Feb 2013 09:38:29 +0000 (13:38 +0400)]
restart-case: Spurious unused variable warnings.

restart-case without any restart clauses used to signal an unused
variable warning, add ignorable declaration.
Fixes lp#1113859

11 years agoremove bogus IGNORE declaration from XC version of WITH-FAST-READ-BYTE
Nikodemus Siivola [Fri, 1 Feb 2013 22:17:36 +0000 (00:17 +0200)]
remove bogus IGNORE declaration from XC version of WITH-FAST-READ-BYTE

11 years agomake %COERCE-TO-CALLABLE compilers notes make sense
Nikodemus Siivola [Wed, 23 May 2012 06:53:34 +0000 (09:53 +0300)]
make %COERCE-TO-CALLABLE compilers notes make sense

  Get the cause and the problem right.

11 years agoexport MAP-DIRECTORY from SB-EXT
Nikodemus Siivola [Fri, 1 Feb 2013 20:35:21 +0000 (22:35 +0200)]
export MAP-DIRECTORY from SB-EXT

  It's proven itself a capable and stable interface.

11 years agoprettier backtraces
Nikodemus Siivola [Mon, 15 Nov 2010 15:21:25 +0000 (17:21 +0200)]
prettier backtraces

  Introduce PRINT-BACKTRACE and LIST-BACKTRACE as forward compatible
  replacements for BACKTRACE and BACKTRACE-AS-LIST. (Not yet deprecated.)

  *SHOW-ENTRY-POINT-DETAILS* is also deprecated. Function names and
  lambda-lists are now always cleaned, but the details that were
  previously available via the debug name are now provided as part of
  the auxilliary frame info.

  *METHOD-FRAME-STYLE* can be :MINIMAL, :NORMAL, or :FULL, defaulting to
  :NORMAL.

11 years agosupport for deprecating special variables
Nikodemus Siivola [Thu, 18 Nov 2010 15:19:50 +0000 (17:19 +0200)]
support for deprecating special variables

  Use DEFINE-DEPRECATED-VARIABLE to deprecate them.

11 years agocross-compiler OAOOM ugliness
Nikodemus Siivola [Tue, 12 Jun 2012 20:49:09 +0000 (23:49 +0300)]
cross-compiler OAOOM ugliness

  Couple of conditions for easier debugging of
  the build.

11 years agobetter debug name for secondary GF dispatch functions
Nikodemus Siivola [Sat, 26 Jan 2013 21:14:02 +0000 (23:14 +0200)]
better debug name for secondary GF dispatch functions

 Fixes lp#503081

11 years agoUse CryptGenRandom as a random seed on Windows.
Stas Boukarev [Fri, 1 Feb 2013 11:57:41 +0000 (19:57 +0800)]
Use CryptGenRandom as a random seed on Windows.

Patch by Anton Kovalenko.
Fixes lp#1102748

11 years agofix NEWS: oops, one item was wrong, one item not in place yet
Nikodemus Siivola [Fri, 1 Feb 2013 19:54:09 +0000 (21:54 +0200)]
fix NEWS: oops, one item was wrong, one item not in place yet

11 years agoFix win32-foreign-stack-unwind.impure test.
Stas Boukarev [Fri, 1 Feb 2013 11:51:58 +0000 (19:51 +0800)]
Fix win32-foreign-stack-unwind.impure test.

Don't pass -mno-cygwin to gcc, it doesn't work with MinGW.

11 years agorestore old behaviour as the default for package variance
Nikodemus Siivola [Fri, 1 Feb 2013 18:13:31 +0000 (20:13 +0200)]
restore old behaviour as the default for package variance

  Use *on-package-variance* to adjust.

  Hint:

    (setf *on-package-variance* '(:warn (:swank :swank-backend) :error t))

11 years agooops, it's :package-local-nicknams, not :local-nicknames
Nikodemus Siivola [Fri, 1 Feb 2013 16:40:23 +0000 (18:40 +0200)]
oops, it's :package-local-nicknams, not :local-nicknames

  Also mention it in the manual.

  ...just couldn't get it right the first time.

11 years agopackage local nicknames
Nikodemus Siivola [Tue, 22 Jan 2013 02:04:49 +0000 (04:04 +0200)]
package local nicknames

  Example terminal session using Linedit:

    * (defpackage :foo (:use :cl) (:local-nicknames (:sb :sb-ext)))

    #<PACKAGE "FOO">
    * (in-package :foo)

    #<PACKAGE "FOO">
    * (sb:posix-
    sb:posix-environ  sb:posix-getenv
    * (sb:posix-getenv "USER")

    "nikodemus"

  API:

    function PACKAGE-LOCAL-NICKNAMES package
    function PACKAGE-LOCALLY-NICKNAMED-BY package
    function ADD-PACKAGE-LOCAL-NICKNAME nick global &optional package
    function REMOVE-PACKAGE-LOCAL-NICKNAME old-nick &optional package

    DEFPACKAGE option: (:local-nicknames {(local-nick global-name)}*)

    :PACKAGE-LOCAL-NICKNAMES in *FEATURES*

  Design issues and considerations:

   * "CL", "COMMON-LISP", and "KEYWORD" signal a continuable error
     when used as local nicknames. I think this is good for sanity,
     but not strictly required. Because of the way (find-package
     :keyword) is idiomatically used to guarantee print/read
     consistency across packages, I think it at least should be
     protected.

   * To preserve read/print consistency, we use package local nicknames
     as prefixes when printing.

   * The hook into FIND-PACKAGE is invisible, but built on top of
     FIND-PACKAGE-USING-PACKAGE -- undocumented and unexported, but
     waiting to be turned into something interesting by Christophe.

   * Local nicknames are protected by package locks.

   * If you want to bypass nicknames, you need to first get into
     a known package without nicknames. There could be an explicit
     way as well, but not sure if that's needed or a good idea.

  Random crap mixed in:

     Re-order DEFPACKAGE option docs in rough order of usefulness.

11 years agoupdate NEWS
Nikodemus Siivola [Fri, 1 Feb 2013 13:01:30 +0000 (15:01 +0200)]
update NEWS

11 years agoremove deleted packages from implementation-packages list of other packages
Nikodemus Siivola [Fri, 1 Feb 2013 13:01:11 +0000 (15:01 +0200)]
remove deleted packages from implementation-packages list of other packages

11 years agoDEFPACKAGE at variance restarts
Nikodemus Siivola [Fri, 1 Feb 2013 12:49:41 +0000 (14:49 +0200)]
DEFPACKAGE at variance restarts

  Signal a full error on variances, in each case offering the user the
  choice of keeping the old stuff or dropping it.

  Fixes lp#891351.

11 years agonicer name-conflict restarts for common cases
Nikodemus Siivola [Tue, 29 Jan 2013 09:27:34 +0000 (11:27 +0200)]
nicer name-conflict restarts for common cases

  For IMPORT: offer option to SHADOWING-IMPORT the new symbol or skip
  importing.

  For EXPORT: offer option to KEEP-OLD or TAKE-NEW. (Shadowing or
  uninterning the other one.)

  For USE-PACKAGE: offer option to KEEP-OLD or TAKE-NEW. (Shadowing or
  uninterning the other ones.)

11 years ago1.1.4: will be tagged as "sbcl-1.1.4"
Christophe Rhodes [Wed, 30 Jan 2013 19:28:03 +0000 (19:28 +0000)]
1.1.4: will be tagged as "sbcl-1.1.4"

11 years agodisable the other sb-sprof test on darwin as well *sigh*
Nikodemus Siivola [Sat, 26 Jan 2013 15:34:35 +0000 (17:34 +0200)]
disable the other sb-sprof test on darwin as well *sigh*

11 years agoSlightly improve random seed on Windows.
Stas Boukarev [Wed, 23 Jan 2013 10:33:08 +0000 (14:33 +0400)]
Slightly improve random seed on Windows.

Use unix-getpid on Windows too.

11 years agoAdapt cheneygc.c to type changes in gc-internal.h
Christoph Egger [Wed, 23 Jan 2013 05:02:59 +0000 (06:02 +0100)]
Adapt cheneygc.c to type changes in gc-internal.h

11 years agodisable sb-sprof test on darwin
Cyrus Harmon [Mon, 21 Jan 2013 01:24:24 +0000 (17:24 -0800)]
disable sb-sprof test on darwin

  restore buildability by disabling failing test for the moment.

11 years agobetter initial value for LOOP variables of-type CHARACTER
Nikodemus Siivola [Sun, 20 Jan 2013 11:28:43 +0000 (13:28 +0200)]
better initial value for LOOP variables of-type CHARACTER

11 years agonote FIRST fix in NEWS, fix stupid typo in tests
Nikodemus Siivola [Sun, 20 Jan 2013 11:16:31 +0000 (13:16 +0200)]
note FIRST fix in NEWS, fix stupid typo in tests

11 years agofix open coding of FIRST
Nikodemus Siivola [Sun, 20 Jan 2013 09:36:56 +0000 (11:36 +0200)]
fix open coding of FIRST

  Regression from 373df66df093e8c1771069dcc30c2ec32598af6a:
  "more funky &REST smartness".

  Make the source-transform of FIRST never decline, falling back on
  CAR if the argument is not a &REST list.

11 years agofix constant-list-related initargs in CTOR optimization
Christophe Rhodes [Wed, 16 Jan 2013 13:51:19 +0000 (13:51 +0000)]
fix constant-list-related initargs in CTOR optimization

lp#1099708, reported by Derek Baldwin; also test for _3b's #sbcl irc insight
that this would break non-EQLity of distinct but EQUAL list constants

Also deal with pathnames, bit-vectors and strings, which are precisely the
types EQUAL descends into.

(The general problem of function names being looked up using EQUAL remains
a problem, though with fewer observable consequences: for example, methods
with EQUAL eql-specializers will have their function names collide with
each other, though since in CLOS the functions are looked up through the
method objects this is less serious than with CTORs.

11 years agoformat: ~R should check a type only if base is not supplied.
Stas Boukarev [Fri, 11 Jan 2013 03:38:13 +0000 (07:38 +0400)]
format: ~R should check a type only if base is not supplied.

(format t "~2r" 1/2) is valid.

11 years agoformat: Check types for ~C and ~R.
Stas Boukarev [Thu, 10 Jan 2013 20:26:32 +0000 (00:26 +0400)]
format: Check types for ~C and ~R.

Both require arguments to be characters and integers respectively.

11 years agosb-sprof.lisp: Remove trailing white-spaces.
Stas Boukarev [Sat, 5 Jan 2013 17:09:52 +0000 (21:09 +0400)]
sb-sprof.lisp: Remove trailing white-spaces.

11 years agoadjust-array: Make sure that :initial-element is used.
Stas Boukarev [Sat, 5 Jan 2013 15:43:05 +0000 (19:43 +0400)]
adjust-array: Make sure that :initial-element is used.

Adjust-array ignored :initial-element for arrays of type T.

Fixes lp#1096359.

11 years agosb-sprof: Define pthread-kill only on +sb-thread.
Stas Boukarev [Fri, 4 Jan 2013 12:59:01 +0000 (16:59 +0400)]
sb-sprof: Define pthread-kill only on +sb-thread.

pthread_kill alien is not present on -sb-thread, because libpthread is
not loaded, and it results in unnecessary style warnings.

11 years agoFix reading `#3(x).
Stas Boukarev [Fri, 4 Jan 2013 12:46:43 +0000 (16:46 +0400)]
Fix reading `#3(x).

Previously it returned #(x), while it should be #(x x x).

Fixes lp#1095918.

11 years agoDo not traverse long constant lists when expanding DOLIST
Paul Khuong [Thu, 3 Jan 2013 15:31:09 +0000 (10:31 -0500)]
Do not traverse long constant lists when expanding DOLIST

* Only gather type information on the list contents' if it's short
  (at most 20 elements); otherwise, do not derive type information.

* Thanks to Douglas Katzman for the bug report (lp#1095488).

11 years ago1.1.3: will be tagged as "sbcl-1.1.3"
Christophe Rhodes [Mon, 31 Dec 2012 21:29:02 +0000 (21:29 +0000)]
1.1.3: will be tagged as "sbcl-1.1.3"

11 years agoFix attach_thread to allocate a TLS index for *gc-inhibit* if needed
David Lichteblau [Wed, 26 Dec 2012 14:39:34 +0000 (15:39 +0100)]
Fix attach_thread to allocate a TLS index for *gc-inhibit* if needed

Instead of occasionally setting a global value for this variable...

Thanks to Stas Boukarev for the bug report.

11 years agoUpdate NEWS
David Lichteblau [Fri, 21 Dec 2012 20:29:23 +0000 (21:29 +0100)]
Update NEWS

11 years agoPreserve superclass structure accessors in infodb
David Lichteblau [Mon, 17 Dec 2012 17:33:43 +0000 (18:33 +0100)]
Preserve superclass structure accessors in infodb

Do not overwrite inherited structure accessor entries in infodb when
a sub-structure-class gets defined with same conc-name.

Fixes CAS access to slots of direct superclass instances in this
case (and in particular, non-futex safepoint builds).

11 years agoSet a console Ctrl handler for Windows
David Lichteblau [Mon, 10 Dec 2012 12:56:17 +0000 (13:56 +0100)]
Set a console Ctrl handler for Windows

Install a Lisp callback using SetConsoleCtrlHandler, allowing users
to interrupt SBCL using C-c in the Windows console.

We cannot currently control the size of the stack available to us in
this handler, but since we are mainly only calling INTERRUPT-THREAD,
even a small stack might be sufficient for our purposes.

Thanks to Anton Kovalenko.

11 years agoAdd STDCALL alien convention support for Windows
David Lichteblau [Fri, 9 Nov 2012 13:54:19 +0000 (14:54 +0100)]
Add STDCALL alien convention support for Windows

Thanks to Anton Kovalenko.

11 years agoSupport building without PSEUDO-ATOMIC on POSIX safepoints
David Lichteblau [Wed, 5 Dec 2012 18:08:23 +0000 (19:08 +0100)]
Support building without PSEUDO-ATOMIC on POSIX safepoints

  - Mark Lisp signal handlers with a flag `synchronous' to indicate
    whether we can (and must) handle them immediately.  Conversely,
    we understand this flag to imply a guarantee that the signal
    does not occur during allocation.

  - Any signal with a Lisp handler that is not synchronous is
    implemented in the runtime using a trampoline, which (instead of
    invoking Lisp code directly) first spawns a new pthread, which
    only then calls back into Lisp to invoke the handler function
    (with a fake signal context).

  - Used in particular for SIGINT.

  - For SIGPROF, introduce a second per-thread allocation region,
    which gets swapped with the usual region around the call into
    SIGPROF-HANDLER.  This handler is a special case, because it is
    careful not to trigger GC nor non-local unwinds, and we can
    safely return to the original region afterwards.

  - Add a new subclass SIGNAL-HANDLER-THREAD for this purpose,
    making it easy to identify these threads (e.g. in the test
    driver).

  - Run sprof tests while building the contrib.  Add a test stressing
    time profiling of allocation sequences.

Enable using :SB-SAFEPOINT-STRICTLY on features.

Quite usable already on x86 and x86-64; PPC still has more prominent
issues, e.g. in threads.impure.lisp.

11 years agoForeign callbacks
David Lichteblau [Wed, 12 Dec 2012 13:30:52 +0000 (14:30 +0100)]
Foreign callbacks

Allow alien callbacks to be invoked in pthreads created outside of
the Lisp runtime:

Add new runtime functions attach_os_thread, detach_os_thread
allowing such threads to acquire a `struct thread' temporarily,
turning them into Lisp threads.

In a main deviation from the Windows branch (which has a similar
feature), this mechanism does not involve user-land thread (fiber)
mechanisms to switch between stacks.  Instead, Lisp code merely runs
on the existing pthread's stack.

Currently a safepoint-only feature, because only safepoint-based
builds already go through a convenient trampoline function for
callbacks, but a backport of this feature to non-safepoint builds
might be straightforward.

11 years agoRe-complicate all_threads check in arch_os_get_current_thread
David Lichteblau [Fri, 21 Dec 2012 19:27:33 +0000 (20:27 +0100)]
Re-complicate all_threads check in arch_os_get_current_thread

This check used to be x86-only, and apparently for good reason.
Make it so again.

11 years agoadjust DATA-VECTOR-FROM-INITS to avoid full calls to MAKE-ARRAY when possible
Nathan Froyd [Thu, 20 Dec 2012 04:31:23 +0000 (23:31 -0500)]
adjust DATA-VECTOR-FROM-INITS to avoid full calls to MAKE-ARRAY when possible

We don't need to do full calls to MAKE-ARRAY in certain cases for
ADJUST-ARRAY now, which avoids calls to SUBTYPEP and friends.  This
change significantly speeds up ADJUST-ARRAY for common cases, like the
calls made by VECTOR-PUSH-EXTEND.