Commit graph

519 commits

Author SHA1 Message Date
Marius Gerbershagen
689ac03a85 be more consistent w.r.t *print-level* when printing structures
Print empty structures without slots as "#" when *print-level* is
    0 (same as non-empty structures) and decrement *print-level* by 1
    for printing of structure elements.
    Fixes #454.
2019-01-30 21:00:59 +01:00
Marius Gerbershagen
cf2fe46ddf fix with-restart-case for restarts with both :test and :interactive
Issue reported and fix provided by gitlab user Bicyclidine. Closes
    #450.
2019-01-19 21:18:59 +01:00
Marius Gerbershagen
663f2fb301 delete unused files 2018-12-08 10:42:31 +01:00
Marius Gerbershagen
239a2aa4f1 threading: add support for atomic operations
We support both compare-and-swap and fetch-and-add (via
    atomic-incf/decf) on the most common places and define an
    extension interface for compare-and-swap similiar to the one in
    SBCL.

    These changes introduce new dependencies on the libatomic_ops
    macros AO_fetch_compare_and_swap and AO_fetch_and_add.
2018-10-15 19:55:39 +02:00
Marius Gerbershagen
25a72ff80a cosmetic: indentation fixes and some comments 2018-06-23 21:37:26 +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
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
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
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
Daniel Kochmanski
d641c39bd9 clos: invalidate initarg caches when new methods are defined
Closes #425. Fix contributed by Bike from #clasp.
2018-04-06 16:36:36 +02:00
Daniel Kochmanski
e92cfdf437 Unify compilation environment markers
In both bytecmp and c compiler we use si:function-boundary and
si:unwind-protect-boundary where appropriate. Previously bytecmp used an ad-hoc
special variable for function-boundary and didn't mark unwind-protect at all.

Remove recently-introduced ECI package (maybe we will reintroduce it later when
we'll have a common frontend for compilers).
2018-02-15 12:44:49 +01:00
Daniel Kochmanski
9be0e12ccd Revert "Fix package of *clos-booted* which is set in streams"
This reverts commit 04e8b63b18.
2018-02-03 16:27:30 +01:00
Daniel Kochmanski
04e8b63b18 Fix package of *clos-booted* which is set in streams
GRAY package was used and symbols were not EQ, so I assume this was a
typo. Problem noticed by drmeister (thanks!).
2018-02-03 11:16:51 +01:00
Daniel Kochmański
915b40ce03 cleanup: move C/CXX part of CLOS to src/c/clos/ directory
instance.d and gfun.d were in the top C source directory.
2017-05-06 18:27:34 +02:00
Daniel Kochmański
d6e5f95d6e combin.lsp: remove eval from method combinations 2017-01-15 12:03:13 +01:00
Daniel Kochmański
4d215b05fc print-object: print structure slots conformingly
Fixes #178.
2017-01-15 12:02:49 +01:00
Vadim Penzin
fa0b55ba5b Prevent CLOS' stream-read-line from signalling end-of-file while reading unterminated lines. 2017-01-05 13:44:38 +02:00
Daniel Kochmański
30d783904d simplify simplify-lambda and install-method functions
Remove dead code branches.
2016-11-20 20:11:46 +01:00
Daniel Kochmański
8a099051ed refactor: clean up defmethod macro
prerequisite step for bugfix
2016-11-20 19:51:53 +01:00
Daniel Kochmański
17bce26704 Add declarations in call-next-method closure
Lack of them caused omission of `ignorable' declaration what lead to the
bogus style notes. Fixes #80.
2016-11-20 11:23:32 +01:00
Daniel Kochmański
8df64c7dc7 CDR: implement cdr-14
Added CDR-1, CDR-5 and CDR-14 to *features*.

https://common-lisp.net/project/cdr/document/14/index.html
2016-11-05 19:08:15 +01:00
Stas Boukarev
5f0beddf69 Better printing of method objects.
Print method qualifiers.
For specializers, print class names, not class objects, and print eql specializers.

(defmethod m :around (a b (c (eql "10"))))
was

#<standard-method M (#<BUILT-IN-CLASS T> #<BUILT-IN-CLASS T>
                     #<CLOS:EQL-SPECIALIZER>)>
becomes
#<standard-method M :AROUND (T T (EQL "10"))>
2016-08-30 21:37:24 +03:00
Daniel Kochmański
9874b6e53a ieee-floats: fix printing of NaN's
Add readable print if the feature :ieee-floating-point is present.
2016-08-12 08:48:36 +02:00
Daniel Kochmański
bc567e0c3f ieee-floats: fix printing
Do redundant type test in case we're calling it from somewhere else.
2016-08-12 08:28:43 +02:00
Daniel Kochmański
ed5ecd03eb ieee-floats: fix builds with --with-ieee-fp=no
Functions to print (nan,float)-to-string and and predicates are still
available, but ext:*-float-*-infinity aren't available if ECL is built
with option `--with-ieee-fp=no`.
2016-08-11 22:38:30 +02:00
Daniel Kochmański
7569359860 make-load-form: add random-state implementation 2016-08-10 13:55:06 +02:00
Daniel Kochmański
c13cab3dc6 cosmetic: fix error message arguments 2016-08-09 17:36:05 +02:00
Daniel Kochmański
1636b6110f print-object: add default t-specialized printer
Fixes #193.
2016-07-03 17:05:36 +02:00
Daniel Kochmański
8406e1e4fc signal: fix the problem with restart-case and signal
Fixes #247.
2016-05-29 14:17:37 +02:00
Stas Boukarev
e4cdda1182 Remove a spurious character in SIGNAL. 2016-04-20 19:30:54 +03:00
Daniel Kochmański
1b32325af0 mop: r-o-s-a: change find-method invocation
Fix removing optional slot accessors when classes are redefined when
calling on anonymous classes.
2016-03-26 07:01:12 +01:00
Daniel Kochmański
7be1680f96 mop: initialize-instane: add additional check
This ensures, that superclasses get initialized properly.
2016-03-26 07:00:18 +01:00
Daniel Kochmański
1d7e3c1dc4 mop: fix incorret superclass reinitialization
Slots are only modified when they are explicitly passed (see HyperSpec
entry for shared-initialize).
2016-03-26 06:59:04 +01:00
Daniel Kochmański
7898553d6a mop: fix bug in compute-applicable-methods-using-classes
Move computation of args-specializers from #'sort-applicable-methods up
to #'std-compute-applicable-methods. Fix suggested by @costanza.
Fixes #203.
2016-01-04 20:40:37 +01:00
Daniel Kochmański
84f0a89da3 cosmetic: line wrapping 2016-01-04 10:29:27 +01:00
Daniel Kochmański
40c82c18d8 gray-streams: remove CLOSE general specialization
Some libraries somewhat abuse the CLOSE method specializing it on their
own stuff which isn't a stream. Calling the NEXT-METHOD triggers the
condition. For pragmatic reasons we'll honor this and will specialize
only on the streams.
2015-11-27 17:54:02 +01:00
Daniel Kochmański
ed8714ab21 cosmetic: fix indent and wrap lines correctly 2015-11-27 13:35:37 +01:00
Matthew Mondor
4f89d66d41 Fix some fallout from the script to correct/add Emacs and ViM syntax
directives.  Some files had more than one existing Emacs directives,
breaking the script which didn't expect this.
2015-09-03 16:16:12 -04:00
Daniel Kochmański
c80e3cad11 Merge branch 'style' into 'develop'
"style" temporary branch

The ECL code no longer uses tabulator characters, they were replaced
by spaces.

A custom script was used to insert/replace Emacs and ViM per-file editor
settings according to their type and the new ECL coding style.

See merge request !8
2015-09-03 18:07:04 +00:00
Matthew Mondor
8f07cd58d8 The ECL code no longer uses tabulator characters, they were replaced
by spaces.

A custom script was used to insert/replace Emacs and ViM per-file editor
settings according to their type and the new ECL coding style.
2015-09-03 07:35:47 -04:00
Daniel Kochmański
527be2a017 printer: coerce float infinity more roboustly
Basically use C function instead of a generic Lisp one.

Signed-off-by: Daniel Kochmański <daniel@turtleware.eu>
2015-09-03 08:47:00 +02:00
Daniel Kochmański
d15c42d2a1 printer: float infinity/nan: coerce printed form to base-string
CLOS printer uses normal strings while float_to_string.d calls
push_base_string to cache printable form of infinity (and nan). Coerce
clos strings to base-string. Fixes #153. Related to #114.

Signed-off-by: Daniel Kochmański <daniel@turtleware.eu>
2015-09-03 08:12:08 +02:00
Matthew Mondor
5517fa5631 Change *FEATURES* name :NEW to :WAKLER (clos/walk.lsp) after
discussion
2015-08-27 04:46:28 -04:00
Daniel Kochmański
61a5f49639 clos: add single-float and double-float to built-in class hierarchy
Some libraries want methods to specialize on double-float and ECL
fails on such attempts. Fixes #96.

Signed-off-by: Daniel Kochmański <daniel@turtleware.eu>
2015-07-26 12:41:27 +02:00
Daniel Kochmański
a4283c3f8c clos: fix `print-object' for non- standard-object's
Previous commit overgeneralized. Handle just one particular corner
situation, when print-object leaks from standard-object to builtin
class T.

Signed-off-by: Daniel Kochmański <dkochmanski@turtle-solutions.eu>
2015-07-07 16:11:47 +02:00
Daniel Kochmański
74021ab1a9 clos: fix `print-object' specialized on T (infinite recurrence)
Corner case. When user despite spec defines method `print-object'
specialized on standard-object and calls call-next-method,
`print-object' specialized on T called `write', which triggers
original `print-object' specialized on `standard-object'.

Signed-off-by: Daniel Kochmański <dkochmanski@turtle-solutions.eu>
2015-07-07 12:00:49 +02:00
Daniel Kochmański
180567dfbd stack-overflow: improve condition message
Signed-off-by: Daniel Kochmański <dkochmanski@turtle-solutions.eu>
2015-06-24 17:09:41 +02:00
Daniel Kochmański
09ae630cde stack: add special conditional handler for stack-overflow
Add `serror' and `stack-error-handler', which behave like normal
`cerror' -> `universal-error-handler' call order, except fact, that
after handling stack-overflow condition they reset appropriate stack
limit. Fixes #56.

Signed-off-by: Daniel Kochmański <dkochmanski@turtle-solutions.eu>
2015-06-24 13:45:54 +02:00
Daniel Kochmański
4d19a27424 cosmetic: untabify
Signed-off-by: Daniel Kochmański <dkochmanski@turtle-solutions.eu>
2015-06-21 14:38:20 +02:00