Re: RFR: JDK-8315457 Implementation of String Templates (Second Preview)

2023-10-16 Thread Jim Laskey
On Mon, 16 Oct 2023 14:27:05 GMT, Alan Bateman wrote: >> Update String Templates for a second preview. With the addition of >> >> - Expression type and throws are determined from the `process` method of the >> processor type and not the processor type. >> >> - Qualified `STR` and `RAW` are tre

RFR: JDK-8315457 Implementation of String Templates (Second Preview)

2023-10-16 Thread Jim Laskey
Update String Templates for a second preview. With the addition of - Expression type and throws are determined from the `process` method of the processor type and not the processor type. - Qualified `STR` and `RAW` are treated the same as unqualified `STR` and `RAW` . - Raw (generic) process t

Re: RFR: 8295803: Console should be usable in jshell and other environments [v7]

2022-12-05 Thread Jim Laskey
On Mon, 5 Dec 2022 19:52:59 GMT, Naoto Sato wrote: >> This is to allow Console to be used even when it is not attached to the >> platform provided terminal, such as the case when the standard input is >> redirected. `System.console()` now returns a Console implementation based on >> `jdk.inter

Re: RFR: 8295803: Console should be usable in jshell and other environments [v6]

2022-12-05 Thread Jim Laskey
On Mon, 5 Dec 2022 18:33:10 GMT, Naoto Sato wrote: >> This is to allow Console to be used even when it is not attached to the >> platform provided terminal, such as the case when the standard input is >> redirected. `System.console()` now returns a Console implementation based on >> `jdk.inter

Re: RFR: 8295803: Console should be usable in jshell and other environments [v2]

2022-12-01 Thread Jim Laskey
On Wed, 30 Nov 2022 20:44:30 GMT, Naoto Sato wrote: >> This is to allow Console to be used even when it is not attached to the >> platform provided terminal, such as the case when the standard input is >> redirected. `System.console()` now returns a Console implementation based on >> `jdk.inte

Re: RFR: 8295803: Console should be usable in jshell and other environments

2022-11-30 Thread Jim Laskey
On Tue, 29 Nov 2022 19:38:02 GMT, Naoto Sato wrote: > This is to allow Console to be used even when it is not attached to the > platform provided terminal, such as the case when the standard input is > redirected. `System.console()` now returns a Console implementation based on > `jdk.internal

Re: RFR: JDK-8285932 Implementation of JEP-430 String Templates (Preview) [v7]

2022-11-01 Thread Jim Laskey
On Mon, 31 Oct 2022 21:23:19 GMT, Stuart Marks wrote: >> Jim Laskey has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Add @SafeVarargs declarations > > src/java.base/share/classes/java/lang/template/Template

Re: RFR: JDK-8285932 Implementation of JEP-430 String Templates (Preview) [v3]

2022-11-01 Thread Jim Laskey
On Mon, 31 Oct 2022 15:51:23 GMT, Rémi Forax wrote: >> Actually instance interpolate() is the most important method. Each synthetic >> StringTemplate gets a specialized interpolate providing performance >> equivalent to string concat. And, a good percentage of processors will work >> with the

Re: RFR: JDK-8285932 Implementation of JEP-430 String Templates (Preview) [v7]

2022-11-01 Thread Jim Laskey
On Mon, 31 Oct 2022 20:50:49 GMT, Rémi Forax wrote: >> Jim Laskey has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Add @SafeVarargs declarations > > src/java.base/share/classes/java/lang/template/TemplateRu

Re: RFR: JDK-8285932 Implementation of JEP-430 String Templates (Preview) [v3]

2022-11-01 Thread Jim Laskey
On Mon, 31 Oct 2022 13:43:24 GMT, Jim Laskey wrote: >> src/java.base/share/classes/java/lang/template/TemplateRuntime.java line 45: >> >>> 43: */ >>> 44: @PreviewFeature(feature=PreviewFeature.Feature.STRING_TEMPLATES) >>> 45: public final class Tem

Re: RFR: JDK-8285932 Implementation of JEP-430 String Templates (Preview) [v7]

2022-10-31 Thread Jim Laskey
r validation and > transformation. This is a [preview language feature and > API](http://openjdk.java.net/jeps/12). Jim Laskey has updated the pull request incrementally with one additional commit since the last revision: Add @SafeVarargs declarations - Chang

Re: RFR: JDK-8285932 Implementation of JEP-430 String Templates (Preview) [v6]

2022-10-31 Thread Jim Laskey
r validation and > transformation. This is a [preview language feature and > API](http://openjdk.java.net/jeps/12). Jim Laskey has updated the pull request incrementally with one additional commit since the last revision: Move template bootstrap - Changes: - all: https

Re: RFR: JDK-8285932 Implementation of JEP-430 String Templates (Preview) [v5]

2022-10-31 Thread Jim Laskey
r validation and > transformation. This is a [preview language feature and > API](http://openjdk.java.net/jeps/12). Jim Laskey has updated the pull request incrementally with two additional commits since the last revision: - Requested changes #2 - Requested changes - Chang

Re: RFR: JDK-8285932 Implementation of JEP-430 String Templates (Preview) [v3]

2022-10-31 Thread Jim Laskey
On Fri, 28 Oct 2022 19:45:55 GMT, Rémi Forax wrote: >> Jim Laskey has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Update TemplateRuntime::combine > > src/java.base/share/classes/java/util/FormatProc

Re: RFR: JDK-8285932 Implementation of JEP-430 String Templates (Preview) [v4]

2022-10-31 Thread Jim Laskey
On Fri, 28 Oct 2022 23:50:11 GMT, j3graham wrote: >> Jim Laskey has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Remove .orig file > > src/java.base/share/classes/java/util/FormatterBuilder.java line

Re: RFR: JDK-8285932 Implementation of JEP-430 String Templates (Preview) [v3]

2022-10-31 Thread Jim Laskey
On Fri, 28 Oct 2022 19:36:07 GMT, Rémi Forax wrote: >> Jim Laskey has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Update TemplateRuntime::combine > > src/java.base/share/classes/java/lang/template

Re: RFR: JDK-8285932 Implementation of JEP-430 String Templates (Preview) [v3]

2022-10-31 Thread Jim Laskey
On Fri, 28 Oct 2022 19:39:01 GMT, Rémi Forax wrote: >> Jim Laskey has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Update TemplateRuntime::combine > > src/java.base/share/classes/java/lang/template

Re: RFR: JDK-8285932 Implementation of JEP-430 String Templates (Preview) [v3]

2022-10-31 Thread Jim Laskey
On Fri, 28 Oct 2022 19:33:38 GMT, Rémi Forax wrote: >> Jim Laskey has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Update TemplateRuntime::combine > > src/java.base/share/classes/java/lang/template

Re: RFR: JDK-8285932 Implementation of JEP-430 String Templates (Preview) [v3]

2022-10-31 Thread Jim Laskey
On Fri, 28 Oct 2022 19:26:20 GMT, Rémi Forax wrote: >> Jim Laskey has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Update TemplateRuntime::combine > > src/java.base/share/classes/java/lang/template/Template

Re: RFR: JDK-8285932 Implementation of JEP-430 String Templates (Preview) [v3]

2022-10-31 Thread Jim Laskey
On Fri, 28 Oct 2022 19:57:41 GMT, Rémi Forax wrote: >> `List.of()` can't be used here, since the elements are nullable, according >> to the documentation. But the the returned list can still be modified, by >> changing the given `elements` array. The input array must be explicitly >> copied: >

Re: RFR: JDK-8285932 Implementation of JEP-430 String Templates (Preview) [v3]

2022-10-31 Thread Jim Laskey
On Fri, 28 Oct 2022 19:20:40 GMT, Rémi Forax wrote: >> Jim Laskey has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Update TemplateRuntime::combine > > src/java.base/share/classes/java/lang/template/Template

Re: RFR: JDK-8285932 Implementation of JEP-430 String Templates (Preview) [v3]

2022-10-31 Thread Jim Laskey
On Mon, 31 Oct 2022 07:14:45 GMT, Rémi Forax wrote: >> Actually, `StringTemplate::interpolate` is fine, as this method takes two  >> parameters, whereas the instance method only takes an implicit `this`  >> parameter. >> >> The instance method is only assignable to `Function` >> or `Supplier`,

Re: RFR: JDK-8285932 Implementation of JEP-430 String Templates (Preview) [v3]

2022-10-31 Thread Jim Laskey
On Fri, 28 Oct 2022 19:12:02 GMT, Rémi Forax wrote: >> Jim Laskey has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Update TemplateRuntime::combine > > src/java.base/share/classes/java/lang/template/StringTem

Re: RFR: JDK-8285932 Implementation of JEP-430 String Templates (Preview) [v3]

2022-10-31 Thread Jim Laskey
On Fri, 28 Oct 2022 19:08:56 GMT, Rémi Forax wrote: >> Jim Laskey has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Update TemplateRuntime::combine > > src/java.base/share/classes/java/lang/template/StringTem

Re: RFR: JDK-8285932 Implementation of JEP-430 String Templates (Preview) [v3]

2022-10-31 Thread Jim Laskey
On Fri, 28 Oct 2022 19:06:43 GMT, Rémi Forax wrote: >> Jim Laskey has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Update TemplateRuntime::combine > > src/java.base/share/classes/java/lang/template/StringTem

Re: RFR: JDK-8285932 Implementation of JEP-430 String Templates (Preview) [v3]

2022-10-31 Thread Jim Laskey
On Fri, 28 Oct 2022 19:05:10 GMT, Rémi Forax wrote: >> Jim Laskey has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Update TemplateRuntime::combine > > src/java.base/share/classes/java/lang/template/StringT

Re: RFR: JDK-8285932 Implementation of JEP-430 String Templates (Preview) [v3]

2022-10-31 Thread Jim Laskey
On Fri, 28 Oct 2022 20:07:35 GMT, Rémi Forax wrote: >> The defensive copies are done by the callers. > > In that case, i wonder if not not better to move that record inside another > class, closer to where the callers are Moving to TemplateRuntime - PR: https://git.openjdk.org/jdk

Re: RFR: JDK-8285932 Implementation of JEP-430 String Templates (Preview) [v3]

2022-10-31 Thread Jim Laskey
On Fri, 28 Oct 2022 20:23:26 GMT, Rémi Forax wrote: >> Wrong use case. Think `StringProcessor upper = st -> >> st.interpolate().toUpperCase();` > > Is it that different from`TemplateProcessor upper = st -> > st.interpolate().toUpperCase();` ? > > People are really used to use <> with the funct

Re: RFR: JDK-8285932 Implementation of JEP-430 String Templates (Preview) [v3]

2022-10-28 Thread Jim Laskey
On Fri, 28 Oct 2022 18:52:28 GMT, Rémi Forax wrote: >> Jim Laskey has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Update TemplateRuntime::combine > > src/java.base/share/classes/java/lang/invoke/StringC

Re: RFR: JDK-8285932 Implementation of JEP-430 String Templates (Preview) [v4]

2022-10-28 Thread Jim Laskey
r validation and > transformation. This is a [preview language feature and > API](http://openjdk.java.net/jeps/12). Jim Laskey has updated the pull request incrementally with one additional commit since the last revision: Remove .orig file - Changes: - all: https://git.op

Re: RFR: JDK-8285932 Implementation of JEP-430 String Templates (Preview) [v3]

2022-10-28 Thread Jim Laskey
On Fri, 28 Oct 2022 18:45:05 GMT, Rémi Forax wrote: >> Jim Laskey has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Update TemplateRuntime::combine > > src/java.base/share/classes/java/lang/AbstractString

Re: RFR: JDK-8285932 Implementation of JEP-430 String Templates (Preview) [v2]

2022-10-28 Thread Jim Laskey
On Fri, 28 Oct 2022 16:33:11 GMT, Maurizio Cimadamore wrote: >> Jim Laskey has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Move StringConcatItem to FormatConcatItem > > src/jdk.compiler/share/cl

Re: RFR: JDK-8285932 Implementation of JEP-430 String Templates (Preview) [v2]

2022-10-28 Thread Jim Laskey
On Fri, 28 Oct 2022 16:33:31 GMT, Maurizio Cimadamore wrote: >> src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Check.java line 4139: >> >>> 4137: List typeArguments = >>> interfaceType.getTypeArguments(); >>> 4138: >>> 4139: if (typeArguments.size() == 2) { >>

Re: RFR: JDK-8285932 Implementation of JEP-430 String Templates (Preview) [v2]

2022-10-28 Thread Jim Laskey
On Fri, 28 Oct 2022 16:09:51 GMT, j3graham wrote: >> Jim Laskey has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Move StringConcatItem to FormatConcatItem > > src/java.base/share/classes/java/lang/template

Re: RFR: JDK-8285932 Implementation of JEP-430 String Templates (Preview) [v3]

2022-10-28 Thread Jim Laskey
r validation and > transformation. This is a [preview language feature and > API](http://openjdk.java.net/jeps/12). Jim Laskey has updated the pull request incrementally with one additional commit since the last revision: Update TemplateRuntime::combine - Chang

Re: RFR: JDK-8285932 Implementation of JEP-430 String Templates (Preview) [v2]

2022-10-28 Thread Jim Laskey
r validation and > transformation. This is a [preview language feature and > API](http://openjdk.java.net/jeps/12). Jim Laskey has updated the pull request incrementally with one additional commit since the last revision: Move StringConcatItem to FormatConcatItem - Chang

Re: RFR: JDK-8285932 Implementation of JEP-430 String Templates (Preview) [v2]

2022-10-28 Thread Jim Laskey
On Thu, 27 Oct 2022 21:21:52 GMT, ExE Boss wrote: >> Jim Laskey has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Move StringConcatItem to FormatConcatItem > > src/java.base/share/classes/java/lang/invoke

RFR: JDK-8285932 Implementation of JEP-430 String Templates (Preview)

2022-10-27 Thread Jim Laskey
Enhance the Java programming language with string templates, which are similar to string literals but contain embedded expressions. A string template is interpreted at run time by replacing each expression with the result of evaluating that expression, possibly after further validation and tran