December 26, 2019 Re: DIP 1027---String Interpolation---Community Review Round 1 | ||||
---|---|---|---|---|
| ||||
Posted in reply to Mike Parker | On Wednesday, 11 December 2019 at 09:52:21 UTC, Mike Parker wrote: > This is the feedback thread for the first round of Community Review for DIP 1027, "String Interpolation": > > https://github.com/dlang/DIPs/blob/148001a963f5d6e090bb6beef5caf9854372d0bc/DIPs/DIP1027.md > > All review-related feedback on and discussion of the DIP should occur in this thread. The review period will end at 11:59 PM ET on December 25, or when I make a post declaring it complete. > > At the end of Round 1, if further review is deemed necessary, the DIP will be scheduled for another round of Community Review. Otherwise, it will be queued for the Final Review and Formal Assessment. > > Anyone intending to post feedback in this thread is expected to be familiar with the reviewer guidelines: > > https://github.com/dlang/DIPs/blob/master/docs/guidelines-reviewers.md > > *Please stay on topic!* > > Thanks in advance to all who participate. > . It also makes interpolated strings agnostic about what the format specifications are, as long as they start with %. Is there a reason it's not $ instead of %? String interpolation is most commonly use languages works like "my name is ${name}". Wouldn't it be easier if we target something users may already be familiar with? |
December 26, 2019 Re: DIP 1027---String Interpolation---Community Review Round 1 | ||||
---|---|---|---|---|
| ||||
Posted in reply to aberba | On Thursday, 26 December 2019 at 09:33:24 UTC, aberba wrote:
> On Wednesday, 11 December 2019 at 09:52:21 UTC, Mike Parker wrote:
>> [...]
>
>> [...]
>
> Is there a reason it's not $ instead of %? String interpolation is most commonly use languages works like "my name is ${name}". Wouldn't it be easier if we target something users may already be familiar with?
If you read in the thread, Walter accepted the change to $ because od %% problem I noticed in the beginning of the thread.
I suppose he will amebd the document after that review cycle.
|
December 26, 2019 Re: DIP 1027---String Interpolation---Community Review Round 1 | ||||
---|---|---|---|---|
| ||||
Posted in reply to Patrick Schluter | On Thursday, 26 December 2019 at 10:20:06 UTC, Patrick Schluter wrote: > > > If you read in the thread, Walter accepted the change to $ because od %% problem I noticed in the beginning of the thread. > I suppose he will amebd the document after that review cycle. He updated it last week: https://github.com/dlang/DIPs/commit/1f5959abe482b1f9094f6484a7d0a3ade77fc2fc |
December 26, 2019 Re: DIP 1027---String Interpolation---Community Review Round 1 | ||||
---|---|---|---|---|
| ||||
Posted in reply to Mike Parker | On Thursday, 26 December 2019 at 15:23:07 UTC, Mike Parker wrote: > On Thursday, 26 December 2019 at 10:20:06 UTC, Patrick Schluter wrote: >> >> >> If you read in the thread, Walter accepted the change to $ because od %% problem I noticed in the beginning of the thread. >> I suppose he will amebd the document after that review cycle. > > He updated it last week: > > https://github.com/dlang/DIPs/commit/1f5959abe482b1f9094f6484a7d0a3ade77fc2fc > No attempt is made to diagnose format specification errors, such as attempting to format an integer as a floating point value. The meaning of the format specifications is unknown to the core language. Why is this? If the language is going to embed the library feature of printf into the language spec, then it should know about and check formatting. > string tool = "hammer"; > writefln(i"hammering %s with $tool", "nails"); > ``` > will produce: > ``` > string tool = "hammer"; > writefln("hammering %s with %s", tool, "nails"); > ``` There's an obvious problem, even with the given example. This will print: hammering hammer with nails Instead of the expected: hammering nails with hammer |
December 26, 2019 Re: DIP 1027---String Interpolation---Community Review Round 1 | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jab | On Thursday, 26 December 2019 at 16:35:43 UTC, Jab wrote:
> Why is this? If the language is going to embed the library feature of printf into the language spec, then it should know about and check formatting.
Please save further feedback for the next review round. This round is finished. I still need to work through the thread to summarize the feedback, so anything past this post will be ignored.
Thanks!
|
Copyright © 1999-2021 by the D Language Foundation