Lambda Tree API changes feedback
Michael Nascimento
misterm at gmail.com
Fri Nov 16 03:14:10 PST 2012
On Fri, Nov 16, 2012 at 6:49 AM, Maurizio Cimadamore
<maurizio.cimadamore at oracle.com> wrote:
> On 15/11/12 23:30, Michael Nascimento wrote:
>> - What is the purpose of having a special getBodyKind() in
>> LambdaExpressionTree? Why isn't the regular getKind() in the Tree
>> returned by getBody() enough?
>
> Yeah - that should be enough - however since the spec stresses difference
> between statement/expression lambdas I thought it might be useful having it
> more explicit
Well, it is actually confusing. It gives the impression there is
something different going on. It seems better to remove it, imho.
>> - Any reason for not providing a super interface between
>> IntersectionTypeTree and TypeParameterTree or MethodTree and
>> LambdaExpressionTree?
>
> These are distinct concepts - a type parameter might have a bound that is an
> intersection type, but it's not itself an intersection type. Also, a lambda
> looks like a method declaration, but it's not - it's an expression and not a
> symbol declaration. Those differences, in my mind, are enough to justify use
> of different interfaces (with bit of duplication).
I do think there should be separate interfaces, but for me the only
difference between MT and LET is the introduction of a symbol
connected with a class, so it feels like one might want to handle
these in a similar way depending on the analysis being done and a
superinterface or hierarchy here would be helpful.
Regards,
Michael
More information about the lambda-dev
mailing list