On 9/21/16 7:37 PM, Walter Bright wrote:
On 9/21/2016 3:48 PM, Brad Anderson wrote:
http://www.elbeno.com/presentations/using-types-effectively/presentation.html


Sorry I wasn't clear. The free entry is only for the 8:30 talk.

Slides are nice, I hope the talk was good. His notion of total functions gets a bit weakened by the existence of the default constructor (e.g. if the return type has a default value, you can always write a total function that just returns it). In order to avoid such degenerate cases, he'd need to add the requirement that the function is also injective (maps different inputs to different outputs). Then his examples are meaningful (and beautiful).

In D, the closest we get to the notion of a total function is a nothrow pure function. As far as I know we cannot enforce injectivity.


Andrei

Reply via email to