On 06/10/2015 11:09 PM, deadalnix wrote:
On Wednesday, 10 June 2015 at 16:03:17 UTC, Andrei Alexandrescu wrote:
On 6/10/15 8:41 AM, Brian Rogoff wrote:
I agree with you, Walter, that mutual recursion amongst imports is
usually bad, but I think you inadvertently made the right decision by
allowing it in D, and that the bug should be fixed. If people overuse it
to write messy code then the community should tell them to write that
code better.
I agree. I'm one of those folks who think circular dependencies are
fine, thank you very much, and the few cases in which it causes
problems should be flagged and diagnosed in a principled way.
Everybody also likes:
* recursion and mutual recursion of any depth (there's a lot more of
it going in the usual programs than one might think)
* recursive and mutually recursive types
* declaring top level names in any order and they just "work"
But all of a sudden, people get sugar in their gasoline and sand in
their gears when they hear of the same thing applied to modules. I
suspect it's because some legacy languages didn't quite do a stellar
job at it. Figuring that stuff out and pointing out problems is
exactly the kind of thing computers are good at and humans, not so good.
Andrei
Cyclic imports create problems that do not exists with forward
declaration.
No, they don't. They just preclude the band-aid fix.
This is surprisingly hard to get a well defined behavior
for compile time feature.
This is a good thing because it makes reasonably sure the final
resolution rules won't take order of declaration into account.
I would argue to make them illegal, but that
is still a good idea to avoid them when possible.
That's the lazy way. :o)
I really need to find some time to get back to D frontend implementation.
What does SDC do now?