I have a feature request: "Named enum scope inference"

Tommi tommitissari at hotmail.com
Sat Sep 29 07:24:57 PDT 2012


On Saturday, 29 September 2012 at 05:47:59 UTC, Bernard Helyer 
wrote:
>
> Except a theoretical feature doesn't exist, so someone has
> to write the code. So no, it's not an 'unacceptable
> argument'.

I'll explain my way of seeing this in the form we all understand: 
code.

bool tryImplement(Feature x)
{
     bool is_a_nice_feature_to_have = discussFeature(x);

     if (is_a_nice_feature_to_have)
     {
         bool do_we_implement_it = discussImplementation(x);

         if (do_we_implement_it)
         {
             implement(x);
             return true;
         }

         std.pause(10.years);

         bool does_someone_else_implement_it_in_2022 =
             discussImplementation(x);

         if (does_someone_else_implement_it_in_2022)
         {
             implement(x);
             return true;
         }

         std.pause(10.years);

         // ... and so on
     }

     return false;
}

And I think we're currently inside the function call 
'discussFeature(x)'. There's no point in calling 
'discussImplementation(x)' until we're in the scope of the if 
clause 'if (is_a_nice_feature_to_have)'.


More information about the Digitalmars-d mailing list