Commit graph

8030 commits

Author SHA1 Message Date
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
Daniel Kochmański
ee9ff4fce5 Merge branch 'signal-handler-fixes' into 'develop'
Fix #592

Closes #592

See merge request embeddable-common-lisp/ecl!212
2020-07-13 13:15:27 +00:00
Marius Gerbershagen
0eedaf533d streams: don't signal error in file-position for windows console and socket streams
This is more consistent with other streams for which file-position
doesn't make sense, which also just return nil instead of signaling
errors.

Fixes #580.
2020-07-04 17:58:46 +02:00
Marius Gerbershagen
75877dd8f0 fpe: fix ECL_WITH_LISP_FPE macro
We can't use ecl_process_env_unsafe() == NULL to check if ECL has
booted because the return value of ecl_process_env_unsafe is
unpredictable before ECL has booted. The reason is that
ecl_process_env_unsafe calls pthread_getspecific with an uninitialized
key stored in cl_env_key. But another call to pthread_setspecific
might have already registered a key which happens to be the same as
the not yet initialized cl_env_key, yielding a non-NULL value.
2020-06-28 11:16:17 +02:00
Eric Timmons
6cbec9fe2b Add a failing test for run-program :wait nil
In this test, the EOF on the virtual input stream to the process is not
propagated to the child process, resulting in the test hanging.
2020-06-26 13:07:26 -04:00
Marius Gerbershagen
c1b5aee6de Merge branch 'mp-timedwait2' into 'develop'
Mp timedwait2

Closes #588

See merge request embeddable-common-lisp/ecl!217
2020-06-20 14:58:19 +00:00
Marius Gerbershagen
18fa789536 Merge branch 'patch-1' into 'develop'
fix a broken link in INSTALL, see #595

See merge request embeddable-common-lisp/ecl!218
2020-06-20 14:42:05 +00:00
Daniel Kochmański
4b9d6d2b34 cosmetic: add noteworthy changes to the changelog 2020-06-20 16:36:32 +02:00
Daniel Kochmański
44299c7221 contrib: serve-event: make serve-event multithreading save
Only call handlers established in the current thread and use atomic
operations to update *descriptor-handlers*.
Closes #588.

Additionally:
- improve the test code
- add a test for the leak
- provide internet machine link for the tutorial
2020-06-20 16:36:32 +02:00
Dima Pasechnik
b9676343c7 fix a broken link in INSTALL, see #595 2020-06-17 08:24:55 +00:00
Daniel Kochmański
20ccc68af0 Merge branch 'c-stack-fixes' into 'develop'
Fix #596

Closes #596

See merge request embeddable-common-lisp/ecl!215
2020-06-15 10:36:46 +00:00
Daniel Kochmański
f9db80dcbf cmp: for LAMBDA use an associated function-block-name
That makes lambda with a declaration si:function-block-name behave
consistently with ext:lambda-block (and in eval-macros
ext:lambda-block expands to have this declaration too to behave in
turn consistently with how the compiler treats ext:lambda-block).
2020-06-15 12:34:10 +02:00
Daniel Kochmański
4d9b72a88b ffi: use mp_get_lock_wait instead of mp_get_lock
The former has a fixed number of arguments and is more low-level.
2020-06-15 12:34:10 +02:00
Daniel Kochmański
9741147874 doc: add few annotations for multiprocessing primitives
Mailboxes, barriers and rwlocks are still missing. This is important
if we want to have hints in SLIME for arglists.
2020-06-15 12:34:10 +02:00
Daniel Kochmański
0bd6bd6573 cosmetic: cmp: proclamations: add missing periods 2020-06-15 12:34:10 +02:00
Daniel Kochmański
7dd6609e21 mp: condition variable: fix invalid test for recursiveness
Recursive locks may be determined from the object header while reading
the counter is wrong, because at a time of testing with the CV counter
may be exactly 1 despite the fact that the lock is recursive.
2020-06-15 12:34:10 +02:00
Daniel Kochmański
6322e34415 mp: queue: use less cryptic names
- variable name "o" is replaced with "mp_object"
- typedef "mp_wait_test" to "cl_object(*c)(cl_env_ptr,cl_object)"
2020-06-15 12:34:10 +02:00
Daniel Kochmański
a059991c12 stress tests: use a new timeout condition 2020-06-15 12:34:10 +02:00
Daniel Kochmański
0ab85fc9d5 conditions: add an ext:timeout serious condition 2020-06-15 12:34:10 +02:00
Daniel Kochmański
e7355ac1fc doc: mp: sem: fix a type with a function index 2020-06-15 12:34:10 +02:00
Daniel Kochmański
dc42ba2ec7 Merge branch 'cygwin-fix-gcc-invocation' into 'develop'
fix C compiler invocation for cygwin

See merge request embeddable-common-lisp/ecl!216
2020-06-15 10:25:21 +00:00
Marius Gerbershagen
d6b422fe39 cmp: fix C compiler invocation for cygwin 2020-06-13 11:25:20 +02:00
Marius Gerbershagen
be2d90790f Merge branch 'develop' into 'develop'
make sure C compiler conforms to C99 standard

See merge request embeddable-common-lisp/ecl!214
2020-06-12 19:06:42 +00:00
Marius Gerbershagen
9137c681a8 iOS-arm64.cross_config: fix long long bits 2020-06-12 20:50:35 +02:00
Marius Gerbershagen
9c9f07c4ce mislib.lsp: fix argument type if long-long is not available 2020-06-12 20:50:02 +02:00
Marius Gerbershagen
370e1969d8 stacks: introduce sensible behaviour if getrlimit fails
If getrlimit fails, new_size may be zero. Furthermore, getrlimit may also return
RLIM_INFINITY in which case new_size is way to large. In both cases the real stack size is
unknown and we can only use some sensible default.
2020-06-11 16:33:05 +02:00