sasagawa888/eisl

ILOS Specification nonconformity

Closed this issue · 8 comments

In verify/object.lsp

many incorrect test cases.

Easy-ISLisp Ver2.15
> (load "verify/object.lsp")
(READ-FOO-A X) is bad. correct is <class error> but got <class null> 
(ACCESS-FOO-A X) is bad. correct is <class error> but got <class null> 
(+ (DEFGENERIC FOO NIL)) is bad. correct is <class error> but got <class domain-error> 
(EQ (CLASS-OF (FUNCTION CREATE)) (CLASS <STANDARD-GENERIC-FUNCTION>)) is bad. correct is T but got NIL 
(EQ (CLASS-OF (QUOTE A)) (CLASS <SYMBOL>)) is bad. correct is T but got NIL 
(EQ (CLASS-OF CC) (CLASS <SIMPLE-ERROR>)) is bad. correct is T but got NIL 
(EQ (CLASS-OF CC) (CLASS <END-OF-STREAM>)) is bad. correct is T but got NIL 
(EQ (CLASS-OF A-3) (CLASS <INVALID>)) is bad. correct is T but got NIL 
(INSTANCEP CC (CLASS <SIMPLE-ERROR>)) is bad. correct is T but got NIL 
(INSTANCEP CC (CLASS <STREAM-ERROR>)) is bad. correct is T but got NIL 
(INSTANCEP CC (CLASS <END-OF-STREAM>)) is bad. correct is T but got NIL 
(INSTANCEP (QUOTE A) (CLASS <SYMBOL>)) is bad. correct is T but got NIL 
(INSTANCEP (QUOTE A) (CLASS <STANDARD-CLASS>)) is bad. correct is NIL but got T 
(INSTANCEP (QUOTE A) (CLASS <STANDARD-OBJECT>)) is bad. correct is NIL but got T 
(INSTANCEP (CLASS C1111) (CLASS <STANDARD-CLASS>)) is bad. correct is T but got NIL 
T
> 

Partially fixed.

The symbol remained a symbol, even if it was assigned a class with defclass.
e.g.

> (defclass b () ())
B
> (class-of 'b)
<class symbol>
> (instancep 'b (class <symbol>))
T
> 

Partially fixed.

create is standard-generic-function

Easy-ISLisp Ver2.16
> (class-of #'create)
<class standard-generic-function>
>

Partially fixed.

Easy-ISLisp Ver2.16
> (instancep #'create (class <standard-generic-function>))
NIL
> (instancep #'create (class <generic-function>))
T
> (instancep #'create (class <object>))
T
> 

Partially fixed.
error function generate class is simple-error

‘‘‘
;;
($eval (catch-condition (error "err")))
(test (eq (class-of cc) (class )) t)
‘‘‘

Partially fixed.

Fixed instancep.

user defined class is standard-class.

I added meta-class and syntax error checks to defclass syntax.

I added top-lebel check to defgeneric and defmethod. I added test library $error1 macro to test top-level check.

I have fixed many nonconformities. If you use ILOS normally, it's probably okay.