I agree with you then; standard libraries should be zero-based. However, just 
to reiterate, I am against _enforcing_ third-party libraries, or just normal 
user code, from using whatever indexing scheme they desire, i.e. by removing 
the ability to declare lower and upper bounds (not saying you're suggesting 
this, but again just to state my point).

On 11/4/19, 8:40 PM, "Gerald Henriksen" <ghenr...@gmail.com> wrote:

    On Mon, 4 Nov 2019 23:59:01 +0000, you wrote:
    
    >Am I understanding you right, that you are suggesting that it become 
impossible to declare lower and upper bounds for everything, including ranges, 
domains, and arrays? 100% against this, couldn't disagree more if so. I'll hold 
off on attacking a strawman until I know if that man made of straw is a decoy 
or the real thing.
    
    I'm saying the language should be consistent, and regardless of
    whether the choice is 0-based or 1-based it should be applied to
    everything possible.
    
    Specifically thinking of this quote from the original email:
    
    "  As a specific example, I have no expectation that our LinearAlgebra
    library would switch to using 0-based matrices if we were to make this
    language change because 1-based indexing is arguably most typical and
    natural for that context.
    "
    
    If you want to keep 1-based indexing for a library, then keep the
    entire language as 1-based.
    
    If you want the language to be 0-based, then change the library.
    
    Anyone writing Chapel code shouldn't have to stop and think of context
    to decide which indexing method is being used.
    
    For example, the first C++ Linear Algebra library I looked at is
    Armadillo, and on the page comparing Armadillo to Matlab(*) it shows
    that Armadillo uses 0-based indexing.  This means Armadillo is
    consistent with C++.
    
    The thing to be remembered is a lot of code is written by people who
    are not programmers, nevermind experienced programmers, and thus the
    language should be defaulting to consistency.  The goal should be to
    having the language do its best to minimize the potential for
    accidental bugs, and varying the indexing between the core language
    and a provided library is asking for trouble.
    
    Now there may well be valid reasons to have features in the language
    that can have a different indexing system.  But they should be as few
    as necessary, and ideally they should still default to whatever the
    chosen language standard is so that a programmer needs to make a
    specific decision to do something different.
    
    * - 
https://eur01.safelinks.protection.outlook.com/?url=http%3A%2F%2Farma.sourceforge.net%2Fdocs.html%23syntax&amp;data=02%7C01%7C%7C3d92cd3e311a4545437b08d7619123ac%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637085148300008214&amp;sdata=gjGI64tVIdg%2F6advcDHd5q1ippwhWNKNeAbfNk5ncv4%3D&amp;reserved=0
    


_______________________________________________
Chapel-users mailing list
Chapel-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/chapel-users

Reply via email to