Puzzled by this behavior
Don Allen
donaldcallen at gmail.com
Thu Jun 2 21:01:28 UTC 2022
On Thursday, 2 June 2022 at 15:15:40 UTC, deadalnix wrote:
> On Tuesday, 31 May 2022 at 22:48:55 UTC, Don Allen wrote:
>> Well, I would argue that that kind of thinking leads to a
>> language that is a collection of special cases, rather than a
>> language built on a core set of principles consistently
>> applied.
>>
>
> While I agree that sometime, D takes the road of many special
> cases, if you take a step back, you'll that this really doesn't
> help your case, to the contrary. You are arguing for special
> casing function scope to allow out of order symbol resolution
> in special circumstances.
I said I was done, but this really needs a response because you
have gotten what I am talking about completely wrong,
particularly in your last sentence above.
I repeat: I am arguing for consistent treatment of the ability to
do mutual recursion, regardless of context. If D handled this the
C way -- functions must be defined before they can be referenced
in another function definition -- and did so in all contexts, I'd
be less troubled than I am by the current situation, in which we
have one treatment at module and structure level and the opposite
within functions.
I could not care less about "helping my case"; my situation
involves one inner function calling another, so the functions
aren't even mutually recursive, and is easily resolved by just
interchanging the order in which the functions are defined. My
purpose in writing about this has never been about how to fix my
little issue. It's concern about what I consider an error in the
language design.
More information about the Digitalmars-d
mailing list