[Issue 5555] Built-in associative arrays in pure nothrow functions

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Apr 18 00:27:42 PDT 2013


http://d.puremagic.com/issues/show_bug.cgi?id=5555


w0rp <moebiuspersona at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |moebiuspersona at gmail.com


--- Comment #5 from w0rp <moebiuspersona at gmail.com> 2013-04-18 00:27:40 PDT ---
I'd like to remind everyone of this issue. I hold a strong belief that even if
the internals of associative arrays are impure, unsafe, and may throw,
properties for associative arrays should "lie" about these things because they
are invaluable mechanisms for implementing so many pure, @safe, and nothrow
algorithms.

They aren't really pure because they modify global state, but so does
allocating memory, which pure allows for.

They aren't @safe, because they rely on certain memory techniques, but these
are internals that form the language.

They aren't nothrow, because checking the properties of an associative array
may fail, but this is as much of an unrecoverable error as an OutOfMemoryError.

If the properties of associative arrays take on all of these things, it would
make it possible to create an entire host of code which is pure, @safe, and
nothrow. (For starters, I can imagine undirected and directed graph types which
meet these requirements.)

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list