The Artima Developer Community
Sponsored Link

Java Buzz Forum
Neal Gafter: Block Expressions For Java

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Weiqi Gao

Posts: 1808
Nickname: weiqigao
Registered: Jun, 2003

Weiqi Gao is a Java programmer.
Neal Gafter: Block Expressions For Java Posted: Feb 24, 2009 6:54 PM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by Weiqi Gao.
Original Post: Neal Gafter: Block Expressions For Java
Feed Title: Weiqi Gao's Weblog
Feed URL: http://www.weiqigao.com/blog/rss.xml
Feed Description: Sharing My Experience...
Latest Java Buzz Posts
Latest Java Buzz Posts by Weiqi Gao
Latest Posts From Weiqi Gao's Weblog

Advertisement

(Via The Java Posse Google Group (Via Twitter))

Neal Gafter: A parenthesized expression can now contain additional statements, for example declarations of temporary local variables to avoid recomputing a value used only within the expression. This feature is especially useful in machine-generated code.

A simple example:

double pi2 = (double pi = Math.PI ; pi*pi);

This is comparable to the equivalent JavaFX Script:

var pi2 = {var pi = Math.PI; pi*pi};

The proposal sounds like it should be eligible for Project Coin.

But will the Java community accept language proposals from a Microsoft employee (where Neal now works.)?

Oh, wait. Java did it once already: auto-boxing, annotations, and enums.

Read: Neal Gafter: Block Expressions For Java

Topic: iDracula iPhone app: For Those who Like to Slay Monsters for Fun Previous Topic   Next Topic Topic: ProgrssBAr and UI

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use