Commit graph

8055 commits

Author SHA1 Message Date
Daniel Kochmański
c18b6d6967 bytecmp: represent bytecodes as a lisp vector
Previously they were passed as an index array, now they are a simple
vector (the cl_object).
2020-12-27 18:53:22 +01:00
Marius Gerbershagen
4460a8c7f1 doc: fix argument order for ecl_alloc_simple_vector 2020-12-27 18:53:22 +01:00
Daniel Kochmański
1a6807170a tests: improve config.lsp to allow testing bytecmp via make check
Even when the C compiler is present. Also first install the bytecodes compiler
and then eventually try install the C compiler - that's because ASDF depends
on the :bytecmp feature to work with the bytecompiler.
2020-12-27 18:53:22 +01:00
Marius Gerbershagen
b20a675f64 tests: compiler: improve make-load-form tests
Also check for identical objects in CMP.0030.MAKE-LOAD-FORM

Be more aware of the bcmp in the test CMP.0076.MAKE-LOAD-FORM-NON-EQ - bytecmp
fails the test in a different manner, so remove the remark that a part of the
test pass, and change the description to 1) explain the test, 2) explain the
ccmp's failure mode.
2020-12-27 18:52:43 +01:00
Marius Gerbershagen
bf664c1887 Merge branch 'fix-604' into 'develop'
Fix 604

Closes #534 und #604

See merge request embeddable-common-lisp/ecl!230
2020-12-23 14:42:51 +00:00
Daniel Kochmański
9ec064ca23 ecl_symbol_value: detect early symbol access during compilation
This test is executed only when ECL itself is compiled. It is to ensure early
notice of issues similar to #604.
2020-12-23 12:08:33 +01:00
Daniel Kochmański
12df1255a9 ecl_make_package: don't look for local nicknames during bootstrap
No packages in the core use local nicknames, so there is no need to look for
them. Test for whether we are booted or not comes for free, because it was
simply lifted up from the static function find_pending_package. Also create a
static function find_local_nickname_package (a cosmetic change).

Fixes #604. Closes !228.
2020-12-23 12:08:33 +01:00
Daniel Kochmański
6e0124bc64 si::mangle-name: return the function name from symbols_list.h
To achieve that we store the symbol name in a separate ecl_symbol slot called
cname. It is initialized from the translation slot in the structure
cl_symbol_initializer. That makes dpp and runtime always resolve function
names to the same symbol. Fixes #534.
2020-12-23 12:08:33 +01:00
Daniel Kochmański
7908ba8003 refactor: remove the file symbols_list2.h
The file symbols_list2.h was automatically generated from the file
symbols_list.h for dpp. This commit unifies said structure definition and
removes a step for generating symbols_list2.h.

From now on at runtime the structurecl_symbol_initializer has an additional
element storing the function name. That will help solving #543.
2020-12-23 12:08:33 +01:00
Daniel Kochmański
a67d16bbc2 utils: add the utility to help parsing/generating symbols_list.h 2020-12-23 12:03:36 +01:00
Marius Gerbershagen
3b7efbbc78 Merge branch 'fix/615' into 'develop'
s/TCP/ECL_TCP/ among preprocessor defines

Closes #615

See merge request embeddable-common-lisp/ecl!234
2020-11-28 16:08:21 +00:00
Pritam Baral
a1b2909b8a s/TCP/ECL_TCP/ among preprocessor defines 2020-11-22 21:04:16 +00:00
Marius Gerbershagen
6ff3b2b86b Merge branch 'partial-fix-for-600' into 'develop'
si_spawn_subprocess: _exit instead of abort if exec fails

See merge request embeddable-common-lisp/ecl!232
2020-11-15 15:10:19 +00:00
Daniel Kochmański
3d4af11001 Merge branch 'develop' into 'develop'
Fix GET-PROTOCOL-BY-NAME with unknown protocols

See merge request embeddable-common-lisp/ecl!233
2020-11-14 12:15:55 +00:00
Michał "phoe" Herda
bb40da9fa6 Fix GET-PROTOCOL-BY-NAME with unknown protocols
The function SB-BSD-SOCKETS:GET-PROTOCOL-BY-NAME did not signal
an error when it was unable to find a protocol. This is fixed now
and an error of type UNKNOWN-PROTOCOL, with an accessor named
UNKNOWN-PROTOCOL-NAME, is being signaled. These two names are also
exported from the package SB-BSD-SOCKETS.

A test case is added.

Several other test cases are fixed with regard to :NO-ERROR clauses
inside HANDLER-CASEs.
2020-11-13 19:43:33 +01:00
Eric Timmons
6a058a4bfc si_spawn_subprocess: _exit instead of abort if exec fails
On MacOS, the stream flushing that happens as part of abort can corrupt streams
in the parent process. See: #600
2020-11-12 16:45:10 -05:00
Marius Gerbershagen
1effa6a160 predlib.lsp: fix type comparisons involving gray streams
Due to gray:fundamental-stream being treated as a built-in type,
subclass relationships were not checked (see added test case).
Fixes #614.
2020-11-06 20:35:22 +01:00
Marius Gerbershagen
cdb602e40d fpe: prevent spurious floating point exceptions in WITH_LISP_FPE
feenableexcept may generate a SIGFPE signal if exception status flags
are not cleared beforehand. Happens for example on powerpc platforms.

Fixes #612.
2020-10-31 11:36:52 +01:00
Daniel Kochmański
7f1813cd93 ecl_alloc_weak_pointer: don't register immediate objects as disappearing
We have special-cased all immediate objects except ECL_T. Creating such link
leads to a segmentation fault when GC tries to dereference the pointer. Fixes #610.
2020-10-19 16:54:40 +02:00
Daniel Kochmański
246f0a6d86 Merge branch 'fix-594' into 'develop'
Fix #594

Closes #594

See merge request embeddable-common-lisp/ecl!227
2020-09-19 10:34:33 +00:00
Marius Gerbershagen
0f75177676 tests: add regression test for #594 2020-09-18 21:22:32 +02:00
Marius Gerbershagen
4e1847f775 clos: don't call make-load-form in the code walker for defmethod
Fixes #594.
2020-09-18 21:22:32 +02:00
Daniel Kochmański
ec8d636964 Merge branch 'dev' into 'develop'
exit() prototype is in stdlib.h, include it

See merge request embeddable-common-lisp/ecl!231
2020-09-18 12:35:25 +00:00
Dima Pasechnik
cd2f19fedb exit() prototype is in stdlib.h, include it
this is needed to support Apple's clang 12, the
compiler in Xcode 12 on macOS 10.15 and upcoming macOS 11.

configure was regenerated by running autoreconf -ivf
with autoconf version 2.69
2020-09-18 13:18:56 +01:00
Marius Gerbershagen
b0dfcc38f5 Merge branch 'chrstphrchvz-develop-patch-41456' into 'develop'
Fix spelling

See merge request embeddable-common-lisp/ecl!229
2020-09-13 17:44:37 +00:00
Christopher Chavez
0f3d6e08d1 Fix spelling 2020-09-11 02:11:26 +00:00
Marius Gerbershagen
5277c82c85 Merge branch 'fix-605' into 'develop'
Fix 605

Closes #605

See merge request embeddable-common-lisp/ecl!226
2020-08-23 17:14:08 +00:00
Marius Gerbershagen
a7baf701f9 doc: fix documentation of print options for trace macro 2020-08-21 20:23:13 +02:00
Daniel Kochmański
8e2d78a4b2 loop: destructuring: replace MAPCAR with a DO* loop
Simple MAPCAR must be replaced by a slightly more complicated DO, because the
list may not be a proper list. I want to dedicate this ballad to myself.

    This is a tale of a sorry quest
    To master pure code at the T guru's behest
    I enrolled in a class that appealing did seem
    For it promised to teach fine things like T3 and Scheme

    The first day went fine; we learned of cells
    And symbols and lists and functions as well
    Lisp I had mastered and excited was I
    For to master T3 my hackstincts did cry

    I sailed through the first week with no problems at all
    And I even said "closure" instead of "function call"
    Then said the master that ready were we
    To start real hacking instead of simple theory

    Will you, said he, write me a function please
    That in lists would associate values with keys
    I went home and turned on my trusty Apollo
    And wrote a function whose definition follows:

        (cdr (assq key a-list))

    A one-liner I thought, fool that I was
    Just two simple calls without a COND clause
    But when I tried this function to run
    CDR didn't think that NIL was much fun

    So I tried again like the good King of yore
    And of code I easily generated some more:

        (cond ((assq key a-list) => cdr))

    It got longer but purer, and it wasn't too bad
    But then COND ran out and that was quite sad

    Well, that isn't hard to fix, I was told
    Just write some more code, my son, be bold
    Being young, not even a moment did I pause
    I stifled my instincts and added a clause

        (cond ((assq key a-list) => cdr)
              (else nil))

    Sometimes this worked and sometimes it broke
    I debugged and prayed and even had a stroke
    Many a guru tried valiantly to help
    But undefined datums their efforts did squelch.

    I returneth once more to the great sage of T
    For no way out of the dilemma I could see
    He said it was easy -- more lines must I fill
    with code, for FALSE was no longer NIL.

        (let ((val (assq key a-list)))
           (cond (val (cdr val))
                 (else nil)))

    You'd think by now I might be nearing the end
    Of my ballad which seems bad things to portend
    You'd think that we could all go home scot-free
    But COND eschewed VAL; it wanted #T

    So I went back to the master and appealed once again
    I said, pardon me, but now I'm really insane
    He said, no you're not really going out of your head
    Instead of just VAL, you must use NOT NULL instead

        (let ((val (assq key a-list)))
           (cond ((not (null? val)) (cdr val))
                 (else nil)))

    My song is over and I'm going home to bed
    With this ineffable feeling that I've been misled
    And just in case my point you have missed
    Somehow I preferred (CDR (ASSQ KEY A-LIST))

                -- Ashwin Ram,
                   "A Short Ballad Dedicated to Program Growth"
2020-08-17 20:18:31 +02:00
Marius Gerbershagen
b219a2a3ad Merge branch 'doc-improvements' into 'develop'
Doc improvements

See merge request embeddable-common-lisp/ecl!225
2020-08-17 16:40:08 +00:00
Daniel Kochmański
39b3e78314 documentation: add an email with early ecl history 2020-08-17 18:37:19 +02:00
Daniel Kochmański
0249fc6c2c tests: mp: add smoke tests for barriers 2020-08-17 18:37:19 +02:00
Daniel Kochmański
d14cbc4150 documentation: document barriers 2020-08-17 18:37:19 +02:00
Daniel Kochmański
809b9de86f loop: destructuring: allow values shorter than variables
We achieve that by adding &optional to every sublist. Fixes #605.
2020-08-14 16:43:00 +02:00
Daniel Kochmański
b2c9ea8c6e tests: add a regression test for #605 2020-08-14 16:42:59 +02:00
Daniel Kochmański
9615103e30 documentation: update history chapter
Professor Giuseppe Attardi was kind enough to elaborate on the history of
ECL. I've rewritten the history chapter to include more precise dates and
elaborate on other implementations. Also updated inheritance graphs to
indicate, that ECL is a descendant of DELPHI Common Lisp and that there is no
cross-pollination between ECoLisp and AKCL.
2020-08-14 15:03:25 +02:00
Daniel Kochmański
57f58eaeee Merge branch 'wcon-stream-fixes' into 'develop'
Fix encoding issues for msvc

Closes #580, #582, and #581

See merge request embeddable-common-lisp/ecl!220
2020-08-14 07:01:38 +00:00
Marius Gerbershagen
6048b09ab2 Merge branch 'develop' into 'develop'
checking that makeinfo works; better messages

See merge request embeddable-common-lisp/ecl!221
2020-08-13 15:14:14 +00:00
Marius Gerbershagen
adaeaaf06c gc: fix for finalizers called from non-initialized threads
We can't use the standard functions like cl_list for allocating the
wrapper object for the finalizer since these need a working environment
for disabling interrupts.
2020-08-02 10:55:25 +02:00
Marius Gerbershagen
da62cfd203 multithreading: fix segfaults in ecl_import_current_thread
We also need the interrupt_struct in the fake env to allow explicitely
checking for interrupts on platforms where this doesn't happen implicitely
by using mprotect.
2020-08-02 10:55:25 +02:00
Marius Gerbershagen
34b17a9fe0 unixint.d: remove unused argument to si::handle-signal
Argument was unused since commit c5d2408cc5
2020-08-02 10:55:25 +02:00
Marius Gerbershagen
2e94a6ac29 cmp: read msvc output in using the correct encoding
Fixes #581.
2020-08-02 10:55:25 +02:00
Marius Gerbershagen
892a34e66d fix encoding issues on windows console streams
Always use the byte sized input/output operations ReadConsoleA/WriteConsoleA
and do all the conversion to unicode by ourself.

Moreover, expand the set of known encodings for Windows codepages and print
a warning if we encounter an unsupported codepage.

Fixes #582.
2020-08-02 10:55:25 +02:00
Dima Pasechnik
f291264ffc checking that makeinfo works; better messages 2020-07-20 09:35:58 +01:00
Daniel Kochmański
329b37d833 Merge branch 'inline-closure' into 'develop'
Fix inlining of closures (2nd try)

Closes #577

See merge request embeddable-common-lisp/ecl!209
2020-07-18 18:29:06 +00:00
Marius Gerbershagen
c7d6ddbf38 cmp: fix inlining of local closures (2nd try)
We need to compile the function body in the same environment in which
the function was defined. However the function arguments need to be
compiled in the current argument.

Fixes #577.
2020-07-18 15:07:04 +02:00
Marius Gerbershagen
a9a63b1d50 cmp: small refactor of (funcall/apply (lambda ...) ...) handling
Unify handling of LAMBDA and LAMBDA-BLOCK in c1funcall and c1apply,
split off computation of let bindings and body in
optimize-funcall/apply-lambda into a separate function.

Preliminary work to fix inlining of local closures.
2020-07-18 15:07:04 +02:00
Marius Gerbershagen
a5671dcdab cmp: refactor c1let/let* into two stages
First stages handles the bindings, second stage the body, needed to
get inlining of local closures right.
2020-07-18 15:07:04 +02:00
Daniel Kochmański
ff0c0acd55 Merge branch 'run-program-virtual-input-streams' into 'develop'
Improve run-program with virtual input streams

See merge request embeddable-common-lisp/ecl!219
2020-07-17 10:25:13 +00:00
Eric Timmons
bbbc655931 process: Propagate EOFs to child process on virtual input streams
When piping streams to child processes, if the virtual input stream returns an
EOF, close the pipe to the child.
2020-07-16 15:41:32 -04:00