Non-ugly ways to implement a 'static' class or namespace?

thebluepandabear therealbluepandabear at protonmail.com
Mon Feb 6 01:50:49 UTC 2023


On Sunday, 5 February 2023 at 23:53:35 UTC, Ali Çehreli wrote:
> On 2/5/23 14:40, ProtectAndHide wrote:
>
> > On Sunday, 5 February 2023 at 10:51:51 UTC, thebluepandabear
> wrote:
> >>
> >> It's not a terrible workaround to be honest.
> >> ....
> >
> > The 'terrible' part is this:
> >
> > - the compiler will allow you to declare a variable of type
> Algo
> > - the compiler will allow you to declare an array with
> elements of type
> > Algo
> > - the compiler will allow you to use Algo as a type argument
> > - the compiler will allow you to use Algo as a parameter
> > - the compiler will allow you to use Algo as a return type
>
> I understand disabling the programmer to do certain things are 
> beneficial e.g. to prevent bugs but those above can all be seen 
> as features. What is so terrible about giving the programmer 
> those powers?
>
> Ali

I don't see why you'd want to expose a static class/namespace as 
a variable, or any of such similar things. That would give no 
benefits to the programmer?


More information about the Digitalmars-d-learn mailing list