Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6581659
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T16:10:54+00:00 2026-05-25T16:10:54+00:00

I read from an interview with Neal Gafter : For example, adding function types

  • 0

I read from an interview with Neal Gafter:

“For example, adding function types to the programming language is much more difficult with Erasure as part of Generics.”

EDIT:
Another place where I’ve met similar statement was in Brian Goetz’s message in Lambda Dev mailing list, where he says that lambdas are easier to handle when they are just anonymous classes with syntactic sugar:

But my objection to function types was not that I don’t like function types — I love function types — but that function types fought badly with an existing aspect of the Java type system, erasure. Erased function types are the worst of both worlds. So we removed this from the design.

Can anyone explain these statements? Why would I need runtime type information with lambdas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T16:10:54+00:00Added an answer on May 25, 2026 at 4:10 pm

    The way I understand it, is that they decided that thanks to erasure it would be messy to go the way of ‘function types‘, e.g. delegates in C# and they only could use lambda expressions, which is just a simplification of single abstract method class syntax.

    Delegates in C#:

    public delegate void DoSomethingDelegate(Object param1, Object param2);
    ...
    //now assign some method to the function type variable (delegate)
    DoSomethingDelegate f = DoSomething;
    f(new Object(), new Object());
    

    (another sample here
    http://geekswithblogs.net/joycsharp/archive/2008/02/15/simple-c-delegate-sample.aspx)

    One argument they put forward in Project Lambda docs:

    Generic types are erased, which would expose additional places where
    developers are exposed to erasure. For example, it would not be
    possible to overload methods m(T->U) and m(X->Y), which would be
    confusing.

    section 2 in:
    http://cr.openjdk.java.net/~briangoetz/lambda/lambda-state-3.html

    (The final lambda expressions syntax will be a bit different from the above document:
    http://mail.openjdk.java.net/pipermail/lambda-dev/2011-September/003936.html)

    (x, y) => { System.out.printf("%d + %d = %d%n", x, y, x+y); }
    

    All in all, my best understanding is that only a part of syntax stuff that could, actually will be used.
    What Neal Gafter most likely meant was that not being able to use delegates will make standard APIs more difficult to adjust to functional style, rather than that javac/JVM update would be more difficult to be done.

    If someone understands this better than me, I will be happy to read his account.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How much is read from ThreadLocal variable slower than from regular field? More concretely
What does the word dead beef mean? I read it from a interview question.
I read from a lot of webpage (for example: http://www.wellho.net/regex/java.html ), they all mentioned
I read from some books that Phusion Passenger is the answer to easy Ruby
From what I've read from Herb Sutter and others you would think that volatile
I need to read from a variety of different text files (I've some delimited
I have a string read from another source such as \b\bfoo\bx. In this case,
How would I read from an Excel sheet and load the marked selection (Area)
History: I read from one of Knuth's algorithm book that first computers used the
I want to read from stdin five numbers entered as follows: 3, 4, 5,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.