On Wednesday, 27 November 2024 at 14:37:03 UTC, Andy Valencia wrote:
With my OO programming goggles on, I can't help but notice that if Phobos had made File a class--or an interface--

oo doesn't own polymorphism you could do 99% of the value with

```d
struct dummyfile{
  auto byLineCopy()=>//string.spiltter('\n')....
}

auto myfunc(F)(F file){
  foreach(s;file.byLineCopy){
    ...
  }
}
unittest{ assert(
  dummyfile(q{
    ...
  }).myfunc
  == ...);
}
```

Reply via email to