IWrapped interface to allow wrapping of IValues from the outside.

Simple extension interface to allow wrapping of IValues without breaking equality checking.

Yes, such a feature is feasible. All values should have enough getters to
recreate the same value from basic values, so they should also allow for
full equality checking in that manner.

Still, there is the visitor design pattern which closes over the extensions
of IValue. IWrappedValue is thus problematic. At least you should extend
IExternalValue such that the visitors will not puke. There is a basic
implementation of IExternalValue which will take care of the proper
forwarding when visiting a value.


On Wed, Jul 2, 2014 at 9:18 PM, Tijs van der Storm <notifications@github.com
> wrote:

> In src/org/eclipse/imp/pdb/facts/util/EqualityUtils.java:
>
> > @@ -43,6 +44,13 @@ public static Comparator getEquivalenceComparator() {
> >  			public int compare(Object a, Object b) {
> >  				IValue v = (IValue) a;
> >  				IValue w = (IValue) b;
> > +				
> > +				if (v instanceof IWrapped) {
>
> Well, see previous comment. Is it feasible to define all equals checking
> without casting to impl types or getClassing?
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/impulse-org/pdb.values/pull/42/files#r14477669>.
>



-- 
Jurgen Vinju
- Centrum Wiskunde & Informatica - SEN1
- INRIA Lille - ATEAMS
- Universiteit van Amsterdam

  www: http://jurgen.vinju.org, http://www.rascal-mpl.nl,
http://twitter.com/jurgenvinju
skype: jurgen.vinju