Commit graph

8329 commits

Author SHA1 Message Date
Marius Gerbershagen
02ef05479c ext:run-program: support unicode characters for the process name, arguments and environment
The encoding is determined by ext:*default-external-format* as usual.
2023-02-26 17:03:09 +01:00
Marius Gerbershagen
53388175f3 unixsys: better error messages if we fail to spawn a subprocess 2023-02-26 16:56:43 +01:00
Marius Gerbershagen
15955de1f4 ecl_alloc_filename: don't set a fill-pointer for the allocated filename
This was copied from the allocation code for base strings but is not
needed here.
2023-02-18 17:32:22 +01:00
Marius Gerbershagen
de89593216 fix typos 2023-02-18 17:30:30 +01:00
Marius Gerbershagen
357c860f1a tests: actually run clos tests and fix one of the tests 2023-02-16 20:03:39 +01:00
Marius Gerbershagen
a5cb93d311 clos: fix computation of instance size
For empty structs, the size was off by one. While this did not affect
structs that were created directly with the structure constructor, for
structs that were externalized with MAKE-LOAD-FORM-SAVING-SLOTS
instances which were one element too large were created.
2023-02-16 20:00:12 +01:00
Daniel Kochmański
4831831f74 Merge branch 'bytecmp-closure-optimization' into 'develop'
bytecmp: create fewer unnecessary closures

See merge request embeddable-common-lisp/ecl!281
2023-02-14 21:06:11 +00:00
Daniel Kochmański
feff551c31 Merge branch 'inline-closure-global' into 'develop'
Fix compiler bug regarding inlining for global functions that are closures

See merge request embeddable-common-lisp/ecl!280
2023-02-14 21:05:19 +00:00
Marius Gerbershagen
d34fe2c065 Merge branch 'fix-listen' into develop 2023-02-05 19:45:58 +01:00
Tarn W. Burton
5a309eba76 listen: when poll/select indicate non-blocking in then check for bytes 2023-02-05 19:41:42 +01:00
Marius Gerbershagen
f0d3dc4b6d Merge branch 'method-combinations' into 'develop'
various cleanups

See merge request embeddable-common-lisp/ecl!284
2023-01-30 17:15:09 +00:00
Daniel Kochmański
7db7e0545f clos: defcombin: fix regressions 2023-01-28 22:15:54 +01:00
Daniel Kochmański
2ba8228366 clos: move define-method-combination to a separate file 2023-01-22 20:36:09 +01:00
Daniel Kochmański
dea75e6bb5 clos: refactor define-complex-method-combination
Factor out a macro WITH-METHOD-GROUPS. The function PARSE-QUALIFIER-PATTERN is
put as a local function in this new macro.
2023-01-22 20:36:09 +01:00
Daniel Kochmański
78abe40fb9 clos: handle correctly the pattern * in define-method-combination
The pattern in the long form of the define-method-combination may contain * as
a list element meaning "any" qualifier. For example:

(define-method-combination foo ()
    ((bar (:xxx * :yyy)))
  ...)

In this case qualifiers `:xxx 3 :yyy' and `:xxx :zzz :yyy' will match.
2023-01-22 20:36:09 +01:00
Daniel Kochmański
3064bac62b tests: add regression tests for define-method-combination 2023-01-22 20:36:07 +01:00
Daniel Kochmański
8ba1bb888a si_process_lambda_list: process all variables in an uniform manner
The comment mentioned that aux variables (the sixth value) are returned the
same way as requireds, optionals and keywords however factually that was not
the case - the number of variables was not the first element of the list. This
commit updates the function and all its callers.
2023-01-22 20:12:58 +01:00
Daniel Kochmański
b62cf6b7ed cmuutil: don't use setf to enable use in early macros
There was no real utility in using SETF there yet it made using collect macros
not possible in macros that are used to define ECL.
2023-01-22 20:12:58 +01:00
Daniel Kochmański
26c8e18750 cmputil: fix invalid iteration
Instead of using the iteration variable we've used the same list repeatedly.
2023-01-22 20:12:58 +01:00
Daniel Kochmański
36e5a02241 Merge branch 'define-method-combination-arguments' into 'develop'
Implement the :arguments option for define-method-combination

See merge request embeddable-common-lisp/ecl!279
2023-01-22 19:03:20 +00:00
Marius Gerbershagen
fb146cf806 Merge branch 'fix-parse-directive' into 'develop'
Fix format directive parser so that parameters are not allowed after colon or at sign

Closes #590

See merge request embeddable-common-lisp/ecl!282
2023-01-22 18:01:42 +00:00
Marius Gerbershagen
3a0d818c0e printer: print zero after decimal point in exponential notation if there are no other trailing digits
Previously for example (prin1 1.0e-8) would result in 1.e-8. However,
the ANSI standard (see CLHS section 22.1.3.1.3) specifies that there
has to be at least one digit after the decimal point therefore we now
print 1.0e-8.
2023-01-21 17:43:48 +01:00
Marius Gerbershagen
84db9e7a3f clos: implement the :arguments option for define-method-combination 2023-01-21 17:18:10 +01:00
Tarn W. Burton
a495b04301 Add regression test for LISTEN on files 2023-01-16 10:46:24 -05:00
Marius Gerbershagen
3d809dab47 autoconf: allow building with the bundled gmp library on arm apple devices
Since our ancient LGPL licensed copy of libgmp only knows about
PowerPC apple devices, build it using the fallback plain C
implementation as on x86.

Closes #689.
2023-01-14 15:22:17 +01:00
Tarn W. Burton
eeb91e8005 Avoid parsing parameters after colon or at sign 2023-01-06 11:27:22 -05:00
Tarn W. Burton
ca6d6e10d5 Add tests for illegal format directive parameters 2023-01-06 11:21:55 -05:00
Marius Gerbershagen
b27580c9b8 regenerate configure
Was forgotten after commit 2afa70807e
2023-01-05 17:22:25 +01:00
Marius Gerbershagen
5b4e0d6417 documentation: add iOS build steps to the manual 2023-01-05 17:22:25 +01:00
Marius Gerbershagen
519bc59ff4 si_system: disable for iOS
Autoconf detects that the system function is present but compilation
fails with

error: 'system' is unavailable: not available on iOS

Therefore we manually disable this function for iOS.

Closes #691.
2023-01-05 17:22:25 +01:00
Marius Gerbershagen
fc30c62ea0 numbers/log.d: fix typo 2023-01-02 17:11:54 +01:00
Marius Gerbershagen
cd6f0894d2 numbers/log.d: more fixes for loss of precision in log
The problem encountered in 3f64e2e88b
affects not only the case of a logarithm where one argument is a
rational and the other a long or double float, but also cases where
both arguments are floating point numbers of different lengths.
2023-01-02 17:04:38 +01:00
Marius Gerbershagen
3f64e2e88b numbers/log.d: prevent unnecessary loss of precision
For (log x y) where one of the two arguments is a double or long float
and the other a rational number, defining (log x y) as (/ (log y) (log
x)) is imprecise since intermediate single float results will be used
for the rational argument. Prevent this by computing the logarithm of
the rational to the same precision as that of the other argument.

Fixes #688.
2023-01-02 16:37:45 +01:00
Marius Gerbershagen
2739ab7269 numbers/log.d: simplify implementation
- directly construct the complex result for negative real numbers
  instead of calling ecl_log1_complex_inner(x, ecl_make_fixnum(0))
- get rid of unnecessary double calls to ecl_to_float in ecl_log1_simple
- prevent floating point overflow for negative bignums in the same way
  as for positive ones
2023-01-02 16:32:04 +01:00
Marius Gerbershagen
998f1f4c4a bytecmp: create fewer unnecessary closures
Previously, we unconditionally created closures when a lambda form was
encountered in a non-empty lexical environment. Now we check first if
something from the enclosing environment is actually used in the
function.
2023-01-01 12:53:43 +01:00
Marius Gerbershagen
02280203a4 cmp: fix typos 2022-12-30 16:15:24 +01:00
Marius Gerbershagen
fdcf5e7eff cmp: disable inlining for global functions that are closures
For functions already compiled and loaded, we simply check if the
definition is a closure. For functions defined in the same file, we
don't store their definition in the compiler environment but instead
use *global-funs*. The advantage is that this directly allows us to
determine whether a function is a closure or not and we don't have to
run the first compiler pass again each time we inline the function.

This commit also fixes some minor issues with the inline policy,
described in detail as follows:

1. The inline policy differed subtly between `proclaim` and `declaim`.
If a file like

(eval-when (:compile-toplevel)
  (proclaim '(inline f)))
(defun f ...)

was compiled (but not loaded), subsequent compilations would inline
`f` but for

(declaim (inline f))
(defun f ...)

the function `f` would only get inlined if the file was compiled _and_
loaded. We now use the latter approach for both cases. Thus, calling
`compile-file` without `load` has no side-effects regarding whether
functions are inlined or not.

2. We did not distinguish between functions which were declared inline
at a global versus local level such that e.g. in

(locally
    (declare (inline f))
  (defun f ...))

the function f would get inlined outside the scope of the `locally`
form. This is changed now such that local inline declarations only
apply to the scope in which they are made.

3. Inline declarations were made by expanding into statements like

(eval-when (:compile-toplevel)
  (c::declare-inline ...))

during the macroexpansion of `defun`. However this only works if the
`defun` appears at the toplevel and hence in code like

(declaim (inline f))
(let (...)
  (defun f ...))

the function `f` could not get inlined later on in the same file. This
is fixed now by calling the code which should run during compilation
directly when macro expanding defun.
2022-12-30 16:14:53 +01:00
Marius Gerbershagen
4da9cc3a87 improve error message for wrong index
Use ~S instead of ~A to make the difference between e.g. "0" and 0
clear.

Fixes #687.
2022-12-27 15:32:55 +01:00
Marius Gerbershagen
7175e592bd Merge branch 'cleanup' into 'develop'
this merge request introduces various cleanup fixes

See merge request embeddable-common-lisp/ecl!278
2022-12-11 09:39:08 +00:00
Daniel Kochmański
80b74c890d cleanup: separate process managament from threads
Additionally:

- abstract platform specific functions with file-local macros
2022-12-05 00:34:25 +01:00
Daniel Kochmański
90483505bd cleanup: remove unused slot ecl_process.queue_record 2022-11-25 20:44:33 +01:00
Daniel Kochmański
bd723748d7 alloc_2: initialize the type info in a separate function
The initialization is a lengthy function with clear responsibilities separate
from the gc initialization.
2022-11-25 17:07:36 +01:00
Daniel Kochmański
95d7f4691c cleanup: refactor ecl_init_env into smaller functions 2022-11-25 17:07:34 +01:00
Daniel Kochmański
285c12a2c6 cosmetic: indentation, s/if/when/ 2022-11-25 13:49:43 +01:00
Daniel Kochmański
1d5b8fd525 bignum: move ecl_init_bignum_registers to bignum.d 2022-11-25 13:49:43 +01:00
Daniel Kochmański
f9ad8de531 cl_core: remove unused slot .default_dispatch_macro 2022-11-25 10:47:10 +01:00
Daniel Kochmański
3ada3e96f7 stacks: initialize the lisp stack in init_stacks 2022-11-25 10:14:15 +01:00
Daniel Kochmański
9e10e9115e cosmetic: introduce define ecl_thread_exit() 2022-11-25 10:13:49 +01:00
Daniel Kochmański
6ad85b259f ecl_symbol: remove unused field
symbol.dynamic was only assigned, because we already encode this information
in a bitfield using the enum ecl_stype.
2022-11-24 19:47:27 +01:00
Daniel Kochmański
a886b04a9a cosmetic: remove +x flag from source files 2022-11-24 19:47:26 +01:00