On Thursday, 15 May 2014 at 09:45:52 UTC, Don wrote:
But it turns out that @memoizable isn't actually an interesting property, whereas '@noglobal' is.

"No global state" is a deep, transitive property of a function. "Memoizable" is a superficial supersetextra property which the compiler can trivially determine from @noglobal.

Uhm. That is a pretty strong assumption. "memoizable" is very useful property when you do multihreading, transactions or anything that requires locking. And you can still access globals, you just need a guarantee that globals don't change until you are done.

Considering that > 90% of the functions I write don't do IO or globals I'd rather specify the opposite. "io", "global" whatever. That is also easy to enforce, i.e. you don't get to access IO/globals if you don't annotate the function.

Reply via email to