[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[imp-dev] A proposed API change in Type
- From: Jurgen Vinju <Jurgen.Vinju@xxxxxx>
- Date: Wed, 18 Jan 2012 08:02:19 +0100
- Delivered-to: email@example.com
I'd like to propose an API change for the match method in Type. It's now:
void match(Type pattern, Map<Type,Type> bindings) throws FactMatchException;
When the match succeeds the bindings contain a map from type
parameters to bound types, when the match fails the method throws an
exception. This method is implemented in all alternative sub-classes
of types (interpreter design pattern).
The issue is that failure is quite a common case when matching
composite type structures and so the exception gets thrown quite
often. This leads to bad performance here and there.
So, I'd like to propose a change to:
boolean match(Type pattern, Map<Type,Type> bindings);
and ask you to change your code accordingly after where necessary. Is this ok?
- Centrum Wiskunde & Informatica - SEN1
- INRIA Lille - ATEAMS
- Universiteit van Amsterdam