[Swift-devel] case sensitivity

Michael Wilde wilde at mcs.anl.gov
Mon Sep 19 11:44:12 CDT 2011


I feel that backwards compatibility - at least for some length period of time, but better yet indefinitely - needs to take priority over aesthetic issues.

So I can see providing and documenting a function like toInt() while indefinitely allowing toint(). I agree that we should be consistent is using camelCase.

However, until Yadu's email below I was never aware of any case insensitivity in Swift - I always programmed as if all names were case sensitive. I didnt pay close attention to the brief list discussion on case below. Was there any follow-up discussion?

Can you summarize what the issues are?

I believe that Swift should be fully case sensitive for all names, and that we should not cause existing user code to break unless the cost of such backwards compatibility is much worse than the breakage.

- Mike

----- Forwarded Message -----
From: "Yadu Nand" <yadudoc1729 at gmail.com>
To: "Ben Clifford" <benc at hawaga.org.uk>
Cc: "swift-devel" <swift-devel at ci.uchicago.edu>
Sent: Tuesday, August 9, 2011 10:01:22 AM
Subject: Re: [Swift-devel] Overwriting procedures in swift.

> what happens with case? (and, what *should* happen with case?)

(int o) f ( int i) {
      o = i;
}
(int z) F (int a){
      z = a * 5 ;
}
trace ( f (5) , F(5) );

for the above snippet, trace returns 25, 25.
So F is overwriting f anyway. I don't think this is right.

> I think karajan identifiers are case insensitive (?) but this patch looks
> like it is case-sensitive.

Fixed it. Please check the new patch attached.


----- Original Message -----
> From: "Mihael Hategan" <hategan at mcs.anl.gov>
> To: "Swift Devel" <swift-devel at ci.uchicago.edu>
> Sent: Monday, September 19, 2011 11:06:17 AM
> Subject: [Swift-devel] case sensitivity
> Things have now become truly case sensitive in trunk. Which means that
> there is a distinction between toint and toInt. I opted for toInt for
> now. In any event, your scripts may break if they use the wrong
> capitalization.
> 
> We should document this, and, before releasing 0.94, decide on the
> details of the capitalization of various things.
> 
> Mihael
> 
> _______________________________________________
> Swift-devel mailing list
> Swift-devel at ci.uchicago.edu
> https://lists.ci.uchicago.edu/cgi-bin/mailman/listinfo/swift-devel

-- 
Michael Wilde
Computation Institute, University of Chicago
Mathematics and Computer Science Division
Argonne National Laboratory




More information about the Swift-devel mailing list