Commit graph

7726 commits

Author SHA1 Message Date
Marius Gerbershagen
693ce14130 printer: remove redundancies between pretty and ordinary printer 2019-08-18 19:31:58 +02:00
Marius Gerbershagen
2cbe875668 dffi: fix bug in converting to :cstring's
We used the next argument instead of the current one. Bug identified
and fixed by Christoph Buck.
Fixes #523.
2019-08-06 20:14:10 +02:00
Marius Gerbershagen
61e799074d cmp: fix type propagation for / with one argument
Fixes #522.
2019-08-06 19:38:47 +02:00
Marius Gerbershagen
5859593b82 Merge branch 'develop' into 'develop'
buildsystem: remove unnecessary nodefaultlib linker flags(msvc)

See merge request embeddable-common-lisp/ecl!157
2019-08-06 16:48:31 +00:00
zyg
3108680e43 buildsystem: update windows msvc build instructions 2019-08-06 21:59:05 +08:00
Exaybachay
f61cb729f9 doc: update msvc build descriptions 2019-07-30 10:36:54 +08:00
Exaybachay
30f1ffcd5d buildsystem: remove unnecessary nodefaultlib linker flags(msvc)
MS link.exe can pick the right crt libraries according to the compiler flags,
such as /MD, /MDd etc.

So we remove them to keep the command line tidy and clean.
2019-07-26 11:55:52 +08:00
Marius Gerbershagen
f331600f84 subtypep and type=: fix bogus type error
It can happen for example in
  (subtypep t '(CONS (AND STANDARD-CHAR (MEMBER #\@)) REAL))
that in subtypep and type= the second call to safe-canonical-type
fails and returns the error from +canonical-type-failure+ instead of a
valid tag. This leads to type-errors in logandc2 or = which expect an
integer.
Fixes #519.
2019-07-24 19:03:07 +02:00
Marius Gerbershagen
13358703d0 Merge branch 'develop' into 'develop'
buildsystem: with-manual in configure script should be enable-manual

See merge request embeddable-common-lisp/ecl!156
2019-07-22 18:57:08 +00:00
Exaybachay
9e7d545b3e buildsystem: with-manual in configure script should be enable-manual 2019-07-22 22:36:02 +08:00
Daniel Kochmański
7a2658fbe3 Merge branch 'file-stream-improvements' into 'develop'
File stream improvements

See merge request embeddable-common-lisp/ecl!153
2019-07-15 22:13:04 +00:00
Marius Gerbershagen
1334eb1765 cmp: prevent deadlock if the C compiler output is too large
The pipe from which we read the output of the C compiler could fill up
when a large number of warnings were printed leading to a deadlock
because we waited for the C compiler to finish before reading the
output.
2019-07-15 21:32:36 +02:00
Daniel Kochmański
f6d2aac142 Merge branch 'fpe' into 'develop'
Floating point environment changes

See merge request embeddable-common-lisp/ecl!154
2019-07-15 09:56:01 +00:00
Marius Gerbershagen
d1718a1f7e ieee-fp: remove old floating point environment workarounds
It is better to let the user disable these features with configure
options than having a bunch of unmaintained workarounds lying around.
2019-06-30 13:04:18 +02:00
Marius Gerbershagen
9a2ea39987 Revert "prevent floating point exception signals if ECL_OPT_TRAP_SIGFPE is false"
This reverts commit 2a9084b105.

It turned out that #347 was caused by the Maxima computer algebra
system enabling floating point exceptions via si:trap-fpe (see
https://trac.sagemath.org/ticket/22191). Hence we can revert to the
less intrusive behaviour of not changing the floating point
environment if ECL_OPT_TRAP_SIGFPE is false.
2019-06-30 13:01:24 +02:00
Marius Gerbershagen
34f26e8b71 si:trap-fpe: move into ext package and extend documentation 2019-06-30 13:01:24 +02:00
Marius Gerbershagen
b891630699 ieee-fp: introduce new macro for toggling between Lisp and C fpe
This is primarly useful for embedding. Lisp code can be safely
executed without leaking the floating point environment into other C
code.
2019-06-30 13:01:06 +02:00
Marius Gerbershagen
06f0a93421 doc: fix small typos and errors 2019-06-21 20:18:56 +02:00
Marius Gerbershagen
ba9ad6c444 reader: be more liberal in the syntax that we accept with *read-suppress*
Also allow commas without backquotes and invalid characters.
Return nil for backquotes (bug fixed).
Document the current behaviour.
Fixes #494.
2019-06-21 20:18:12 +02:00
Marius Gerbershagen
6163466a7b tests: extend external-format tests
We now also test random combinations of read and write functions.
2019-06-15 20:33:17 +02:00
Marius Gerbershagen
2909c1ec39 file.d: return NIL if ftello fails with ESPIPE
We already do the same in io_file_get_position if lseek fails with
ESPIPE.
2019-06-15 18:34:11 +02:00
Marius Gerbershagen
e1d857f38f file.d: fix line breaks for write-sequence 2019-06-15 18:33:50 +02:00
Marius Gerbershagen
8a0e42a93c file.d: improve performance when reading from character streams
External format decoders now operatore on characters buffers instead
of reading input byte by byte from the streams. This allows us to
provide efficient read_vector implementations.
2019-06-15 18:33:50 +02:00
Marius Gerbershagen
1b778f6161 si::get-local-time-zone: don't apply shift for daylight saving time
Previously, we were simply returning the number of hours West of
Greenwich, which had the effect that si::get-local-time-zone could
return different values for a user in the same location depending on
the time of the year. However, the functions calling
si::get-local-time-zone later do the necessary fixup for Daylight
Saving Time on their own, which lead to wrong values returned in
decode-universal-time and encode-universal-time.

Fixes #495.
2019-06-02 19:53:46 +02:00
Daniel Kochmański
58da0f8713 weak hash tables: fix regression with gethash
while fixing problem in sethash I've introduced another one in
gethash. A comment is added to prevent such mistakes.
2019-05-28 09:26:16 +02:00
Marius Gerbershagen
0c198105be file-position: clear unread bytes when setting file position
Fixes #507.
2019-05-27 21:32:09 +02:00
Daniel Kochmański
7fd97549d6 run-program: unwrap synonym-streams when processing the stream 2019-05-25 17:24:55 +02:00
Marius Gerbershagen
44f4282742 Merge branch 'relax-reqs' into 'develop'
defstruct, hashtable and weak pointer improvements

See merge request embeddable-common-lisp/ecl!152
2019-05-25 13:40:35 +00:00
Daniel Kochmański
884ff9f2b1 changelog: include recent changes to hash-tables 2019-05-25 09:56:08 +02:00
Daniel Kochmański
3e0a8c63eb weak-pointer: return two values: value and whenever it is present
We do that to avoid confusion (like with hashtables).
2019-05-25 09:56:08 +02:00
Daniel Kochmański
5bcfb122f4 hash-table: weakness: improve behavior
Previously we mishandled weak values when there was no such key. Also
gethash returned a weak pointer instead of the value (same goes for
maphash). These things are fixed now.
2019-05-25 09:56:08 +02:00
Daniel Kochmański
6e5016dcb8 hash-table: add extension for generic predicates
Added:
- implementation
- test
- documentaiton entries

Additionally:
- remove #if 0 code branches (unused clutter)
- bring up-to-date help.lsp file for hints in slime
- wrap synchronized access in unwind protect
- write_ugly did not carry extensions in the printer
2019-05-25 09:56:08 +02:00
Daniel Kochmański
aa985f566f make-load-form-saving-slots: structures: refrence slot by an offset
At least one library (adt) redefines structures with slot names being
uninterned symbols. That means that we lose slot offset if we
reference it by name what leads to load errors if
make-load-form-saving-slots was called. We fix that by handling
structure-object's separately.

allocate-instance is another oddball in the spec when taken with
structure-classes (and it is used in make-load-form-saving-slots). If
there are *some* slots saved then rest must be initialized so object
could be used - we put there NIL without checking for a type. SBCL
tries to find a constructor for a structure (custom protocol) or
errors while CCL initializes slots to NIL. We follow the latter.
2019-05-25 09:56:08 +02:00
Daniel Kochmański
372d340fe1 numbers: expt: add default clause to avoid compilation warnings
We simply call ecl_internal_error there.
2019-05-25 09:56:08 +02:00
Daniel Kochmański
fcdb1b0657 cmp: c1body: do not error when unknown declaration is encountered
it is hinted in the spec, that compiler issues a warning on unknown
declarations:

http://www.lispworks.com/documentation/HyperSpec/Body/d_declar.htm#declaration

also in other parts of compiler code we warn as well.
2019-05-25 09:56:08 +02:00
Daniel Kochmański
f7ffa893a6 defstruct: redefine: relax requirement to have slot names eql
As explained in the comment: structure may be a result of code
generation which will likely use gensym. In this case name eql casues
compilation/load problems. I.e adt library dos that.
2019-05-25 09:56:08 +02:00
Daniel Kochmański
bc839d2a41 aclocal: fix typo in test for complex float 2019-05-25 09:55:50 +02:00
Daniel Kochmański
4d6cac7885 Merge branch 'cleanup-always-long-float' into 'develop'
long-float: remove conditionalization

See merge request embeddable-common-lisp/ecl!151
2019-05-24 21:04:59 +00:00
Daniel Kochmański
ea87100a06 long-float: remove conditionalization
Many parts of the source code were bent backward to support builds
without long floats which are always present given we depend expect
c99 compiler.

The corresponding C macros (ECL_LONG_FLOAT) and the *feature*
entry (:long-float) are marked as deprecated in the documentation.
2019-05-24 21:04:59 +00:00
Daniel Kochmański
8c30d1a371 Merge branch 'float-complex-leftovers' into 'develop'
Various changes related to float complexes

See merge request embeddable-common-lisp/ecl!150
2019-05-21 17:53:52 +00:00
Marius Gerbershagen
9dedfe95e5 complex-float: add inline definitions for si::complex-*-float-p 2019-05-20 21:54:05 +02:00
Marius Gerbershagen
78dd8ecaad numlib.lsp: refactor inverse (hyperbolic) trigonometric functions
Most of the functionality has been abstracted into a macro. For
consistency and speed we now always use the C complex functions if
available.
2019-05-20 21:50:58 +02:00
Marius Gerbershagen
be9b6d35ae update changelog 2019-05-20 21:44:45 +02:00
Marius Gerbershagen
95b02061b8 legacy.h: replace all remaining occurences of type_of with ecl_t_of 2019-05-20 20:31:47 +02:00
Marius Gerbershagen
a420a378ac complex-float: detect floating point exceptions 2019-05-20 18:28:19 +02:00
Marius Gerbershagen
d70f0317ec Merge branch 'feature-float-complex' into 'develop'
Feature complex float

See merge request embeddable-common-lisp/ecl!149
2019-05-17 16:33:14 +00:00
Daniel Kochmański
6037070343 expt: rework the function
- extract functions for handling different kind of results
- add specialised code for floats and complex floats in integer case
- improve comments a little
- fix the regression where (expt -1.0 2) results in complex result
2019-05-15 18:02:28 +02:00
Daniel Kochmański
b8c328b558 coerce: allow coercing to si:complex-*-float
Previously coerce didn't understand these atomic specifiers.
2019-05-15 16:35:16 +02:00
Daniel Kochmański
19526d4032 cmpffi: produce-inline-loc: do not return uninitialized variable
For functions without returned value we did return cl_object value0
which was not initialized. That could lead to segmentation faults if
we have used result of calling a function defined as such location.

SFFI definition like this:

(ffi:def-function ("my_test_function3" sffi-test-3)
    ((x :float) (y :double))
  :returning :void)

was previously compiled to

/*      function definition for SFFI-TEST-3                     */
/*      optimize speed 3, debug 0, space 0, safety 2            */
static cl_object L6sffi_test_3(cl_object v1x, cl_object v2y)
{
 cl_object env0 = ECL_NIL;
 const cl_env_ptr cl_env_copy = ecl_process_env();
 cl_object value0;
 ecl_cs_check(cl_env_copy,value0);
 {
TTL:
  my_test_function3(ecl_to_float(v1x),ecl_to_double(v2y));
  cl_env_copy->nvalues = 0;
  return value0;
 }
}

and now it is compiled to

/*      function definition for SFFI-TEST-3                       */
/*      optimize speed 3, debug 0, space 0, safety 2              */
static cl_object L6sffi_test_3(cl_object v1x, cl_object v2y)
{
 cl_object env0 = ECL_NIL;
 const cl_env_ptr cl_env_copy = ecl_process_env();
 cl_object value0;
 ecl_cs_check(cl_env_copy,value0);
 {
TTL:
  my_test_function3(ecl_to_float(v1x),ecl_to_double(v2y));
  value0 = ECL_NIL;
  cl_env_copy->nvalues = 0;
  return value0;
 }
}

void functions are treated the same as when *destionation* is 'RETURN
in cmpmulti.lsp.
2019-05-15 16:35:16 +02:00
Daniel Kochmański
b2b6548af6 dffi: disable complex argument type
libffi is incapable of properly handling complex float argument types
yet. Commit disables complex types and adds a comment explaining
what's going on.

SFFI types which doesn't have counterpart in DFFI conversion table are
NULL and function ecl_type_to_libffi_type will signal a condition when
they are used.
2019-05-15 16:35:16 +02:00