Message-ID: <1536208440.465.1432284231997.JavaMail.firstname.lastname@example.org> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_464_1188254099.1432284231997" ------=_Part_464_1188254099.1432284231997 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
Use this page to list use cases for AST-level macros in Groovy.<= /p>=20
How do you want to use such macros? Show examples of their usage (withou= t showing how they're implemented). Add to the bottom of the page.=20
The end-weight principle for natural languages says the longer stuff sho=
uld be at the end of a sentence.
In Groovy/Java, while and if stateme= nts are usually heavy in the block/statement, and light in the condition. When the statement/block is short and the condition long, it can be mo= re readable to put the block last.
is transformed to:=20 =20
We could use 'unless' and 'until' if using 'if' and 'while' caused probl= ems.=20
When a long list of methods and/or fields have the same modifier/s,
it may be more readable to apply them to a whole block, eg:
triggered by the 'static' modifier of a field in a function.=20
Use names instead of symbols for operators, eg:=20 =20
or change their names to something shorter, eg:=20 =20
Forgoing curlies for all statements, making a statement and block equiva=
Enable fuller internationalization of Groovy, eg:=20 =20
would convert to=20 =20
if a Spanish option for Groovy was loaded.=20
Embed Java code within Groovy without quoting it,
and without need= ing to bind variables to the same name, ie, no binding.setVariable('i', i).=
Many existing syntactic sugars could be re-implemented as macros in a st=
andard macro library.
This might simplify the Antlr lexer/parser, ena= bling better maintenance of and extensions to it.
Eg, properties where:=20 =20
expands to:=20 =20