Commit graph

7476 commits

Author SHA1 Message Date
Marius Gerbershagen
25a72ff80a cosmetic: indentation fixes and some comments 2018-06-23 21:37:26 +02:00
Marius Gerbershagen
d27f1494e1 cmp: fix compile call for closures
Signal an error for compilation of cclosures. Allow for
    compilation of bclosures over macros, functions and variables.
    Macros are simply added to the compiler environment. For functions
    and variables we enclose the definition of the closure in
    appropiate let/flet forms, e.g. for `(lambda () (fun var))'
    closing over the function `fun' and variable `var':
    (let ((var ...))
      (flet ((fun (x) ...))
        (lambda () (fun var))))
    Closures over tags and blocks are not implemented and will signal
    an error during compilation.
2018-06-23 21:37:26 +02:00
Marius Gerbershagen
b0a7684f2f bytecmp: Allow compilation of closures over macros
Change lexenv to include local macro definitions at the end of the
    lexenv list. If a function is defined in a non-nil macro
    environment, a bclosure is created during compilation which has as
    its lexenv only the macros it closes over. During interpretation,
    ecl_close_around adds to this the variables, functions, blocks
    and tags the function also closes over.
    Also close over symbol macros.
2018-06-23 21:37:25 +02:00
Marius Gerbershagen
c7a0b753c9 bytecmp: fix compilation of closures
Extract function name for bclosures in guess_environment and
    signal an error when attempting to compile a cclosure
2018-06-23 21:37:15 +02:00
Marius Gerbershagen
4e02997d79 printer/reader: call user defined write/read-sequence methods for CLOS streams
Before this change, we called user defined write-string methods
    directly in write-string/write-line but all other operations were
    done inefficiently through generic_write/read_vector.
2018-06-06 22:32:22 +02:00
Marius Gerbershagen
706847293d printer: use si_do_write_sequence in recently optimized printing routines
We don't need cl_write_string, since the CLOS stuff inside there
    is just for optimization. Improves performance for ANSI streams.
2018-06-05 21:30:29 +02:00
Marius Gerbershagen
25e1417dac doc: add dictionary for extensions to ANSI streams 2018-06-01 21:56:40 +02:00
Marius Gerbershagen
dff75dc004 cmp: push the generic function name in the IHS for CLOS methods
Makes debugging easier, since now the backtrace prints the correct
    generic function name instead of some symbol generated by gensym.
2018-05-31 19:48:48 +02:00
Marius Gerbershagen
65524e01d8 add changelog entry for removed sigaltstack option 2018-05-30 18:35:40 +02:00
Marius Gerbershagen
fd62dc11f8 threading: be more interrupt safe with thread local variables in environment
Also add some comments and use the right interrupt disabling
    mechanism in get_aux_stream.
2018-05-27 20:57:50 +02:00
Marius Gerbershagen
9f8adbbe4e remove unused (sig)altstack option
This functionality has been removed long ago with commit
    1472cc91ef.
2018-05-27 20:30:22 +02:00
Marius Gerbershagen
fd1affa7d0 Print a C backtrace in ecl_thread_internal_error
After the recent changes to the C backtrace interface,
    _ecl_dump_c_backtrace() no longer needs a working lisp
    environment, so we can safely call it here.
2018-05-27 18:21:30 +02:00
Marius Gerbershagen
861e798cd3 Correctly report if variables are bound or not in si_bds_val
For thread local bindings, ECL_NO_TL_BINDING is used to signal an
    unbound variable. Fixes error from #325.
2018-05-27 17:33:48 +02:00
Daniel Kochmański
5de18683ac Merge branch 'develop' into 'develop'
Fix for #403

Closes #403

See merge request embeddable-common-lisp/ecl!109
2018-05-25 05:11:26 +00:00
Marius Gerbershagen
2c135e798b printer: fix the recently optimized printing routines
Overflows of the string buffer were not correctly handled.
2018-05-23 22:13:15 +02:00
Marius Gerbershagen
5f621c6e96 printer: use the string pool to optimize more printing routines 2018-05-14 22:20:44 +02:00
Marius Gerbershagen
5947970f6d printer: optimize printing of strings. Fixes #403 2018-05-13 22:32:09 +02:00
Marius Gerbershagen
f104b1f4f0 reader: process lists iteratively in do_patch_sharp
Prevents stack overflows and probably improves performance a
    little bit.
2018-05-12 16:28:45 +02:00
Marius Gerbershagen
f75a43139b ffi: coerce to base strings automatically in ecl_null_terminated_base_string
Don't coerce symbols to strings, since this would be inconsistent
    with the rest of the ffi interface. Fixes #338. Also fix bad type
    checks.
2018-05-11 22:29:25 +02:00
Daniel Kochmanski
4cddf5b466 Open IO fifo in blocking mode and don't use peek-char in listen
Otherwise we can't connect to X server (unix domain socket):
- it is a binary stream (and we get error when we use listen)
- non-blocking io connection doesn't seem to work
2018-05-11 11:35:01 +02:00
Daniel Kochmanski
e3b9919ffa fixes for windows (S_ISFIFO) 2018-05-08 20:05:34 +02:00
Daniel Kochmanski
11f31beafb Merge branch 'spaghettisalat/ecl-develop' into develop 2018-05-08 19:40:55 +02:00
Daniel Kochmanski
94342d2ea9 add changelog entry about improved C backtraces 2018-05-08 19:40:14 +02:00
Daniel Kochmanski
d4370d1b31 re-add deprecation of rt and profile (rebase thing) 2018-05-08 19:36:11 +02:00
Marius Gerbershagen
b87fc19afb remove no longer needed checks in configure.ac 2018-05-08 19:36:11 +02:00
Marius Gerbershagen
a3a44a0eeb debugger: add C backtrace for windows
Because that needs the DbgHelp library, an additional make
    option has been defined for users, who don't want to link to this
    library. Some msvc Makefile cleanup has also been done.
2018-05-08 19:36:11 +02:00
Marius Gerbershagen
2279361383 debugger: add option to print C backtrace
Split si_dump_c_backtrace up into two functions:
    - _ecl_dump_c_backtrace() (already declared in internal.h, but not
      implemented) using only C functions printing to stderr to be used
      in case of internal errors
    - si_dump_c_backtrace() using lisp functions to be used in the
      debugger
    Remove broken emulation of backtrace and backtrace_symbols
    functions using __builtin_return_address.
2018-05-08 19:36:11 +02:00
Daniel Kochmanski
23d38639b2 define O_NONBLOCK to 0 for non-posix platforms
We use this flag in ecl_open_file to assure that fifos do not block.
2018-05-08 19:33:38 +02:00
Daniel Kochmanski
1972765ab0 fifo files: update documentation, tests and changelog 2018-05-08 19:12:19 +02:00
Daniel Kochmanski
0e84113f84 work better with FIFO files
- file-length always returns nil
- listen returns correct answer on subsequent reads
- open is non-blocking
- doesn't segfault

note that read still may block (not interruptibly!) if we open stream in IO
mode. process will block until other peer writes something to the stream.

Fixes #242.
2018-05-07 22:03:50 +02:00
Daniel Kochmanski
c35f98ef58 ecl_open_stream refactor
We rearrange the code and avoid unnecessary file operations with probe. Some
nesting is removed.
2018-05-07 22:03:50 +02:00
Daniel Kochmanski
d9c4b2a88c Add explicit :TRUNCATE option for :IF-EXISTS in OPEN
In the future we may want to make :SUPERSEDE transaction-like.
2018-05-07 22:03:50 +02:00
Daniel Kochmański
2fa20297b3 Merge branch 'develop' into 'develop'
add missing obj files to msvc Makefile

See merge request embeddable-common-lisp/ecl!107
2018-05-07 06:12:19 +00:00
Yuguo Zhang
008422d75d add missing obj files to msvc Makefile 2018-05-07 11:02:59 +08:00
Daniel Kochmański
7223534c61 Merge branch 'interface-cleanup' into 'develop'
Interface cleanup

See merge request embeddable-common-lisp/ecl!105
2018-05-04 08:41:13 +00:00
Daniel Kochmański
923997f69b Merge branch 'printer-addresses' into 'develop'
Printer addresses

Closes #440

See merge request embeddable-common-lisp/ecl!104
2018-05-04 08:38:33 +00:00
Daniel Kochmański
ca0962cdb3 Printer addresses 2018-05-04 08:38:33 +00:00
Daniel Kochmanski
0494fb1592 Moderate interface cleanup
- unicode name tables are always compiled in when we have unicode support
- thread local variables support is removed
- profile and rt contribs are deprecated
2018-05-01 10:16:20 +02:00
Daniel Kochmanski
c3244b0148 Remove deprecated 8-bit opcodes 2018-04-29 13:54:38 +02:00
Marius Gerbershagen
07391b9ced reader: be more ANSI compliant with *read-suppress*
We should not signal an error if we don't find a dispatch macro
    character and *read-suppress* is true. The following example from
    the CLHS documentation on *read-suppress* wrongly signaled an
    error:
      (let ((*read-suppress* t)) (read-from-string "#\garbage"))
    Fixes #431.
2018-04-24 22:42:10 +02:00
Marius Gerbershagen
7955a36b08 reader: signal different error when not finding an external symbol
Most other implementations signal a reader-error instead of a
    simple-error. Closes #438.
2018-04-24 21:28:41 +02:00
Marius Gerbershagen
58c5316ece bytecmp: Unify behaviour of nested eval-when forms with native compiler
The current behaviour may technically be ANSI compliant, but it
    differs from the behaviour of the native compiler and from many
    other Common Lisp implementations (sbcl, ccl, clisp, abcl and cmucl).
2018-04-21 18:14:28 +02:00
Marius Gerbershagen
b00e62f9d3 cmp: Allow for compile time evaluation of inlined forms
The following statement:
    (eval-when (:compile-toplevel :load-toplevel :execute)
      (print "test"))
    resulted in an error, since the compiler would expand the print
    statement in a FFI:C-INLINE form, which can't be evaluated at
    compile time.
2018-04-21 15:34:20 +02:00
Marius Gerbershagen
825c8d2b2e doc: Add section for C compiler configuration options
Closes #218.
2018-04-09 22:23:25 +02:00
Daniel Kochmanski
399b2357a1 remove unused function 2018-04-09 07:53:41 +02:00
Daniel Kochmanski
2c52e278cc Don't ensure GF in method macroexpansion time
Fixes #46.

Also some cosmetic fixes and test fix.
2018-04-08 21:05:37 +02:00
Daniel Kochmanski
28d245631e tests: add class-forward-reference regression test (fixed in last commit) 2018-04-08 11:09:11 +02:00
Daniel Kochmanski
ead9ab4f38 validate-superclass: return T when class is a forward-referenced-class
defclass calls indirectly ensure-class-using-class from builtin module which
calls make-instance on metaclass (which could be a forward-referenced
class). That triggers validate-superclass on

  (validate-superclass #<forward-ref-class> #<standard-class standard-object>)

which failed. This commit mitigates this situation. Problem was masked
because of *clos-boot* never been set to T (recently fixed).
2018-04-08 10:56:50 +02:00
Daniel Kochmanski
7f1bb5c59b tests: add two regression tests 2018-04-06 17:51:33 +02:00
Daniel Kochmanski
98f29d34b9 clos: don't allow subclassing builtin classes
This issue was discussed at some point in the past. See
https://gitlab.com/embeddable-common-lisp/ecl/issues/426 for some logs.

Fixes #426.
2018-04-06 17:36:06 +02:00