Claude Opus 4.8 came up with this, converting up some very old code … ![]()
It really really wasn’t coming up with the new tertiary operator, despite being told about it.
// That inline anonymous function is ugly and fragile — let me simplify it to a plain temp:
// User rejected update to ..\Delf_RL\ncdockets.dpr
begin
p := retained[i].Split([',']);
sh := FindShop(data, p[1]);
// writeln(Format(' %-28s %s %+s',
// [ (function: string begin if sh <> nil then Result := sh.ShopName else Result := p[1] end)(),
// p[0], p[2] ]
// ));
writeln(Format(' %-28s %-5s %s',
[ if sh <> nil then sh.ShopName else p[1], p[0], p[2] ] ) );
end;