Discussing exception translation with GPT-5 mini: lazy void parameters

Forum User forumuser at example.com
Wed Apr 8 20:50:52 UTC 2026


On Wednesday, 8 April 2026 at 11:44:54 UTC, jmh530 wrote:
> [...]
> Even when I use the latest GPT plus with thinking on and it 
> still makes mistakes with some of D's idiosyncrasies, like how 
> the const system works.

Or naming a variable `out`. OpenAI's `codex` understands compiler 
error messages, so it autocorrected itself (herself, theirself?).

> It's less likely to make mistakes when whatever D is doing has 
> some comparable way of doing it in other programming languages.

GPT-5 (duck.ai): "If you prefer truly terse syntax like 
mayThrow().wrapException!AppError, you need mayThrow to return a 
wrapper type (or use a macro/preprocessor), because plain 
function return values can't be extended with new methods without 
wrapping them. The shown pattern is the usual idiomatic 
compromise in D." (I refrain from posting the "shown pattern" 
here).

Another questionable code I saw was this (from memory):

```d
string foo (scope string s)
{
     auto tmp = s.dup;
     // some modification on tmp
     return tmp.dup;
}
```




More information about the Digitalmars-d mailing list