Changes between Version 3 and Version 4 of external


Ignore:
Timestamp:
08/12/12 17:18:58 (9 years ago)
Author:
Mark Evenson
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • external

    v3 v4  
    8282
    8383}}}
     84
     85{{{
     86isAssignable(v, X) :- isAssignable(the_direct_supertype_of_v, X).
     87}}}
     88
     89{{{
     90isAssignable(class(X, Lx), class(Y, Ly)) :-
     91    isJavaAssignable(class(X, Lx), class(Y, Ly)).
     92
     93isAssignable(arrayOf(X), class(Y, L)) :-
     94    isJavaAssignable(arrayOf(X), class(Y, L)).
     95
     96isAssignable(arrayOf(X), arrayOf(Y)) :-
     97    isJavaAssignable(arrayOf(X),arrayOf(Y)).
     98}}}
     99
     100{{{
     101isJavaAssignable(class(_, _), class(To, L)) :-
     102    loadedClass(To, L, ToClass),
     103    classIsInterface(ToClass).
     104
     105isJavaAssignable(From, To) :-
     106    isJavaSubclassOf(From, To).
     107}}}
     108{{{
     109
     110isJavaAssignable(arrayOf(_), class('java/lang/Object', BL)) :-
     111    isBootstrapLoader(BL).
     112}}}
     113{{{
     114isJavaAssignable(arrayOf(_), X) :-
     115    isArrayInterface(X).
     116}}}
     117{{{
     118isJavaAssignable(arrayOf(X), arrayOf(Y)) :-
     119    atom(X),
     120    atom(Y),
     121    X = Y.
     122}}}
     123{{{
     124isJavaAssignable(arrayOf(X), arrayOf(Y)) :-
     125    compound(X), compound(Y), isJavaAssignable(X, Y).
     126
     127isArrayInterface(class('java/lang/Cloneable', BL)) :-
     128    isBootstrapLoader(BL).
     129
     130isArrayInterface(class('java/io/Serializable', BL)) :-
     131    isBootstrapLoader(BL).
     132}}}