Counter-Proposal: restrict & tagged functions

Simen Kjaeraas simen.kjaras at gmail.com
Sat Sep 22 06:30:41 PDT 2012


On 2012-09-01, 18:20, Dmitry Olshansky wrote:

> The idea in a nutshell:
>
> - specify a way attach tags to function declarations (to "paint"  
> functions)
>
> - allow specifying is-a relation between tags (supertags and subtags).
>
> - add restrict specification that allows user to enforce on a block of  
> code the following:
> 	a) disallow use of certain language features
> 	b) allow(or disallow) calling function with specific tags
>
> - fit with existing world and provide clean migration path, specify  
> defaults
>
> I claim that it's enough to implement pure/safe/trusted/nothrow/nogc and  
> proposed nogc.


I'm sorry I have not gotten around to commenting on this before, but I
*really* like this proposal. As foobar has said, a general annotation
system would be real nice, but as far as I can see, it can be built on
top of this, at a later point.

Also, I cannot see that this has been turned into a proper DIP. :p

http://prowiki.org/wiki4d/wiki.cgi?LanguageDevel/DIPs

-- 
Simen


More information about the Digitalmars-d mailing list