[petsc-dev] changed ISCreateGeneral/NC/WithArray()

Barry Smith bsmith at mcs.anl.gov
Sun Oct 3 18:49:34 CDT 2010


On Oct 3, 2010, at 6:39 PM, Jed Brown wrote:

> Agree that NC versus WithArray was confusing and difficult for users to discover.
> 
> I don't see what overloading has to do with this. Garbage collection would make a real difference, but overloading basically just lets you implicitly write the types of arguments into the function name. Writing ownership semantics into the type is not really workable in C and related languages.

  True, but one could possibly conceive of a language where one could "pass ownership" of arrays/objects around. Now PETSc explicitly has this (will I regret it later? maybe).

   Barry

> 
> Jed
> 
> 
>> On Oct 4, 2010 1:31 AM, "Barry Smith" <bsmith at mcs.anl.gov> wrote:
>> 
>> 
>> On Oct 3, 2010, at 6:23 PM, Jed Brown wrote:
>> 
>> > We agree about flexibility, I'm just not convinced ...
>> 
>>   Ok, I'll buy that. One reason I like the one function with additional argument is that by having to see and type in that argument users immediately see that other variants exist. Having other functions means they have to read the docs more carefully to be aware that other variants exist.
>> 
>>   NC() and WithArray() really got me. I mean how could anyone instinctively know what the difference between NC() and WithArray() was? To people it would be gibberish.
>> 
>> > 
>> > Freeing the array is being dishonest about (casting away) const.
>> 
>>   With a language with overloading we could be both technically honest and practically host. Without I prefer to be practically honest instead of technically honest.
>> 
>> Barry
>> 
>> 
>> > 
>> > Jed
>> > 
>> > 
>> >> On Oct 4, 2010 1:17 AM, "Barry Smith" <bsmith at mcs.anl.gov> wrote:
>> >> 
>> ...
>> 
> 




More information about the petsc-dev mailing list