- extend tests for make-instances-obsolete
- add a metastability test for the standard-method finalization
- fix tests which assume that metaclasses are finalized eagerly
On linux, using AI_ADDRCONFIG causes getaddrinfo to return no ip
address for localhost when only the loopback connection is
active. Also, we only get ipv4 addresses anyway due to specifying
ai_family = AF_INET, therefore the AI_ADDRCONFIG flag in not necessary
anyway.
The Common Lisp Standard defines that with-input-from-string always closes the
input stream that it creates. But with the current definition it would only be
closed in the case of an index variable being provided.
This change wraps the code for both cases (index given or not) in a unified
unwind-protect form, updates the index if present, and always closes the
stream. It also unifies the processing of declarations.
Downcase code & fix indentation:
Set the uppercased code in lower case to harmonise appearance and increase
readability. Differentiated indentation for the first forms in unwind-protect
and multiple-value-prog1 helps to understand their special meaning.
Fix 49b244db78 assumed, that the class
itself is first in the CPL list, and this assumption while correct in
light of MOP specification may be broken by a non-conforming code.
Bringing back the check whether (eq x class) when we try to finalize
the "top-most class which is not yet finalized" does not break
conforming code whiel still enabling slihgtly broken code to work.
Fixes#572.
Lambda list congruency is described here:
- 7.6.4 Congruent Lambda-lists for all Methods of a Generic Function
- 7.6.5 Keyword Arguments in Generic Functions and Methods
Previously we have tested conformingly for the fourth point:
4. If the generic function lambda list mentions &key, each method
must accept all of the keyword names mentioned after &key, either by
accepting them explicitly, by specifying &allow-other-keys, or by
specifying &rest but not &key. Each method can accept additional
keyword arguments of its own. The checking of the validity of
keyword names is done in the generic function, not in each method. A
method is invoked as if the keyword argument pair whose name is
:allow-other-keys and whose value is true were supplied, though no
such argument pair will be passed.
The fifth point mentions that if either the generic function or any
applicable method has &allow-other-keys, then function may be called
with extra keyword arguments:
5. The use of &allow-other-keys need not be consistent across lambda
lists. If &allow-other-keys is mentioned in the lambda list of any
applicable method or of the generic function, any keyword arguments
may be mentioned in the call to the generic function.
This change makes the fourth point more consistent with the fifth,
however it is *not* conformant when it is read literally. Reasons for
this change:
- this behavior is exhibited at least by SBCL and CCL, so we'll be
more compatible with a non-conformant code tested on them
- the change won't impact results of a correct program unless it
depends on the defmethod signaling an error condition
Function is rewritten in C in compiler.d to remove a dependency
between the bytecodes compiler and the clos module. It may be more
performant thanks to more precise type handing, however we use a list
instead of a hashtable, so it may be slower with lookup. To assess
that we should run some benchmarks against real code -- rewriting C
code to work with a hash table should be trivial.
clos::need-to-make-load-form-p is now si::need-to-make-load-form-p and
may be called from C code as si_need_to_make_load_form_p.
We've reinitialized the class even when it was already finalized and
none of its parents has changed with the recomputed information.
That leads to replacing the class slots with a result of COMPUTE-SLOTS
and in effect changing the INSTANCE-SIG (see src/clos/change.lsp).
Next time when ENSURE-UP-TO-DATE-INSTANCE is called (i.e from the
STANDARD-INSTANCE-ACCESS), then the instance is reinitalized.
Behavior was the most notable when we had tried to re-finalize the
STANDARD-EFFECTIVE-SLOT-DEFINITION class, because then /its new/ slots
were by definition obsolete after calling setf on this class and
unbound, what leads to an infinite recursion when we try to signal
unbound-slot condition.
Fixes#568.
Now instead of a default printer #<a foo> we have the identity
information #<a foo 0x56123571d240>. That is certainly useful for
printing when we have lists of instances of the same class.
@"foo" will expand to ecl_make_constant_base_string("foo", -1) now.
That saves some typing during testing when we want to feed a string to
the cl_format and other CL functions opearting on strings.
Now:
cl_format(3, @"~a: ~s", obj1, obj2);
Then:
cl_object str = ecl_make_constant_base_string("~a: ~s", -1);
cl_format(3, str, obj1, obj2);
Init forms are deferred when possible. This change solves two problems:
- init forms using uninitialized constant boxes
- make forms not signaling an error when circular
Partial fix for #562 (we need to fix bytecodes compiler too).
When a local function calls a closure it has to be a closure too. Thus
when updating the closure type for a function f, we have to possibly
update also all functions referencing f.
Fixes#545.
According to the C99 standard, compilers are supposed to automatically
choose the correct type. However, for the C89 standard explicit suffixes
are needed for long longs. Guess what standard msvc follows...
Bug was introduced by the recent race condition fixes of commit
cc7c0d4386. ecl_list_process needs to be
able to allocate memory and bind special variables, which wasn't possible
previously, because the environment was not yet initialized. Since we can't
initialize the environment before calling ecl_list_process (that was the
reason for the race condition in the first place), we use the fake environment
allocated on the stack (where the gc can find its contents) until we can
safely call ecl_list_process and switch over to the real environment.
Fixes#564.