User defined safety?

2011-08-26 Thread Lutger Blijdestijn
I wonder if anybody has brought up the idea of using or expanding the SafeD features to cover a user-defined kind of safety? Right now, @safe means memory safe and it is defined by the language. However, there are many kinds of safety that benefit from being layered in a manner similar to how s

Re: User defined safety?

2011-08-26 Thread Adam Ruppe
My pet feature request could do this too. User defined attributes combined with a list of functions called by a function. === @custom("mysafe") void foo() {} void bar() {} @custom("mysafe") void main() { foo(); bar(); } CheckCustomSafety!("mysafe", main); template CheckCustomSafety(strin

Re: User defined safety?

2011-08-26 Thread Timon Gehr
On 08/26/2011 02:38 PM, Adam Ruppe wrote: My pet feature request could do this too. User defined attributes combined with a list of functions called by a function. === @custom("mysafe") void foo() {} void bar() {} @custom("mysafe") void main() { foo(); bar(); } CheckCustomSafety!("mys

Re: User defined safety?

2011-08-28 Thread bearophile
Lutger Blijdestijn: >I wonder if anybody has brought up the idea of using or expanding the SafeD >features to cover a user-defined kind of safety?< If you want to design this idea well, then I suggest you to read some papers a bout Securty Types. You are able to find a brief overview from page

Re: User defined safety?

2011-08-30 Thread jdrewsen
Den 26-08-2011 14:38, Adam Ruppe skrev: My pet feature request could do this too. User defined attributes combined with a list of functions called by a function. === @custom("mysafe") void foo() {} void bar() {} @custom("mysafe") void main() { foo(); bar(); } CheckCustomSafety!("mysaf

Re: User defined safety?

2011-08-30 Thread Andrei Alexandrescu
On 8/30/11 12:41 PM, jdrewsen wrote: Couldn't this be used for marking classes as serializable. Something like this: class Foo { @custom("serialize") Cake theCake; Bar cache; } SerializeCustom!("serialize", Foo); template SerializeCustom(string attribute, alias cls) { foreach (m; __traits(lis