<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;">
Hi Eirik,
<div><br>
</div>
<div>Thanks for your email. </div>
<div><br>
</div>
<div>I totally get where you are coming from but I really don’t think anyone would want “import module” to have the additional semantics of importing all the static members. </div>
<div><br>
</div>
<div>That then leads us to “doing something special” which, depending on who gets that special behaviour, is either very non-Java in its feel, or ends up defining a “beginner’s dialect” which is an explicit non-goal of the JEP.</div>
<div><br>
</div>
<div>Hope that helps,</div>
<div>Gavin</div>
<div><br>
</div>
<div>PS: Actually in the section on “growing a program” the static import could just be “import static
<a href="http://java.io">java.io</a>.IO.println;”, which at least removes the wildcard.<br id="lineBreakAtBeginningOfMessage">
<div><br>
<blockquote type="cite">
<div>On 14 May 2024, at 17:26, Eirik Bjørsnøs <eirbjo@gmail.com> wrote:</div>
<br class="Apple-interchange-newline">
<div>
<div dir="ltr">Hi,<br>
<div><br>
</div>
<div>JEP-477 includes the section "Growing a program", showing how an implicit class can be grown into an ordinary class by wrapping it in a class declaration and adding the necessary (no longer implicit) imports:</div>
<div><br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
import static java.io.IO.*;<br>
import java.util.List; // alternatively: import module java.base;</blockquote>
<div><br>
</div>
<div>The module import of java.base (from JEP-476) strikes me as very elegant in this context in that it provides the learning programmer access to Java's basic APIs in a single import. "Give me the basic java stuff", thanks!</div>
<div><br>
</div>
<div>The sad thing is that the "basic java stuff" does not seem to include the static methods in
<a href="http://java.io.io/">java.io.IO</a>. So the learning programmer still needs to add "import static java.io.IO.*". This doubles the number of imports needed, but worse, it introduces the concepts of static imports and wildcard imports!</div>
<div><br>
</div>
<div>I was thinking it would be really nice if "import module java.base" somehow also included the new IO methods.</div>
<div><br>
</div>
<div>Has this interaction between JEP-177 and JEP-476 been discussed in the expert group?</div>
<div><br>
</div>
<div>Thanks,</div>
<div>Eirik. </div>
<div><br>
</div>
<div> </div>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</body>
</html>