associative arrays

dennis luehring dl.soluz at gmx.net
Mon Jan 9 22:42:19 PST 2012


Am 09.01.2012 22:08, schrieb Manfred Nowak:
> dennis luehring wrote:
>>  why is there an exception/error neeeded if missing?
>
> Exceptions or errors are not _needed_.
>
> Their existence stems from the modell under which the user of the
> operation _has_ to think about the operation, especially whether it
> is
>    a:only the outcome of the operation or
>    b:the amount of work to get to this outcome
> and maybe
>    c:at runtime has to be known, whether the object exists.
>
>
> Jesse Phillips wrote:
>>  I have a lot of if(exists) remove() in my code
>
> As one can see, Jesse does not know, whether the object exists and
> has to ask, before he in fact removes the object, i.e. doubled access
> to the file, which may cause a slowdown.

so your FileDelete would not return an FileDoesNotExists-Error?

it isn't always clear what is "ok" to happen - there are million types 
of remove-like-semantic, an Jesse's scenario is one type of usage, which 
other type of remove allows silently non-remove-removes? STL? Python, 
etc. (how do others handle such cases)

would it not help to better understand big code if the remove would be 
renamed to remove_existing or to add something like this?


More information about the Digitalmars-d-learn mailing list