Case-sensitivity of identifiers: Difference between revisions
Content added Content deleted
Thundergnat (talk | contribs) m (syntax highlighting fixup automation) |
Thundergnat (talk | contribs) m (Automated syntax highlighting fixup (second round - minor fixes)) |
||
Line 14: | Line 14: | ||
* [[Unicode variable names]] |
* [[Unicode variable names]] |
||
<br><br> |
<br><br> |
||
=={{header|11l}}== |
=={{header|11l}}== |
||
11l identifiers are case sensitive. |
11l identifiers are case sensitive. |
||
<syntaxhighlight lang=11l>V dog = ‘Benjamin’ |
<syntaxhighlight lang="11l">V dog = ‘Benjamin’ |
||
V Dog = ‘Samba’ |
V Dog = ‘Samba’ |
||
V DOG = ‘Bernie’ |
V DOG = ‘Bernie’ |
||
print(‘The three dogs are named ’dog‘, ’Dog‘ and ’DOG‘.’)</syntaxhighlight> |
print(‘The three dogs are named ’dog‘, ’Dog‘ and ’DOG‘.’)</syntaxhighlight> |
||
=={{header|Action!}}== |
=={{header|Action!}}== |
||
<syntaxhighlight lang= |
<syntaxhighlight lang="action!">PROC Main() |
||
CHAR ARRAY dog="Bernie" |
CHAR ARRAY dog="Bernie" |
||
Line 33: | Line 31: | ||
There is just one dog named Bernie. |
There is just one dog named Bernie. |
||
</pre> |
</pre> |
||
=={{header|Ada}}== |
=={{header|Ada}}== |
||
case insensitive |
case insensitive |
||
<syntaxhighlight lang= |
<syntaxhighlight lang="ada">with Ada.Text_IO; |
||
procedure Dogs is |
procedure Dogs is |
||
Dog : String := "Bernie"; |
Dog : String := "Bernie"; |
||
Line 45: | Line 42: | ||
Output: |
Output: |
||
<pre>There is just one dog named Bernie</pre> |
<pre>There is just one dog named Bernie</pre> |
||
=={{header|Agena}}== |
=={{header|Agena}}== |
||
Translation of Algol W. Agena is case sensitive, as this example demonstrates. Tested with Agena 2.9.5 Win32 |
Translation of Algol W. Agena is case sensitive, as this example demonstrates. Tested with Agena 2.9.5 Win32 |
||
<syntaxhighlight lang=agena>scope |
<syntaxhighlight lang="agena">scope |
||
local dog := "Benjamin"; |
local dog := "Benjamin"; |
||
scope |
scope |
||
Line 65: | Line 61: | ||
The three dogs are named: Benjamin, Samba and Bernie |
The three dogs are named: Benjamin, Samba and Bernie |
||
</pre> |
</pre> |
||
=={{header|Aime}}== |
=={{header|Aime}}== |
||
<syntaxhighlight lang=aime>text dog, Dog, DOG; |
<syntaxhighlight lang="aime">text dog, Dog, DOG; |
||
dog = "Benjamin"; |
dog = "Benjamin"; |
||
Line 74: | Line 69: | ||
o_form("The three dogs are named ~, ~ and ~.\n", dog, Dog, DOG);</syntaxhighlight> |
o_form("The three dogs are named ~, ~ and ~.\n", dog, Dog, DOG);</syntaxhighlight> |
||
=={{header|ALGOL 68}}== |
=={{header|ALGOL 68}}== |
||
{{works with|ALGOL 68|Revision 1.}} |
{{works with|ALGOL 68|Revision 1.}} |
||
Line 80: | Line 74: | ||
{{wont work with|ELLA ALGOL 68|Any (with appropriate job cards) - tested with release [http://sourceforge.net/projects/algol68/files/algol68toc/algol68toc-1.8.8d/algol68toc-1.8-8d.fc9.i386.rpm/download 1.8-8d] - due to extensive use of '''format'''[ted] ''transput''.}} |
{{wont work with|ELLA ALGOL 68|Any (with appropriate job cards) - tested with release [http://sourceforge.net/projects/algol68/files/algol68toc/algol68toc-1.8.8d/algol68toc-1.8-8d.fc9.i386.rpm/download 1.8-8d] - due to extensive use of '''format'''[ted] ''transput''.}} |
||
A joke code entry... :-) ¢ but the code does actually work! |
A joke code entry... :-) ¢ but the code does actually work! |
||
'''File: Case-sensitivity_of_identifiers.a68'''<syntaxhighlight lang=algol68>#!/usr/bin/a68g --script # |
'''File: Case-sensitivity_of_identifiers.a68'''<syntaxhighlight lang="algol68">#!/usr/bin/a68g --script # |
||
# -*- coding: utf-8 -*- # |
# -*- coding: utf-8 -*- # |
||
Line 103: | Line 97: | ||
<br> |
<br> |
||
However, depending on the "stropping" convention used and the implementation, Algol 68 can be case-sensitive. Rutgers ALGOL 68 uses quote stropping and allows both upper and lower case in identifiers and bold words. The standard bold words must be in lower-case. |
However, depending on the "stropping" convention used and the implementation, Algol 68 can be case-sensitive. Rutgers ALGOL 68 uses quote stropping and allows both upper and lower case in identifiers and bold words. The standard bold words must be in lower-case. |
||
<syntaxhighlight lang=algol68>'begin' |
<syntaxhighlight lang="algol68">'begin' |
||
'string' dog = "Benjamin"; |
'string' dog = "Benjamin"; |
||
'begin' |
'begin' |
||
Line 121: | Line 115: | ||
The three dogs are named: Benjamin, Samba and Bernie |
The three dogs are named: Benjamin, Samba and Bernie |
||
</pre> |
</pre> |
||
=={{header|ALGOL W}}== |
=={{header|ALGOL W}}== |
||
Algol W identifiers are not case-sensitive but variable names in inner blocks can be the same as those in outer blocks... |
Algol W identifiers are not case-sensitive but variable names in inner blocks can be the same as those in outer blocks... |
||
<syntaxhighlight lang=algolw>begin |
<syntaxhighlight lang="algolw">begin |
||
string(8) dog; |
string(8) dog; |
||
dog := "Benjamin"; |
dog := "Benjamin"; |
||
Line 144: | Line 137: | ||
There is just one dog named: Bernie |
There is just one dog named: Bernie |
||
</pre> |
</pre> |
||
=={{header|APL}}== |
=={{header|APL}}== |
||
<syntaxhighlight lang=apl> DOG←'Benjamin' |
<syntaxhighlight lang="apl"> DOG←'Benjamin' |
||
Dog←'Samba' |
Dog←'Samba' |
||
dog←'Bernie' |
dog←'Bernie' |
||
'The three dogs are named ',DOG,', ',Dog,', and ',dog |
'The three dogs are named ',DOG,', ',Dog,', and ',dog |
||
The three dogs are named Benjamin, Samba, and Bernie</syntaxhighlight> |
The three dogs are named Benjamin, Samba, and Bernie</syntaxhighlight> |
||
=={{header|Arturo}}== |
=={{header|Arturo}}== |
||
<syntaxhighlight lang=rebol>dog: "Benjamin" |
<syntaxhighlight lang="rebol">dog: "Benjamin" |
||
Dog: "Samba" |
Dog: "Samba" |
||
DOG: "Bernie" |
DOG: "Bernie" |
||
Line 165: | Line 156: | ||
<pre>The 3 dog(s) are named Benjamin, Samba, Bernie</pre> |
<pre>The 3 dog(s) are named Benjamin, Samba, Bernie</pre> |
||
=={{header|AutoHotkey}}== |
=={{header|AutoHotkey}}== |
||
<syntaxhighlight lang= |
<syntaxhighlight lang="autohotkey">dog := "Benjamin" |
||
Dog := "Samba" |
Dog := "Samba" |
||
DOG := "Bernie" |
DOG := "Bernie" |
||
MsgBox There is just one dog named %dOG%</syntaxhighlight> |
MsgBox There is just one dog named %dOG%</syntaxhighlight> |
||
=={{header|AWK}}== |
=={{header|AWK}}== |
||
<syntaxhighlight lang=awk>BEGIN { |
<syntaxhighlight lang="awk">BEGIN { |
||
dog = "Benjamin" |
dog = "Benjamin" |
||
Dog = "Samba" |
Dog = "Samba" |
||
Line 181: | Line 170: | ||
The three dogs are named Benjamin, Samba and Bernie. |
The three dogs are named Benjamin, Samba and Bernie. |
||
=={{header|BASIC}}== |
=={{header|BASIC}}== |
||
{{works with|QBasic}} |
{{works with|QBasic}} |
||
QBASIC is case-insensitive |
QBASIC is case-insensitive |
||
<syntaxhighlight lang= |
<syntaxhighlight lang="basic256">DOG$ = "Benjamin" |
||
DOG$ = "Samba" |
DOG$ = "Samba" |
||
DOG$ = "Bernie" |
DOG$ = "Bernie" |
||
PRINT "There is just one dog, named "; DOG$</syntaxhighlight> |
PRINT "There is just one dog, named "; DOG$</syntaxhighlight> |
||
=={{header|BASIC256}}== |
=={{header|BASIC256}}== |
||
BASIC256 is case-insensitive |
BASIC256 is case-insensitive |
||
<syntaxhighlight lang= |
<syntaxhighlight lang="basic256">dog = "Benjamin" |
||
Dog = "Samba" |
Dog = "Samba" |
||
DOG = "Bernie" |
DOG = "Bernie" |
||
print "There is just one dog, named "; dog |
print "There is just one dog, named "; dog |
||
end</syntaxhighlight> |
end</syntaxhighlight> |
||
=={{header|Batch File}}== |
=={{header|Batch File}}== |
||
<syntaxhighlight lang=dos> |
<syntaxhighlight lang="dos"> |
||
@echo off |
@echo off |
||
Line 214: | Line 199: | ||
There is just one dog named Bernie. |
There is just one dog named Bernie. |
||
</pre> |
</pre> |
||
=={{header|BBC BASIC}}== |
=={{header|BBC BASIC}}== |
||
<syntaxhighlight lang=bbcbasic> dog$ = "Benjamin" |
<syntaxhighlight lang="bbcbasic"> dog$ = "Benjamin" |
||
Dog$ = "Samba" |
Dog$ = "Samba" |
||
DOG$ = "Bernie" |
DOG$ = "Bernie" |
||
Line 222: | Line 206: | ||
Output: |
Output: |
||
<pre>The three dogs are Benjamin, Samba and Bernie.</pre> |
<pre>The three dogs are Benjamin, Samba and Bernie.</pre> |
||
=={{header|bc}}== |
=={{header|bc}}== |
||
The only variables are 'a' through 'z'. They can only hold numbers, not strings. Some implementations allow longer names like 'dog', but only with lowercase letters. A name like 'Dog' or 'DOG' is a syntax error. |
The only variables are 'a' through 'z'. They can only hold numbers, not strings. Some implementations allow longer names like 'dog', but only with lowercase letters. A name like 'Dog' or 'DOG' is a syntax error. |
||
<syntaxhighlight lang=bc>obase = 16 |
<syntaxhighlight lang="bc">obase = 16 |
||
ibase = 16 |
ibase = 16 |
||
Line 238: | Line 221: | ||
There is just one dog named BE27A312 |
There is just one dog named BE27A312 |
||
=={{header|Bracmat}}== |
=={{header|Bracmat}}== |
||
<syntaxhighlight lang= |
<syntaxhighlight lang="bracmat">( Benjamin:?dog |
||
& Samba:?Dog |
& Samba:?Dog |
||
& Bernie:?DOG |
& Bernie:?DOG |
||
Line 247: | Line 229: | ||
Output: |
Output: |
||
<pre>There are three dogs: Benjamin Samba and Bernie</pre> |
<pre>There are three dogs: Benjamin Samba and Bernie</pre> |
||
=={{header|Brlcad}}== |
=={{header|Brlcad}}== |
||
The three dogs are drawn as spheres in this simple example: |
The three dogs are drawn as spheres in this simple example: |
||
<syntaxhighlight lang=mged> |
<syntaxhighlight lang="mged"> |
||
opendb dogs.g y # Create a database to hold our dogs |
opendb dogs.g y # Create a database to hold our dogs |
||
units ft # The dogs are measured in feet |
units ft # The dogs are measured in feet |
||
Line 259: | Line 240: | ||
in DOG.s sph 13 0 0 5 # Bernie is massive. He is a New Foundland |
in DOG.s sph 13 0 0 5 # Bernie is massive. He is a New Foundland |
||
echo The three dogs are named Benjamin, Samba and Bernie</syntaxhighlight> |
echo The three dogs are named Benjamin, Samba and Bernie</syntaxhighlight> |
||
=={{header|C}}== |
=={{header|C}}== |
||
C is case sensitive; if it would be case insensitive, an error about redefinition of a variable would be raised. |
C is case sensitive; if it would be case insensitive, an error about redefinition of a variable would be raised. |
||
<syntaxhighlight lang=c>#include <stdio.h> |
<syntaxhighlight lang="c">#include <stdio.h> |
||
static const char *dog = "Benjamin"; |
static const char *dog = "Benjamin"; |
||
Line 274: | Line 254: | ||
return 0; |
return 0; |
||
}</syntaxhighlight> |
}</syntaxhighlight> |
||
=={{header|C sharp|C#}}== |
=={{header|C sharp|C#}}== |
||
C# is case sensitive |
C# is case sensitive |
||
<syntaxhighlight lang= |
<syntaxhighlight lang="c sharp"> |
||
using System; |
using System; |
||
Line 290: | Line 269: | ||
} |
} |
||
}</syntaxhighlight> |
}</syntaxhighlight> |
||
=={{header|C++}}== |
=={{header|C++}}== |
||
C++ is case-sensitive. |
C++ is case-sensitive. |
||
<syntaxhighlight lang=cpp>#include <iostream> |
<syntaxhighlight lang="cpp">#include <iostream> |
||
#include <string> |
#include <string> |
||
using namespace std; |
using namespace std; |
||
Line 304: | Line 282: | ||
{{out}} |
{{out}} |
||
<pre>The three dogs are named Benjamin, Samba, and Bernie</pre> |
<pre>The three dogs are named Benjamin, Samba, and Bernie</pre> |
||
=={{header|Clojure}}== |
=={{header|Clojure}}== |
||
<pre>user=> (let [dog "Benjamin" Dog "Samba" DOG "Bernie"] (format "The three dogs are named %s, %s and %s." dog Dog DOG)) |
<pre>user=> (let [dog "Benjamin" Dog "Samba" DOG "Bernie"] (format "The three dogs are named %s, %s and %s." dog Dog DOG)) |
||
"The three dogs are named Benjamin, Samba and Bernie."</pre> |
"The three dogs are named Benjamin, Samba and Bernie."</pre> |
||
=={{header|COBOL}}== |
=={{header|COBOL}}== |
||
<syntaxhighlight lang=cobol *>* Case sensitivity of identifiers |
<syntaxhighlight lang="cobol *">* Case sensitivity of identifiers |
||
*>* Commented-out lines in the working storage |
*>* Commented-out lines in the working storage |
||
*>* are considered as invalid redefinitions |
*>* are considered as invalid redefinitions |
||
Line 331: | Line 307: | ||
STOP RUN. |
STOP RUN. |
||
END PROGRAM case-sensitivity.</syntaxhighlight> |
END PROGRAM case-sensitivity.</syntaxhighlight> |
||
=={{header|CoffeeScript}}== |
=={{header|CoffeeScript}}== |
||
<syntaxhighlight lang=coffeescript> |
<syntaxhighlight lang="coffeescript"> |
||
dog="Benjamin" |
dog="Benjamin" |
||
Dog = "Samba" |
Dog = "Samba" |
||
Line 341: | Line 316: | ||
output |
output |
||
<syntaxhighlight lang=text> |
<syntaxhighlight lang="text"> |
||
> coffee foo.coffee |
> coffee foo.coffee |
||
The three dogs are names Benjamin, Samba, and Bernie. |
The three dogs are names Benjamin, Samba, and Bernie. |
||
</syntaxhighlight> |
</syntaxhighlight> |
||
=={{header|Common Lisp}}== |
=={{header|Common Lisp}}== |
||
<syntaxhighlight lang=lisp>CL-USER> (let* ((dog "Benjamin") (Dog "Samba") (DOG "Bernie")) |
<syntaxhighlight lang="lisp">CL-USER> (let* ((dog "Benjamin") (Dog "Samba") (DOG "Bernie")) |
||
(format nil "There is just one dog named ~a." dog)) |
(format nil "There is just one dog named ~a." dog)) |
||
; in: LAMBDA NIL |
; in: LAMBDA NIL |
||
Line 364: | Line 338: | ||
These are the style warnings from [[SBCL]]. Other implementations of Common Lisp might give different warnings. |
These are the style warnings from [[SBCL]]. Other implementations of Common Lisp might give different warnings. |
||
=={{header|Crystal}}== |
=={{header|Crystal}}== |
||
<syntaxhighlight lang=crystal>dog = "Benjamin" |
<syntaxhighlight lang="crystal">dog = "Benjamin" |
||
Dog = "Samba" |
Dog = "Samba" |
||
DOG = "Bernie" |
DOG = "Bernie" |
||
Line 375: | Line 348: | ||
{{out}} |
{{out}} |
||
<pre>The three dogs are named Benjamin, Samba and Bernie.</pre> |
<pre>The three dogs are named Benjamin, Samba and Bernie.</pre> |
||
=={{header|D}}== |
=={{header|D}}== |
||
<syntaxhighlight lang=d>import std.stdio; |
<syntaxhighlight lang="d">import std.stdio; |
||
void main() { |
void main() { |
||
Line 389: | Line 361: | ||
Output: |
Output: |
||
<pre>There are three dogs named Benjamin, Samba, and Bernie'</pre> |
<pre>There are three dogs named Benjamin, Samba, and Bernie'</pre> |
||
=={{header|dc}}== |
=={{header|dc}}== |
||
A register name has only one character, so this example uses 'd' and 'D'. |
A register name has only one character, so this example uses 'd' and 'D'. |
||
<syntaxhighlight lang=dc>[Benjamin]sd |
<syntaxhighlight lang="dc">[Benjamin]sd |
||
[Samba]sD |
[Samba]sD |
||
[The two dogs are named ]P ldP [ and ]P lDP [. |
[The two dogs are named ]P ldP [ and ]P lDP [. |
||
Line 400: | Line 371: | ||
{{Out}} |
{{Out}} |
||
<pre>The two dogs are named Benjamin and Samba.</pre> |
<pre>The two dogs are named Benjamin and Samba.</pre> |
||
=={{header|Delphi}}== |
=={{header|Delphi}}== |
||
Delphi is case insensitive. |
Delphi is case insensitive. |
||
<syntaxhighlight lang= |
<syntaxhighlight lang="delphi">program CaseSensitiveIdentifiers; |
||
{$APPTYPE CONSOLE} |
{$APPTYPE CONSOLE} |
||
Line 419: | Line 389: | ||
Output: |
Output: |
||
<pre>There is just one dog named Bernie</pre> |
<pre>There is just one dog named Bernie</pre> |
||
=={{header|DWScript}}== |
=={{header|DWScript}}== |
||
<syntaxhighlight lang= |
<syntaxhighlight lang="delphi"> |
||
var dog : String; |
var dog : String; |
||
Line 432: | Line 401: | ||
Output: |
Output: |
||
<pre>There is just one dog named Bernie</pre> |
<pre>There is just one dog named Bernie</pre> |
||
=={{header|Déjà Vu}}== |
=={{header|Déjà Vu}}== |
||
<syntaxhighlight lang=dejavu>local :dog "Benjamin" |
<syntaxhighlight lang="dejavu">local :dog "Benjamin" |
||
local :Dog "Samba" |
local :Dog "Samba" |
||
local :DOG "Bernie" |
local :DOG "Bernie" |
||
Line 441: | Line 409: | ||
{{out}} |
{{out}} |
||
<pre>There are three dogs named Benjamin, Samba and Bernie.</pre> |
<pre>There are three dogs named Benjamin, Samba and Bernie.</pre> |
||
=={{header|EchoLisp}}== |
=={{header|EchoLisp}}== |
||
<syntaxhighlight lang=scheme> |
<syntaxhighlight lang="scheme"> |
||
(define dog "Benjamin") |
(define dog "Benjamin") |
||
(define Dog "Samba") |
(define Dog "Samba") |
||
Line 451: | Line 418: | ||
The three dogs are named Benjamin, Samba and Bernie. |
The three dogs are named Benjamin, Samba and Bernie. |
||
</syntaxhighlight> |
</syntaxhighlight> |
||
=={{header|Elena}}== |
=={{header|Elena}}== |
||
In ELENA identifiers are case sensitive. |
In ELENA identifiers are case sensitive. |
||
ELENA 4.x: |
ELENA 4.x: |
||
<syntaxhighlight lang=elena>import extensions; |
<syntaxhighlight lang="elena">import extensions; |
||
public program() |
public program() |
||
Line 468: | Line 434: | ||
The three dogs are named Benjamin, Samba and Bernie |
The three dogs are named Benjamin, Samba and Bernie |
||
</pre> |
</pre> |
||
=={{header|Elixir}}== |
=={{header|Elixir}}== |
||
While Elixir's identifiers are case-sensitive, they generally must start with a lowercase letter. Capitalized identifiers are reserved for modules. |
While Elixir's identifiers are case-sensitive, they generally must start with a lowercase letter. Capitalized identifiers are reserved for modules. |
||
<syntaxhighlight lang=elixir>dog = "Benjamin" |
<syntaxhighlight lang="elixir">dog = "Benjamin" |
||
doG = "Samba" |
doG = "Samba" |
||
dOG = "Bernie" |
dOG = "Bernie" |
||
Line 480: | Line 445: | ||
The three dogs are named Benjamin, Samba and Bernie. |
The three dogs are named Benjamin, Samba and Bernie. |
||
</pre> |
</pre> |
||
=={{header|Erlang}}== |
=={{header|Erlang}}== |
||
Erlang variables are case sensitive but must start with an uppercase letter. |
Erlang variables are case sensitive but must start with an uppercase letter. |
||
<syntaxhighlight lang= |
<syntaxhighlight lang="erlang"> |
||
-module( case_sensitivity_of_identifiers ). |
-module( case_sensitivity_of_identifiers ). |
||
Line 500: | Line 464: | ||
The three dogs are named dog, Samba and Bernie |
The three dogs are named dog, Samba and Bernie |
||
</pre> |
</pre> |
||
=={{header|Euphoria}}== |
=={{header|Euphoria}}== |
||
{{works with|Euphoria|4.0.0}} |
{{works with|Euphoria|4.0.0}} |
||
<syntaxhighlight lang= |
<syntaxhighlight lang="euphoria">-- These variables are all different |
||
sequence dog = "Benjamin" |
sequence dog = "Benjamin" |
||
sequence Dog = "Samba" |
sequence Dog = "Samba" |
||
sequence DOG = "Bernie" |
sequence DOG = "Bernie" |
||
printf( 1, "The three dogs are named %s, %s and %s\n", {dog, Dog, DOG} )</syntaxhighlight> |
printf( 1, "The three dogs are named %s, %s and %s\n", {dog, Dog, DOG} )</syntaxhighlight> |
||
=={{header|F Sharp|F#}}== |
=={{header|F Sharp|F#}}== |
||
F# is case-sensitive. |
F# is case-sensitive. |
||
<syntaxhighlight lang=fsharp>let dog = "Benjamin" |
<syntaxhighlight lang="fsharp">let dog = "Benjamin" |
||
let Dog = "Samba" |
let Dog = "Samba" |
||
let DOG = "Bernie" |
let DOG = "Bernie" |
||
printfn "There are three dogs named %s, %s and %s" dog Dog DOG</syntaxhighlight> |
printfn "There are three dogs named %s, %s and %s" dog Dog DOG</syntaxhighlight> |
||
=={{header|Factor}}== |
=={{header|Factor}}== |
||
Factor identifiers are case-sensitive. |
Factor identifiers are case-sensitive. |
||
<syntaxhighlight lang=factor>USING: formatting locals ; |
<syntaxhighlight lang="factor">USING: formatting locals ; |
||
IN: scratchpad |
IN: scratchpad |
||
[let |
[let |
||
Line 530: | Line 491: | ||
There are three dogs named Benjamin, Samba, and Bernie. |
There are three dogs named Benjamin, Samba, and Bernie. |
||
</pre> |
</pre> |
||
=={{header|Forth}}== |
=={{header|Forth}}== |
||
<syntaxhighlight lang=forth>: DOG ." Benjamin" ; |
<syntaxhighlight lang="forth">: DOG ." Benjamin" ; |
||
: Dog ." Samba" ; |
: Dog ." Samba" ; |
||
: dog ." Bernie" ; |
: dog ." Bernie" ; |
||
Line 539: | Line 499: | ||
{{out}} |
{{out}} |
||
<pre>There is just one dog named Bernie</pre> |
<pre>There is just one dog named Bernie</pre> |
||
=={{header|Fortran}}== |
=={{header|Fortran}}== |
||
{{works with|Fortran|90 and later}} |
{{works with|Fortran|90 and later}} |
||
Fortran is case insensitive, and so the three "dog" variants name the same variable - which therefore is multiply declared and will likely evoke a compiler complaint. |
Fortran is case insensitive, and so the three "dog" variants name the same variable - which therefore is multiply declared and will likely evoke a compiler complaint. |
||
<syntaxhighlight lang=fortran>program Example |
<syntaxhighlight lang="fortran">program Example |
||
implicit none |
implicit none |
||
Line 561: | Line 520: | ||
Output: |
Output: |
||
<pre> There is just one dog named Bernie</pre> |
<pre> There is just one dog named Bernie</pre> |
||
=={{header|FreeBASIC}}== |
=={{header|FreeBASIC}}== |
||
<syntaxhighlight lang=freebasic>' FB 1.05.0 Win64 |
<syntaxhighlight lang="freebasic">' FB 1.05.0 Win64 |
||
' FreeBASIC is case-insensitive |
' FreeBASIC is case-insensitive |
||
Line 577: | Line 535: | ||
There is just one dog, named Bernie |
There is just one dog, named Bernie |
||
</pre> |
</pre> |
||
=={{header|Frink}}== |
=={{header|Frink}}== |
||
Frink is case-sensitive. |
Frink is case-sensitive. |
||
<syntaxhighlight lang=frink>dog = "Benjamin" |
<syntaxhighlight lang="frink">dog = "Benjamin" |
||
Dog = "Samba" |
Dog = "Samba" |
||
DOG = "Bernie" |
DOG = "Bernie" |
||
println["There are three dogs named $dog, $Dog and $DOG"]</syntaxhighlight> |
println["There are three dogs named $dog, $Dog and $DOG"]</syntaxhighlight> |
||
=={{header|Gambas}}== |
=={{header|Gambas}}== |
||
'''[https://gambas-playground.proko.eu/?gist=fed58074944b894f5d4cfb8e16c6819a Click this link to run this code]''' |
'''[https://gambas-playground.proko.eu/?gist=fed58074944b894f5d4cfb8e16c6819a Click this link to run this code]''' |
||
Gambas in case insensitive |
Gambas in case insensitive |
||
<syntaxhighlight lang=gambas>Public Sub Main() |
<syntaxhighlight lang="gambas">Public Sub Main() |
||
Dim dog As String |
Dim dog As String |
||
Line 602: | Line 558: | ||
There is just one dog, named Bernie |
There is just one dog, named Bernie |
||
</pre> |
</pre> |
||
=={{header|GAP}}== |
=={{header|GAP}}== |
||
<syntaxhighlight lang=gap># GAP is case sensitive |
<syntaxhighlight lang="gap"># GAP is case sensitive |
||
ThreeDogs := function() |
ThreeDogs := function() |
||
local dog, Dog, DOG; |
local dog, Dog, DOG; |
||
Line 619: | Line 574: | ||
ThreeDogs(); |
ThreeDogs(); |
||
# The three dogs are named Benjamin, Samba and Bernie</syntaxhighlight> |
# The three dogs are named Benjamin, Samba and Bernie</syntaxhighlight> |
||
=={{header|Go}}== |
=={{header|Go}}== |
||
Go is case sensitive. Further, visibility depends on case. See the Go entry under the [[Scope_modifiers#Go|Scope modifiers]] task. |
Go is case sensitive. Further, visibility depends on case. See the Go entry under the [[Scope_modifiers#Go|Scope modifiers]] task. |
||
<syntaxhighlight lang=go>package dogs |
<syntaxhighlight lang="go">package dogs |
||
import "fmt" |
import "fmt" |
||
Line 641: | Line 595: | ||
return map[*string]int{&dog: 1, &Dog: 1, &DOG: 1} |
return map[*string]int{&dog: 1, &Dog: 1, &DOG: 1} |
||
}</syntaxhighlight> |
}</syntaxhighlight> |
||
<syntaxhighlight lang=go>package main |
<syntaxhighlight lang="go">package main |
||
import ( |
import ( |
||
Line 705: | Line 659: | ||
There are 5 dogs. |
There are 5 dogs. |
||
</pre> |
</pre> |
||
=={{header|Groovy}}== |
=={{header|Groovy}}== |
||
Solution: |
Solution: |
||
<syntaxhighlight lang=groovy>def dog = "Benjamin", Dog = "Samba", DOG = "Bernie" |
<syntaxhighlight lang="groovy">def dog = "Benjamin", Dog = "Samba", DOG = "Bernie" |
||
println (dog == DOG ? "There is one dog named ${dog}" : "There are three dogs named ${dog}, ${Dog} and ${DOG}.")</syntaxhighlight> |
println (dog == DOG ? "There is one dog named ${dog}" : "There are three dogs named ${dog}, ${Dog} and ${DOG}.")</syntaxhighlight> |
||
Output: |
Output: |
||
<pre>There are three dogs named Benjamin, Samba and Bernie.</pre> |
<pre>There are three dogs named Benjamin, Samba and Bernie.</pre> |
||
=={{header|Haskell}}== |
=={{header|Haskell}}== |
||
Identifiers are case sensitive in Haskell, but must start with a lower case letter. |
Identifiers are case sensitive in Haskell, but must start with a lower case letter. |
||
<syntaxhighlight lang= |
<syntaxhighlight lang="haskell">import Text.Printf |
||
main = printf "The three dogs are named %s, %s and %s.\n" dog dOG dOg |
main = printf "The three dogs are named %s, %s and %s.\n" dog dOG dOg |
||
Line 723: | Line 675: | ||
dOG = "Samba" |
dOG = "Samba" |
||
dOg = "Bernie"</syntaxhighlight> |
dOg = "Bernie"</syntaxhighlight> |
||
=={{header|Icon}} and {{header|Unicon}}== |
=={{header|Icon}} and {{header|Unicon}}== |
||
The program below demonstrates the three dog task. All variants of Icon/Unicon have case sensitive variable names. But if one wasn't this would find it. |
The program below demonstrates the three dog task. All variants of Icon/Unicon have case sensitive variable names. But if one wasn't this would find it. |
||
<syntaxhighlight lang= |
<syntaxhighlight lang="icon">procedure main() |
||
dog := "Benjamin" |
dog := "Benjamin" |
||
Line 738: | Line 689: | ||
end</syntaxhighlight> |
end</syntaxhighlight> |
||
=={{header|J}}== |
=={{header|J}}== |
||
<syntaxhighlight lang=j> NB. These variables are all different |
<syntaxhighlight lang="j"> NB. These variables are all different |
||
dog=: 'Benjamin' |
dog=: 'Benjamin' |
||
Dog=: 'Samba' |
Dog=: 'Samba' |
||
Line 746: | Line 696: | ||
'The three dogs are named ',dog,', ',Dog,', and ',DOG |
'The three dogs are named ',dog,', ',Dog,', and ',DOG |
||
The three dogs are named Benjamin, Samba, and Bernie </syntaxhighlight> |
The three dogs are named Benjamin, Samba, and Bernie </syntaxhighlight> |
||
=={{header|Java}}== |
=={{header|Java}}== |
||
<syntaxhighlight lang=java>String dog = "Benjamin"; |
<syntaxhighlight lang="java">String dog = "Benjamin"; |
||
String Dog = "Samba"; //in general, identifiers that start with capital letters are class names |
String Dog = "Samba"; //in general, identifiers that start with capital letters are class names |
||
String DOG = "Bernie"; //in general, identifiers in all caps are constants |
String DOG = "Bernie"; //in general, identifiers in all caps are constants |
||
//the conventions listed in comments here are not enforced by the language |
//the conventions listed in comments here are not enforced by the language |
||
System.out.println("There are three dogs named " + dog + ", " + Dog + ", and " + DOG + "'");</syntaxhighlight> |
System.out.println("There are three dogs named " + dog + ", " + Dog + ", and " + DOG + "'");</syntaxhighlight> |
||
=={{header|JavaScript}}== |
=={{header|JavaScript}}== |
||
Javascript is case sensitive. |
Javascript is case sensitive. |
||
<syntaxhighlight lang=javascript>var dog = "Benjamin"; |
<syntaxhighlight lang="javascript">var dog = "Benjamin"; |
||
var Dog = "Samba"; |
var Dog = "Samba"; |
||
var DOG = "Bernie"; |
var DOG = "Bernie"; |
||
document.write("The three dogs are named " + dog + ", " + Dog + ", and " + DOG + ".");</syntaxhighlight> |
document.write("The three dogs are named " + dog + ", " + Dog + ", and " + DOG + ".");</syntaxhighlight> |
||
=={{header|jq}}== |
=={{header|jq}}== |
||
jq identifiers are case-sensitive. |
jq identifiers are case-sensitive. |
||
'''Function parameters''': |
'''Function parameters''': |
||
<syntaxhighlight lang=jq>def task(dog; Dog; DOG): |
<syntaxhighlight lang="jq">def task(dog; Dog; DOG): |
||
"The three dogs are named \(dog), \(Dog), and \(DOG)." ; |
"The three dogs are named \(dog), \(Dog), and \(DOG)." ; |
||
Line 775: | Line 722: | ||
'''Variable names''': |
'''Variable names''': |
||
<syntaxhighlight lang=jq>"Benjamin" as $dog | "Samba" as $Dog | "Bernie" as $DOG |
<syntaxhighlight lang="jq">"Benjamin" as $dog | "Samba" as $Dog | "Bernie" as $DOG |
||
| "The three dogs are named \($dog), \($Dog), and \($DOG)."</syntaxhighlight> |
| "The three dogs are named \($dog), \($Dog), and \($DOG)."</syntaxhighlight> |
||
{{out}} |
{{out}} |
||
As above. |
As above. |
||
=={{header|Julia}}== |
=={{header|Julia}}== |
||
{{works with|Julia|0.6}} |
{{works with|Julia|0.6}} |
||
Variable names are case sensitive. |
Variable names are case sensitive. |
||
<syntaxhighlight lang=julia>dog, Dog, DOG = "Benjamin", "Samba", "Bernie" |
<syntaxhighlight lang="julia">dog, Dog, DOG = "Benjamin", "Samba", "Bernie" |
||
if dog === Dog |
if dog === Dog |
||
Line 795: | Line 741: | ||
Conventionally, variable names should be all lower case. Type and Macro names should be capitalized. |
Conventionally, variable names should be all lower case. Type and Macro names should be capitalized. |
||
=={{header|K}}== |
=={{header|K}}== |
||
<syntaxhighlight lang=k> |
<syntaxhighlight lang="k"> |
||
dog: "Benjamin" |
dog: "Benjamin" |
||
Dog: "Samba" |
Dog: "Samba" |
||
Line 804: | Line 749: | ||
"There are three dogs named Benjamin, Samba and Bernie" |
"There are three dogs named Benjamin, Samba and Bernie" |
||
</syntaxhighlight> |
</syntaxhighlight> |
||
=={{header|Kotlin}}== |
=={{header|Kotlin}}== |
||
Kotlin is case-sensitive though (as in Java) the convention is for local variable names to begin with a lower case letter. The second and third identifiers would therefore be unlikely to be used in practice. |
Kotlin is case-sensitive though (as in Java) the convention is for local variable names to begin with a lower case letter. The second and third identifiers would therefore be unlikely to be used in practice. |
||
<syntaxhighlight lang=scala>fun main(args: Array<String>) { |
<syntaxhighlight lang="scala">fun main(args: Array<String>) { |
||
val dog = "Benjamin" |
val dog = "Benjamin" |
||
val Dog = "Samba" |
val Dog = "Samba" |
||
Line 818: | Line 762: | ||
The three dogs are named Benjamin, Samba and Bernie |
The three dogs are named Benjamin, Samba and Bernie |
||
</pre> |
</pre> |
||
=={{header|Lasso}}== |
=={{header|Lasso}}== |
||
Lasso is not case sensitive for names |
Lasso is not case sensitive for names |
||
<syntaxhighlight lang= |
<syntaxhighlight lang="lasso"> |
||
local(dog = 'Benjamin') |
local(dog = 'Benjamin') |
||
local(Dog = 'Samba') |
local(Dog = 'Samba') |
||
Line 832: | Line 775: | ||
Same with string comparisons. (Lasso maps can only contain unique keys) |
Same with string comparisons. (Lasso maps can only contain unique keys) |
||
<syntaxhighlight lang= |
<syntaxhighlight lang="lasso"> |
||
local(dogs = map( |
local(dogs = map( |
||
'dog' = 'Benjamin', |
'dog' = 'Benjamin', |
||
Line 843: | Line 786: | ||
To get case sensitivity we need to use bytes |
To get case sensitivity we need to use bytes |
||
<syntaxhighlight lang= |
<syntaxhighlight lang="lasso"> |
||
local(dogs = map( |
local(dogs = map( |
||
bytes('dog') = 'Benjamin', |
bytes('dog') = 'Benjamin', |
||
Line 856: | Line 799: | ||
<pre>3 |
<pre>3 |
||
Samba </pre> |
Samba </pre> |
||
=={{header|Liberty BASIC}}== |
=={{header|Liberty BASIC}}== |
||
NB the IDE warns you that there are similar variables named dog$, Dog$ & DOG$ |
NB the IDE warns you that there are similar variables named dog$, Dog$ & DOG$ |
||
<syntaxhighlight lang=lb> |
<syntaxhighlight lang="lb"> |
||
dog$ = "Benjamin" |
dog$ = "Benjamin" |
||
Dog$ = "Samba" |
Dog$ = "Samba" |
||
Line 868: | Line 810: | ||
</syntaxhighlight> |
</syntaxhighlight> |
||
The three dogs are Benjamin, Samba and Bernie. |
The three dogs are Benjamin, Samba and Bernie. |
||
=={{header|Lua}}== |
=={{header|Lua}}== |
||
<syntaxhighlight lang=lua>dog = "Benjamin" |
<syntaxhighlight lang="lua">dog = "Benjamin" |
||
Dog = "Samba" |
Dog = "Samba" |
||
DOG = "Bernie" |
DOG = "Bernie" |
||
Line 876: | Line 817: | ||
print( "There are three dogs named "..dog..", "..Dog.." and "..DOG.."." )</syntaxhighlight> |
print( "There are three dogs named "..dog..", "..Dog.." and "..DOG.."." )</syntaxhighlight> |
||
<pre>There are three dogs named Benjamin, Samba and Bernie.</pre> |
<pre>There are three dogs named Benjamin, Samba and Bernie.</pre> |
||
=={{header|M2000 Interpreter}}== |
=={{header|M2000 Interpreter}}== |
||
Labels are case sensitive, but identifiers are not case sensitive. |
Labels are case sensitive, but identifiers are not case sensitive. |
||
Line 882: | Line 822: | ||
Types in Enumeration are case sensitive, identifiers are not case sensitive. |
Types in Enumeration are case sensitive, identifiers are not case sensitive. |
||
<syntaxhighlight lang= |
<syntaxhighlight lang="m2000 interpreter"> |
||
MoDuLe CheckIT { |
MoDuLe CheckIT { |
||
\\ keys as case sensitive if they are strings |
\\ keys as case sensitive if they are strings |
||
Line 910: | Line 850: | ||
Checkit |
Checkit |
||
</syntaxhighlight> |
</syntaxhighlight> |
||
=={{header|Maple}}== |
=={{header|Maple}}== |
||
<syntaxhighlight lang=text>> dog, Dog, DOG := "Benjamin", "Samba", "Bernie": |
<syntaxhighlight lang="text">> dog, Dog, DOG := "Benjamin", "Samba", "Bernie": |
||
> if nops( { dog, Dog, DOG } ) = 3 then |
> if nops( { dog, Dog, DOG } ) = 3 then |
||
> printf( "There are three dogs named %s, %s and %s.\n", dog, Dog, DOG ) |
> printf( "There are three dogs named %s, %s and %s.\n", dog, Dog, DOG ) |
||
Line 921: | Line 860: | ||
> end if: |
> end if: |
||
There are three dogs named Benjamin, Samba and Bernie.</syntaxhighlight> |
There are three dogs named Benjamin, Samba and Bernie.</syntaxhighlight> |
||
=={{header|Mathematica}} / {{header|Wolfram Language}}== |
=={{header|Mathematica}} / {{header|Wolfram Language}}== |
||
<syntaxhighlight lang= |
<syntaxhighlight lang="mathematica">dog = "Benjamin"; Dog = "Samba"; DOG = "Bernie"; |
||
"The three dogs are named "<> dog <>", "<> Dog <>" and "<> DOG |
"The three dogs are named "<> dog <>", "<> Dog <>" and "<> DOG |
||
-> "The three dogs are named Benjamin, Samba and Bernie"</syntaxhighlight> |
-> "The three dogs are named Benjamin, Samba and Bernie"</syntaxhighlight> |
||
=={{header|MATLAB}} / {{header|Octave}}== |
=={{header|MATLAB}} / {{header|Octave}}== |
||
<syntaxhighlight lang= |
<syntaxhighlight lang="matlab"> dog = 'Benjamin'; |
||
Dog = 'Samba'; |
Dog = 'Samba'; |
||
DOG = 'Bernie'; |
DOG = 'Bernie'; |
||
Line 939: | Line 876: | ||
<pre> There are three dogs Benjamin, Samba, Bernie. </pre> |
<pre> There are three dogs Benjamin, Samba, Bernie. </pre> |
||
=={{header|Maxima}}== |
=={{header|Maxima}}== |
||
<syntaxhighlight lang=maxima>/* Maxima is case sensitive */ |
<syntaxhighlight lang="maxima">/* Maxima is case sensitive */ |
||
a: 1$ |
a: 1$ |
||
A: 2$ |
A: 2$ |
||
Line 947: | Line 883: | ||
is(a = A); |
is(a = A); |
||
false</syntaxhighlight> |
false</syntaxhighlight> |
||
=={{header|min}}== |
=={{header|min}}== |
||
{{works with|min|0.19.3}} |
{{works with|min|0.19.3}} |
||
min's symbols are case sensitive. |
min's symbols are case sensitive. |
||
<syntaxhighlight lang=min>"Benjamin" :dog |
<syntaxhighlight lang="min">"Benjamin" :dog |
||
"Samba" :Dog |
"Samba" :Dog |
||
"Bernie" :DOG |
"Bernie" :DOG |
||
Line 960: | Line 895: | ||
There are three dogs named Benjamin, Samba, and Bernie. |
There are three dogs named Benjamin, Samba, and Bernie. |
||
</pre> |
</pre> |
||
=={{header|MiniScript}}== |
=={{header|MiniScript}}== |
||
<syntaxhighlight lang= |
<syntaxhighlight lang="miniscript">dog = "Benjamin" |
||
Dog = "Samba" |
Dog = "Samba" |
||
DOG = "Bernie" |
DOG = "Bernie" |
||
print "There are three dogs named " + dog + ", " + Dog + " and " + DOG</syntaxhighlight> |
print "There are three dogs named " + dog + ", " + Dog + " and " + DOG</syntaxhighlight> |
||
=={{header|Modula-2}}== |
=={{header|Modula-2}}== |
||
<syntaxhighlight lang=modula2>MODULE dog; |
<syntaxhighlight lang="modula2">MODULE dog; |
||
IMPORT InOut; |
IMPORT InOut; |
||
Line 983: | Line 916: | ||
InOut.WriteLn |
InOut.WriteLn |
||
END dog.</syntaxhighlight> |
END dog.</syntaxhighlight> |
||
=={{header|Nanoquery}}== |
=={{header|Nanoquery}}== |
||
<syntaxhighlight lang=nanoquery>dog = "Benjamin" |
<syntaxhighlight lang="nanoquery">dog = "Benjamin" |
||
Dog = "Samba" |
Dog = "Samba" |
||
DOG = "Bernie" |
DOG = "Bernie" |
||
Line 992: | Line 924: | ||
{{out}} |
{{out}} |
||
<pre>The three dogs are named Benjamin, Samba, and Bernie.</pre> |
<pre>The three dogs are named Benjamin, Samba, and Bernie.</pre> |
||
=={{header|Nemerle}}== |
=={{header|Nemerle}}== |
||
<syntaxhighlight lang= |
<syntaxhighlight lang="nemerle">def dog = "Benjamin"; |
||
def Dog = "Samba"; |
def Dog = "Samba"; |
||
def DOG = "Bernie"; |
def DOG = "Bernie"; |
||
WriteLine($"The three dogs are named $dog, $Dog, and $DOG");</syntaxhighlight> |
WriteLine($"The three dogs are named $dog, $Dog, and $DOG");</syntaxhighlight> |
||
=={{header|NESL}}== |
=={{header|NESL}}== |
||
NESL is completely case-insensitive. |
NESL is completely case-insensitive. |
||
<syntaxhighlight lang=nesl>dog = "Benjamin"; |
<syntaxhighlight lang="nesl">dog = "Benjamin"; |
||
Dog = "Samba"; |
Dog = "Samba"; |
||
DOG = "Bernie"; |
DOG = "Bernie"; |
||
Line 1,007: | Line 937: | ||
{{out}} |
{{out}} |
||
<pre>it = "There is just one dog, named Bernie" : [char]</pre> |
<pre>it = "There is just one dog, named Bernie" : [char]</pre> |
||
=={{header|NetRexx}}== |
=={{header|NetRexx}}== |
||
NetRexx is not case sensitive: |
NetRexx is not case sensitive: |
||
<syntaxhighlight lang= |
<syntaxhighlight lang="netrexx">/* NetRexx */ |
||
options replace format comments java crossref symbols nobinary |
options replace format comments java crossref symbols nobinary |
||
Line 1,030: | Line 959: | ||
There is just one dog named Bernie. |
There is just one dog named Bernie. |
||
</pre> |
</pre> |
||
=={{header|Nim}}== |
=={{header|Nim}}== |
||
Nim has peculiar rules regarding case and style sensitivity: |
Nim has peculiar rules regarding case and style sensitivity: |
||
Line 1,040: | Line 968: | ||
With these rules, we don’t get one dog or three dogs: we get two dogs! |
With these rules, we don’t get one dog or three dogs: we get two dogs! |
||
<syntaxhighlight lang= |
<syntaxhighlight lang="nim">var dog, Dog: string |
||
(dog, Dog, DOG) = ("Benjamin", "Samba", "Bernie") |
(dog, Dog, DOG) = ("Benjamin", "Samba", "Bernie") |
||
Line 1,055: | Line 983: | ||
{{out}} |
{{out}} |
||
<pre>There are two dogs: Benjamin and Bernie</pre> |
<pre>There are two dogs: Benjamin and Bernie</pre> |
||
=={{header|Oberon-2}}== |
=={{header|Oberon-2}}== |
||
{{Works with| oo2c Version 2}} |
{{Works with| oo2c Version 2}} |
||
<syntaxhighlight lang=oberon2> |
<syntaxhighlight lang="oberon2"> |
||
MODULE CaseSensitivity; |
MODULE CaseSensitivity; |
||
IMPORT |
IMPORT |
||
Line 1,076: | Line 1,003: | ||
The three dogs are named Benjamin, Samba and Bernie |
The three dogs are named Benjamin, Samba and Bernie |
||
</pre> |
</pre> |
||
=={{header|Objeck}}== |
=={{header|Objeck}}== |
||
Objeck is case sensitive |
Objeck is case sensitive |
||
<syntaxhighlight lang=objeck>class Program { |
<syntaxhighlight lang="objeck">class Program { |
||
function : Main(args : String[]) ~ Nil { |
function : Main(args : String[]) ~ Nil { |
||
dog := "Benjamin"; |
dog := "Benjamin"; |
||
Line 1,088: | Line 1,014: | ||
} |
} |
||
}</syntaxhighlight> |
}</syntaxhighlight> |
||
=={{header|OCaml}}== |
=={{header|OCaml}}== |
||
Identifiers in OCaml are lettercase sensitive, but the first letter has to be lowercase. |
Identifiers in OCaml are lettercase sensitive, but the first letter has to be lowercase. |
||
<syntaxhighlight lang=ocaml>let () = |
<syntaxhighlight lang="ocaml">let () = |
||
let dog = "Benjamin" in |
let dog = "Benjamin" in |
||
let dOG = "Samba" in |
let dOG = "Samba" in |
||
let dOg = "Bernie" in |
let dOg = "Bernie" in |
||
Printf.printf "The three dogs are named %s, %s and %s.\n" dog dOG dOg</syntaxhighlight> |
Printf.printf "The three dogs are named %s, %s and %s.\n" dog dOG dOg</syntaxhighlight> |
||
=={{header|Oforth}}== |
=={{header|Oforth}}== |
||
Oforth is case-sensitive. |
Oforth is case-sensitive. |
||
<syntaxhighlight lang= |
<syntaxhighlight lang="oforth">: threeDogs |
||
| dog Dog DOG | |
| dog Dog DOG | |
||
Line 1,111: | Line 1,035: | ||
System.Out "The three dogs are named " << dog << ", " << Dog << " and " << DOG << "." << cr ;</syntaxhighlight> |
System.Out "The three dogs are named " << dog << ", " << Dog << " and " << DOG << "." << cr ;</syntaxhighlight> |
||
=={{header|Ol}}== |
=={{header|Ol}}== |
||
<syntaxhighlight lang=scheme> |
<syntaxhighlight lang="scheme"> |
||
(define dog "Benjamin") |
(define dog "Benjamin") |
||
(define Dog "Samba") |
(define Dog "Samba") |
||
Line 1,124: | Line 1,047: | ||
The three dogs are named Benjamin, Samba and Bernie. |
The three dogs are named Benjamin, Samba and Bernie. |
||
</pre> |
</pre> |
||
=={{header|PARI/GP}}== |
=={{header|PARI/GP}}== |
||
<syntaxhighlight lang=parigp>dog="Benjamin"; |
<syntaxhighlight lang="parigp">dog="Benjamin"; |
||
Dog="Samba"; |
Dog="Samba"; |
||
DOG="Bernie"; |
DOG="Bernie"; |
||
printf("The three dogs are named %s, %s, and %s.", dog, Dog, DOG)</syntaxhighlight> |
printf("The three dogs are named %s, %s, and %s.", dog, Dog, DOG)</syntaxhighlight> |
||
=={{header|Pascal}}== |
=={{header|Pascal}}== |
||
See [[#Delphi|Delphi]] |
See [[#Delphi|Delphi]] |
||
=={{header|Perl}}== |
=={{header|Perl}}== |
||
<syntaxhighlight lang=perl># These variables are all different |
<syntaxhighlight lang="perl"># These variables are all different |
||
$dog='Benjamin'; |
$dog='Benjamin'; |
||
$Dog='Samba'; |
$Dog='Samba'; |
||
$DOG='Bernie'; |
$DOG='Bernie'; |
||
print "The three dogs are named $dog, $Dog, and $DOG \n"</syntaxhighlight> |
print "The three dogs are named $dog, $Dog, and $DOG \n"</syntaxhighlight> |
||
=={{header|Phix}}== |
=={{header|Phix}}== |
||
{{libheader|Phix/basics}} |
{{libheader|Phix/basics}} |
||
Phix is case sensitive |
Phix is case sensitive |
||
<!--<syntaxhighlight lang= |
<!--<syntaxhighlight lang="phix">--> |
||
<span style="color: #004080;">sequence</span> <span style="color: #000000;">dog</span> <span style="color: #0000FF;">=</span> <span style="color: #008000;">"Benjamin"<span style="color: #0000FF;">,</span> |
<span style="color: #004080;">sequence</span> <span style="color: #000000;">dog</span> <span style="color: #0000FF;">=</span> <span style="color: #008000;">"Benjamin"<span style="color: #0000FF;">,</span> |
||
<span style="color: #000000;">Dog</span> <span style="color: #0000FF;">=</span> <span style="color: #008000;">"Samba"<span style="color: #0000FF;">,</span> |
<span style="color: #000000;">Dog</span> <span style="color: #0000FF;">=</span> <span style="color: #008000;">"Samba"<span style="color: #0000FF;">,</span> |
||
Line 1,157: | Line 1,075: | ||
The three dogs are named Benjamin, Samba and Bernie |
The three dogs are named Benjamin, Samba and Bernie |
||
</pre> |
</pre> |
||
=={{header|PicoLisp}}== |
=={{header|PicoLisp}}== |
||
<syntaxhighlight lang= |
<syntaxhighlight lang="picolisp">(let (dog "Benjamin" Dog "Samba" DOG "Bernie") |
||
(prinl "The three dogs are named " dog ", " Dog " and " DOG) )</syntaxhighlight> |
(prinl "The three dogs are named " dog ", " Dog " and " DOG) )</syntaxhighlight> |
||
Output: |
Output: |
||
<pre>The three dogs are named Benjamin, Samba and Bernie</pre> |
<pre>The three dogs are named Benjamin, Samba and Bernie</pre> |
||
=={{header|PL/I}}== |
=={{header|PL/I}}== |
||
<syntaxhighlight lang=pli>*process or(!) source xref attributes macro options; |
<syntaxhighlight lang="pli">*process or(!) source xref attributes macro options; |
||
/********************************************************************* |
/********************************************************************* |
||
* Program to show that PL/I is case-insensitive |
* Program to show that PL/I is case-insensitive |
||
Line 1,179: | Line 1,095: | ||
'''Output''' |
'''Output''' |
||
<pre>Bernie Bernie Berni</pre> |
<pre>Bernie Bernie Berni</pre> |
||
=={{header|Plain English}}== |
=={{header|Plain English}}== |
||
Plain English is NOT case sensitive. |
Plain English is NOT case sensitive. |
||
<syntaxhighlight lang=plainenglish>To run: |
<syntaxhighlight lang="plainenglish">To run: |
||
Start up. |
Start up. |
||
Put "Benjamin" into a DOG string. |
Put "Benjamin" into a DOG string. |
||
Line 1,194: | Line 1,109: | ||
There is just one dog named Bernie |
There is just one dog named Bernie |
||
</pre> |
</pre> |
||
=={{header|PowerShell}}== |
=={{header|PowerShell}}== |
||
PowerShell is not case sensitive. |
PowerShell is not case sensitive. |
||
<syntaxhighlight lang= |
<syntaxhighlight lang="powershell"> |
||
$dog = "Benjamin" |
$dog = "Benjamin" |
||
$Dog = "Samba" |
$Dog = "Samba" |
||
Line 1,208: | Line 1,122: | ||
There is just one dog named Bernie. |
There is just one dog named Bernie. |
||
</pre> |
</pre> |
||
=={{header|Prolog}}== |
=={{header|Prolog}}== |
||
In Prolog, the initial of a variable must be a uppercase letter. So the task can't be completed but we can write this code : |
In Prolog, the initial of a variable must be a uppercase letter. So the task can't be completed but we can write this code : |
||
<syntaxhighlight lang= |
<syntaxhighlight lang="prolog">three_dogs :- |
||
DoG = 'Benjamin', |
DoG = 'Benjamin', |
||
Dog = 'Samba', |
Dog = 'Samba', |
||
Line 1,223: | Line 1,136: | ||
</pre> |
</pre> |
||
=={{header|PureBasic}}== |
=={{header|PureBasic}}== |
||
<syntaxhighlight lang= |
<syntaxhighlight lang="purebasic">dog$="Benjamin" |
||
Dog$="Samba" |
Dog$="Samba" |
||
DOG$="Bernie" |
DOG$="Bernie" |
||
Debug "There is just one dog named "+dog$</syntaxhighlight> |
Debug "There is just one dog named "+dog$</syntaxhighlight> |
||
=={{header|Python}}== |
=={{header|Python}}== |
||
Python names are case sensitive: |
Python names are case sensitive: |
||
<syntaxhighlight lang=python>>>> dog = 'Benjamin'; Dog = 'Samba'; DOG = 'Bernie' |
<syntaxhighlight lang="python">>>> dog = 'Benjamin'; Dog = 'Samba'; DOG = 'Bernie' |
||
>>> print ('The three dogs are named ',dog,', ',Dog,', and ',DOG) |
>>> print ('The three dogs are named ',dog,', ',Dog,', and ',DOG) |
||
The three dogs are named Benjamin , Samba , and Bernie |
The three dogs are named Benjamin , Samba , and Bernie |
||
>>> </syntaxhighlight> |
>>> </syntaxhighlight> |
||
=={{header|Quackery}}== |
=={{header|Quackery}}== |
||
<syntaxhighlight lang=quackery>[ $ 'Benjamin' ] is dog ( --> $ ) |
<syntaxhighlight lang="quackery">[ $ 'Benjamin' ] is dog ( --> $ ) |
||
[ $ 'Samba' ] is Dog ( --> $ ) |
[ $ 'Samba' ] is Dog ( --> $ ) |
||
Line 1,252: | Line 1,162: | ||
There are three dogs named Benjamin, Samba, and Bernie. |
There are three dogs named Benjamin, Samba, and Bernie. |
||
</pre> |
</pre> |
||
=={{header|R}}== |
=={{header|R}}== |
||
<syntaxhighlight lang= |
<syntaxhighlight lang="r">dog <- 'Benjamin' |
||
Dog <- 'Samba' |
Dog <- 'Samba' |
||
DOG <- 'Bernie' |
DOG <- 'Bernie' |
||
Line 1,273: | Line 1,182: | ||
The three dogs are named Benjamin, Samba and Bernie. |
The three dogs are named Benjamin, Samba and Bernie. |
||
</pre> |
</pre> |
||
=={{header|Racket}}== |
=={{header|Racket}}== |
||
The default setting for the Racket reader is to be case sensitive: |
The default setting for the Racket reader is to be case sensitive: |
||
<syntaxhighlight lang= |
<syntaxhighlight lang="racket"> |
||
#lang racket |
#lang racket |
||
(define dog "Benjamin") |
(define dog "Benjamin") |
||
Line 1,292: | Line 1,200: | ||
If you need case insensitive identifiers, then use #ci to turn on case insensitivity: |
If you need case insensitive identifiers, then use #ci to turn on case insensitivity: |
||
<syntaxhighlight lang= |
<syntaxhighlight lang="racket"> |
||
#lang racket |
#lang racket |
||
#ci(module dogs racket |
#ci(module dogs racket |
||
Line 1,307: | Line 1,215: | ||
There is one dog named Bernie. |
There is one dog named Bernie. |
||
</pre> |
</pre> |
||
=={{header|Raku}}== |
=={{header|Raku}}== |
||
(formerly Perl 6) |
(formerly Perl 6) |
||
<syntaxhighlight lang=raku line>my $dog = 'Benjamin'; |
<syntaxhighlight lang="raku" line>my $dog = 'Benjamin'; |
||
my $Dog = 'Samba'; |
my $Dog = 'Samba'; |
||
my $DOG = 'Bernie'; |
my $DOG = 'Bernie'; |
||
say "The three dogs are named $dog, $Dog, and $DOG."</syntaxhighlight> |
say "The three dogs are named $dog, $Dog, and $DOG."</syntaxhighlight> |
||
The only place that Raku pays any attention to the case of identifiers is that, for certain error messages, it will guess that an identifier starting lowercase is probably a function name, while one starting uppercase is probably a type or constant name. But this case distinction is merely a convention in Raku, not mandatory: |
The only place that Raku pays any attention to the case of identifiers is that, for certain error messages, it will guess that an identifier starting lowercase is probably a function name, while one starting uppercase is probably a type or constant name. But this case distinction is merely a convention in Raku, not mandatory: |
||
<syntaxhighlight lang=raku line>constant dog = 'Benjamin'; |
<syntaxhighlight lang="raku" line>constant dog = 'Benjamin'; |
||
sub Dog() { 'Samba' } |
sub Dog() { 'Samba' } |
||
my &DOG = { 'Bernie' } |
my &DOG = { 'Bernie' } |
||
say "The three dogs are named {dog}, {Dog}, and {DOG}."</syntaxhighlight> |
say "The three dogs are named {dog}, {Dog}, and {DOG}."</syntaxhighlight> |
||
=={{header|Retro}}== |
=={{header|Retro}}== |
||
Retro is case sensitive. |
Retro is case sensitive. |
||
<syntaxhighlight lang= |
<syntaxhighlight lang="retro">: dog ( -$ ) "Benjamin" ; |
||
: Dog ( -$ ) "Samba" ; |
: Dog ( -$ ) "Samba" ; |
||
: DOG ( -$ ) "Bernie" ; |
: DOG ( -$ ) "Bernie" ; |
||
DOG Dog dog "The three dogs are named %s, %s, and %s.\n" puts</syntaxhighlight> |
DOG Dog dog "The three dogs are named %s, %s, and %s.\n" puts</syntaxhighlight> |
||
=={{header|REXX}}== |
=={{header|REXX}}== |
||
===simple variables=== |
===simple variables=== |
||
The REXX language is case insensitive (with respect to simple variables). |
The REXX language is case insensitive (with respect to simple variables). |
||
<syntaxhighlight lang=rexx>/*REXX program demonstrate case insensitivity for simple REXX variable names. */ |
<syntaxhighlight lang="rexx">/*REXX program demonstrate case insensitivity for simple REXX variable names. */ |
||
/* ┌──◄── all 3 left─hand side REXX variables are identical (as far as assignments). */ |
/* ┌──◄── all 3 left─hand side REXX variables are identical (as far as assignments). */ |
||
Line 1,357: | Line 1,262: | ||
===compound variables=== |
===compound variables=== |
||
However, the REXX language is case sensitive (with respect to compound variables, or indices). |
However, the REXX language is case sensitive (with respect to compound variables, or indices). |
||
<syntaxhighlight lang=rexx>/*REXX program demonstrate case sensitive REXX index names (for compound variables). */ |
<syntaxhighlight lang="rexx">/*REXX program demonstrate case sensitive REXX index names (for compound variables). */ |
||
/* ┌──◄── all 3 indices (for an array variable) are unique (as far as array index). */ |
/* ┌──◄── all 3 indices (for an array variable) are unique (as far as array index). */ |
||
Line 1,385: | Line 1,290: | ||
dogname.doG= Rex |
dogname.doG= Rex |
||
</pre> |
</pre> |
||
=={{header|Ring}}== |
=={{header|Ring}}== |
||
<syntaxhighlight lang=ring> |
<syntaxhighlight lang="ring"> |
||
dog = "Benjamin" |
dog = "Benjamin" |
||
doG = "Smokey" |
doG = "Smokey" |
||
Line 1,394: | Line 1,298: | ||
see "The 4 dogs are : " + dog + ", " + doG + ", " + Dog + " and " + DOG + "." |
see "The 4 dogs are : " + dog + ", " + doG + ", " + Dog + " and " + DOG + "." |
||
</syntaxhighlight> |
</syntaxhighlight> |
||
=={{header|Ruby}}== |
=={{header|Ruby}}== |
||
Ruby gives a special meaning to the first letter of a name. A lowercase letter starts a local variable. An uppercase letter starts a constant. So <tt>dog</tt> is a local variable, but <tt>Dog</tt> and <tt>DOG</tt> are constants. To adapt this task to Ruby, I added <tt>dOg</tt> and <tt>doG</tt> so that I have more than one local variable. |
Ruby gives a special meaning to the first letter of a name. A lowercase letter starts a local variable. An uppercase letter starts a constant. So <tt>dog</tt> is a local variable, but <tt>Dog</tt> and <tt>DOG</tt> are constants. To adapt this task to Ruby, I added <tt>dOg</tt> and <tt>doG</tt> so that I have more than one local variable. |
||
<syntaxhighlight lang=ruby>module FiveDogs |
<syntaxhighlight lang="ruby">module FiveDogs |
||
dog = "Benjamin" |
dog = "Benjamin" |
||
dOg = "Dogley" |
dOg = "Dogley" |
||
Line 1,417: | Line 1,320: | ||
The local variables are dog, dOg, doG, names. |
The local variables are dog, dOg, doG, names. |
||
The constants are Dog, DOG.</pre> |
The constants are Dog, DOG.</pre> |
||
=={{header|Run BASIC}}== |
=={{header|Run BASIC}}== |
||
<syntaxhighlight lang=runbasic> |
<syntaxhighlight lang="runbasic"> |
||
dog$ = "Benjamin" |
dog$ = "Benjamin" |
||
doG$ = "Smokey" |
doG$ = "Smokey" |
||
Line 1,426: | Line 1,328: | ||
print "The 4 dogs are "; dog$; ", "; doG$; ", "; Dog$; " and "; DOG$; "." |
print "The 4 dogs are "; dog$; ", "; doG$; ", "; Dog$; " and "; DOG$; "." |
||
</syntaxhighlight> |
</syntaxhighlight> |
||
=={{header|Rust}}== |
=={{header|Rust}}== |
||
Rust style dictates that identifiers should be written in snake case, e.g. <tt>big_dog</tt>, <tt>small_dog</tt>; whereas types (structs and enums) should be written in camel case, e.g. <tt>BigDog</tt>, <tt>SmallDog</tt>. Failing to comply with this standard does not cause a compiler error, but it will trigger a compiler warning, and the culture is very strongly towards compliance with this standard. |
Rust style dictates that identifiers should be written in snake case, e.g. <tt>big_dog</tt>, <tt>small_dog</tt>; whereas types (structs and enums) should be written in camel case, e.g. <tt>BigDog</tt>, <tt>SmallDog</tt>. Failing to comply with this standard does not cause a compiler error, but it will trigger a compiler warning, and the culture is very strongly towards compliance with this standard. |
||
<syntaxhighlight lang=rust>fn main() { |
<syntaxhighlight lang="rust">fn main() { |
||
let dog = "Benjamin"; |
let dog = "Benjamin"; |
||
let Dog = "Samba"; |
let Dog = "Samba"; |
||
Line 1,439: | Line 1,340: | ||
This triggers two warnings at compilation: |
This triggers two warnings at compilation: |
||
<syntaxhighlight lang=text><anon>:3:9: 3:12 warning: variable `Dog` should have a snake case name such as `dog`, #[warn(non_snake_case)] on by default |
<syntaxhighlight lang="text"><anon>:3:9: 3:12 warning: variable `Dog` should have a snake case name such as `dog`, #[warn(non_snake_case)] on by default |
||
<anon>:3 let Dog = "Samba"; |
<anon>:3 let Dog = "Samba"; |
||
^~~ |
^~~ |
||
Line 1,448: | Line 1,349: | ||
The resulting program will compile and run just fine, producing the output: |
The resulting program will compile and run just fine, producing the output: |
||
<syntaxhighlight lang=text>The three dogs are named Benjamin, Samba and Bernie.</syntaxhighlight> |
<syntaxhighlight lang="text">The three dogs are named Benjamin, Samba and Bernie.</syntaxhighlight> |
||
=={{header|Sather}}== |
=={{header|Sather}}== |
||
Though by convention Sather uses all uppercase letters for class names, a variable can be |
Though by convention Sather uses all uppercase letters for class names, a variable can be |
||
all uppercase. |
all uppercase. |
||
<syntaxhighlight lang=sather>class MAIN is |
<syntaxhighlight lang="sather">class MAIN is |
||
main is |
main is |
||
dog ::= "Benjamin"; |
dog ::= "Benjamin"; |
||
Line 1,467: | Line 1,367: | ||
<pre>The three dogs are Benjamin, Samba and Bernie</pre> |
<pre>The three dogs are Benjamin, Samba and Bernie</pre> |
||
=={{header|Scala}}== |
=={{header|Scala}}== |
||
<syntaxhighlight lang=scala>val dog = "Benjamin" |
<syntaxhighlight lang="scala">val dog = "Benjamin" |
||
val Dog = "Samba" |
val Dog = "Samba" |
||
val DOG = "Bernie" |
val DOG = "Bernie" |
||
Line 1,475: | Line 1,374: | ||
Output: |
Output: |
||
<pre>There are three dogs named Benjamin, Samba, and Bernie.</pre> |
<pre>There are three dogs named Benjamin, Samba, and Bernie.</pre> |
||
=={{header|Scheme}}== |
=={{header|Scheme}}== |
||
Output may differ depending on implementation. |
Output may differ depending on implementation. |
||
<syntaxhighlight lang=scheme>(define dog "Benjamin") |
<syntaxhighlight lang="scheme">(define dog "Benjamin") |
||
(define Dog "Samba") |
(define Dog "Samba") |
||
(define DOG "Bernie") |
(define DOG "Bernie") |
||
Line 1,493: | Line 1,391: | ||
(display ".") |
(display ".") |
||
(newline)))</syntaxhighlight> |
(newline)))</syntaxhighlight> |
||
=={{header|Seed7}}== |
=={{header|Seed7}}== |
||
<syntaxhighlight lang=seed7>$ include "seed7_05.s7i"; |
<syntaxhighlight lang="seed7">$ include "seed7_05.s7i"; |
||
const string: dog is "Benjamin"; |
const string: dog is "Benjamin"; |
||
Line 1,505: | Line 1,402: | ||
writeln("The three dogs are named " <& dog <& ", " <& Dog <& " and " <& DOG <& "."); |
writeln("The three dogs are named " <& dog <& ", " <& Dog <& " and " <& DOG <& "."); |
||
end func;</syntaxhighlight> |
end func;</syntaxhighlight> |
||
=={{header|SenseTalk}}== |
=={{header|SenseTalk}}== |
||
As a People Oriented Programming language, SenseTalk's variable names are case-insensitive. |
As a People Oriented Programming language, SenseTalk's variable names are case-insensitive. |
||
<syntaxhighlight lang=sensetalk> |
<syntaxhighlight lang="sensetalk"> |
||
set dog to "Benjamin" |
set dog to "Benjamin" |
||
set Dog to "Samba" |
set Dog to "Samba" |
||
Line 1,517: | Line 1,413: | ||
{{out}} |
{{out}} |
||
<pre>There is just one dog named Bernie.</pre> |
<pre>There is just one dog named Bernie.</pre> |
||
=={{header|SETL}}== |
=={{header|SETL}}== |
||
<syntaxhighlight lang=pascal>dog := 'Benjamin'; |
<syntaxhighlight lang="pascal">dog := 'Benjamin'; |
||
Dog := 'Samba'; |
Dog := 'Samba'; |
||
DOG := 'Bernie'; |
DOG := 'Bernie'; |
||
Line 1,525: | Line 1,420: | ||
{{out}} |
{{out}} |
||
<pre>There is just one dog named Bernie</pre> |
<pre>There is just one dog named Bernie</pre> |
||
=={{header|Sidef}}== |
=={{header|Sidef}}== |
||
<syntaxhighlight lang=ruby>var dog = 'Benjamin'; |
<syntaxhighlight lang="ruby">var dog = 'Benjamin'; |
||
var Dog = 'Samba'; |
var Dog = 'Samba'; |
||
var DOG = 'Bernie'; |
var DOG = 'Bernie'; |
||
Line 1,533: | Line 1,427: | ||
{{out}} |
{{out}} |
||
<pre>The three dogs are named Benjamin, Samba, and Bernie.</pre> |
<pre>The three dogs are named Benjamin, Samba, and Bernie.</pre> |
||
=={{header|Simula}}== |
=={{header|Simula}}== |
||
Simula identifiers are case-insensitive, and the compiler will indignantly reject a program that tries to declare multiple variables with names differing only in case. (Same with ''key words'': Case of a character in Simula ''code'' generally only matters in [http://simula67.at.ifi.uio.no/Standard-86/chap_1.htm| a simple string or a character constant].) |
Simula identifiers are case-insensitive, and the compiler will indignantly reject a program that tries to declare multiple variables with names differing only in case. (Same with ''key words'': Case of a character in Simula ''code'' generally only matters in [http://simula67.at.ifi.uio.no/Standard-86/chap_1.htm| a simple string or a character constant].) |
||
<syntaxhighlight lang=simula>begin |
<syntaxhighlight lang="simula">begin |
||
text dog; |
text dog; |
||
dog :- blanks( 8 ); |
dog :- blanks( 8 ); |
||
Line 1,548: | Line 1,441: | ||
{{out}} |
{{out}} |
||
<pre>There is just one dog, named Bernie</pre> |
<pre>There is just one dog, named Bernie</pre> |
||
=={{header|Smalltalk}}== |
=={{header|Smalltalk}}== |
||
{{works with|GNU Smalltalk}} |
{{works with|GNU Smalltalk}} |
||
Line 1,554: | Line 1,446: | ||
Smalltalk's symbols are case sensitive. |
Smalltalk's symbols are case sensitive. |
||
<syntaxhighlight lang=smalltalk>|dog Dog DOG| |
<syntaxhighlight lang="smalltalk">|dog Dog DOG| |
||
dog := 'Benjamin'. |
dog := 'Benjamin'. |
||
Dog := 'Samba'. |
Dog := 'Samba'. |
||
Line 1,564: | Line 1,456: | ||
<pre>The three dogs are named Benjamin, Samba and Bernie</pre> |
<pre>The three dogs are named Benjamin, Samba and Bernie</pre> |
||
=={{header|SNOBOL4}}== |
=={{header|SNOBOL4}}== |
||
<syntaxhighlight lang=snobol4> DOG = 'Benjamin' |
<syntaxhighlight lang="snobol4"> DOG = 'Benjamin' |
||
Dog = 'Samba' |
Dog = 'Samba' |
||
dog = 'Bernie' |
dog = 'Bernie' |
||
Line 1,573: | Line 1,464: | ||
{{out}} |
{{out}} |
||
<pre>The three dogs are named Benjamin, Samba, and Bernie</pre> |
<pre>The three dogs are named Benjamin, Samba, and Bernie</pre> |
||
=={{header|Standard ML}}== |
=={{header|Standard ML}}== |
||
Standard ML is case sensitive. |
Standard ML is case sensitive. |
||
<syntaxhighlight lang=sml>let |
<syntaxhighlight lang="sml">let |
||
val dog = "Benjamin" |
val dog = "Benjamin" |
||
val Dog = "Samba" |
val Dog = "Samba" |
||
Line 1,585: | Line 1,475: | ||
{{out}} |
{{out}} |
||
<pre>The three dogs are named Benjamin, Samba, and Bernie.</pre> |
<pre>The three dogs are named Benjamin, Samba, and Bernie.</pre> |
||
=={{header|Stata}}== |
=={{header|Stata}}== |
||
Stata is case-sensitive. |
Stata is case-sensitive. |
||
<syntaxhighlight lang=stata>. local dog Benjamin |
<syntaxhighlight lang="stata">. local dog Benjamin |
||
. local Dog Samba |
. local Dog Samba |
||
. local DOG Bernie |
. local DOG Bernie |
||
. display "The three dogs are named $_dog, $_Dog, and $_DOG." |
. display "The three dogs are named $_dog, $_Dog, and $_DOG." |
||
The three dogs are named Benjamin, Samba, and Bernie.</syntaxhighlight> |
The three dogs are named Benjamin, Samba, and Bernie.</syntaxhighlight> |
||
=={{header|Swift}}== |
=={{header|Swift}}== |
||
<syntaxhighlight lang=swift>let dog = "Benjamin" |
<syntaxhighlight lang="swift">let dog = "Benjamin" |
||
let Dog = "Samba" |
let Dog = "Samba" |
||
let DOG = "Bernie" |
let DOG = "Bernie" |
||
println("The three dogs are named \(dog), \(Dog), and \(DOG).")</syntaxhighlight> |
println("The three dogs are named \(dog), \(Dog), and \(DOG).")</syntaxhighlight> |
||
=={{header|Tcl}}== |
=={{header|Tcl}}== |
||
Tcl variable names are case sensitive: |
Tcl variable names are case sensitive: |
||
<syntaxhighlight lang=tcl>set dog "Benjamin" |
<syntaxhighlight lang="tcl">set dog "Benjamin" |
||
set Dog "Samba" |
set Dog "Samba" |
||
set DOG "Bernie" |
set DOG "Bernie" |
||
Line 1,609: | Line 1,496: | ||
Which prints... |
Which prints... |
||
<pre>The three dogs are named Benjamin, Samba and Bernie</pre> |
<pre>The three dogs are named Benjamin, Samba and Bernie</pre> |
||
=={{header|True BASIC}}== |
=={{header|True BASIC}}== |
||
{{works with|QBasic}} |
{{works with|QBasic}} |
||
True Basic is case-insensitive |
True Basic is case-insensitive |
||
<syntaxhighlight lang=qbasic>LET dog$ = "Benjamin" |
<syntaxhighlight lang="qbasic">LET dog$ = "Benjamin" |
||
LET Dog$ = "Samba" |
LET Dog$ = "Samba" |
||
LET DOG$ = "Bernie" |
LET DOG$ = "Bernie" |
||
PRINT "There is just one dog, named "; dog$ |
PRINT "There is just one dog, named "; dog$ |
||
END</syntaxhighlight> |
END</syntaxhighlight> |
||
=={{header|UNIX Shell}}== |
=={{header|UNIX Shell}}== |
||
<syntaxhighlight lang=sh>dog="Benjamin" |
<syntaxhighlight lang="sh">dog="Benjamin" |
||
Dog="Samba" |
Dog="Samba" |
||
DOG="Bernie" |
DOG="Bernie" |
||
Line 1,628: | Line 1,511: | ||
The three dogs are named Benjamin, Samba and Bernie. |
The three dogs are named Benjamin, Samba and Bernie. |
||
=={{header|Ursa}}== |
=={{header|Ursa}}== |
||
Ursa names are case sensitive: |
Ursa names are case sensitive: |
||
<syntaxhighlight lang=ursa>> decl string dog Dog DOG |
<syntaxhighlight lang="ursa">> decl string dog Dog DOG |
||
> set dog "Benjamin" |
> set dog "Benjamin" |
||
> set Dog "Samba" |
> set Dog "Samba" |
||
Line 1,638: | Line 1,520: | ||
The three dogs are named Benjamin, Samba, and Bernie |
The three dogs are named Benjamin, Samba, and Bernie |
||
></syntaxhighlight> |
></syntaxhighlight> |
||
=={{header|VBA}}== |
=={{header|VBA}}== |
||
VBA is case sensitive case insensitive. The variable names 'dog', 'Dog' and 'DOG' can not co-exist. |
VBA is case sensitive case insensitive. The variable names 'dog', 'Dog' and 'DOG' can not co-exist. |
||
<syntaxhighlight lang=vb>Public Sub case_sensitivity() |
<syntaxhighlight lang="vb">Public Sub case_sensitivity() |
||
'VBA does not allow variables that only differ in case |
'VBA does not allow variables that only differ in case |
||
'The VBA IDE vbe will rename variable 'dog' to 'DOG' |
'The VBA IDE vbe will rename variable 'dog' to 'DOG' |
||
Line 1,652: | Line 1,533: | ||
End Sub</syntaxhighlight>{{out}} |
End Sub</syntaxhighlight>{{out}} |
||
<pre>There is just one dog named Bernie</pre> |
<pre>There is just one dog named Bernie</pre> |
||
=={{header|Wren}}== |
=={{header|Wren}}== |
||
Identifiers in Wren are case sensitive. |
Identifiers in Wren are case sensitive. |
||
<syntaxhighlight lang=ecmascript>var dog = "Benjamin" |
<syntaxhighlight lang="ecmascript">var dog = "Benjamin" |
||
var Dog = "Samba" |
var Dog = "Samba" |
||
var DOG = "Bernie" |
var DOG = "Bernie" |
||
Line 1,664: | Line 1,544: | ||
The three dogs are named Benjamin, Samba and Bernie. |
The three dogs are named Benjamin, Samba and Bernie. |
||
</pre> |
</pre> |
||
=={{header|XBS}}== |
=={{header|XBS}}== |
||
In XBS variable names are case-sensitive. |
In XBS variable names are case-sensitive. |
||
<syntaxhighlight lang=xbs>set dog="Benjamin"; |
<syntaxhighlight lang="xbs">set dog="Benjamin"; |
||
set DOG="Samba"; |
set DOG="Samba"; |
||
set Dog="Bernie"; |
set Dog="Bernie"; |
||
Line 1,675: | Line 1,554: | ||
The three dogs are named Benjamin, Samba and Bernie. |
The three dogs are named Benjamin, Samba and Bernie. |
||
</pre> |
</pre> |
||
=={{header|XLISP}}== |
=={{header|XLISP}}== |
||
XLISP is entirely case-insensitive. The user can decide whether to have the system print symbols, etc., in capitals or in lower case, by assigning to the variable <tt>*PRINT-CASE*</tt>. |
XLISP is entirely case-insensitive. The user can decide whether to have the system print symbols, etc., in capitals or in lower case, by assigning to the variable <tt>*PRINT-CASE*</tt>. |
||
<syntaxhighlight lang=xlisp>(SETQ DOG 'BENJAMIN) |
<syntaxhighlight lang="xlisp">(SETQ DOG 'BENJAMIN) |
||
(SETQ Dog 'SAMBA) |
(SETQ Dog 'SAMBA) |
||
(SETQ dog 'BERNIE) |
(SETQ dog 'BERNIE) |
||
Line 1,684: | Line 1,562: | ||
There is, in any event, only one dog. |
There is, in any event, only one dog. |
||
<pre>(THERE IS JUST ONE DOG NAMED BERNIE)</pre> |
<pre>(THERE IS JUST ONE DOG NAMED BERNIE)</pre> |
||
=={{header|XPL0}}== |
=={{header|XPL0}}== |
||
XPL0 is normally case-insensitive, so there is really just one dog named |
XPL0 is normally case-insensitive, so there is really just one dog named |
||
Line 1,693: | Line 1,570: | ||
switch (/c) is to detect inconsistent capitalizing of names such as |
switch (/c) is to detect inconsistent capitalizing of names such as |
||
Ascii and ASCII or CpuReg and CPUReg. |
Ascii and ASCII or CpuReg and CPUReg. |
||
=={{header|Yabasic}}== |
=={{header|Yabasic}}== |
||
Yabasic names are case sensitive: |
Yabasic names are case sensitive: |
||
<syntaxhighlight lang=yabasic> |
<syntaxhighlight lang="yabasic"> |
||
dog$ = "Benjamin" |
dog$ = "Benjamin" |
||
Dog$ = "Samba" |
Dog$ = "Samba" |
||
Line 1,703: | Line 1,578: | ||
print "The three dogs are named ", dog$, ", ", Dog$, " and ", DOG$ |
print "The three dogs are named ", dog$, ", ", Dog$, " and ", DOG$ |
||
end</syntaxhighlight> |
end</syntaxhighlight> |
||
=={{header|zkl}}== |
=={{header|zkl}}== |
||
<syntaxhighlight lang=zkl>var dog = "Benjamin", Dog = "Samba", DOG = "Bernie";</syntaxhighlight> |
<syntaxhighlight lang="zkl">var dog = "Benjamin", Dog = "Samba", DOG = "Bernie";</syntaxhighlight> |
||
{{out}} |
{{out}} |
||
<pre> |
<pre> |
||
Line 1,712: | Line 1,585: | ||
L(L("DOG","Bernie"),L("Dog","Samba"),L("dog","Benjamin")) |
L(L("DOG","Bernie"),L("Dog","Samba"),L("dog","Benjamin")) |
||
</pre> |
</pre> |
||
=={{header|ZX Spectrum Basic}}== |
=={{header|ZX Spectrum Basic}}== |
||
<syntaxhighlight lang=basic>10 LET D$="Benjamin" |
<syntaxhighlight lang="basic">10 LET D$="Benjamin" |
||
20 PRINT "There is just one dog named ";d$</syntaxhighlight> |
20 PRINT "There is just one dog named ";d$</syntaxhighlight> |
||
{{omit from|360 Assembly}} |
{{omit from|360 Assembly}} |
||
{{omit from|6502 Assembly|Depends on assembler. Some have a -nocase command line argument that ignores sensitivity of labels.}} |
{{omit from|6502 Assembly|Depends on assembler. Some have a -nocase command line argument that ignores sensitivity of labels.}} |
||
{{omit from|68000 Assembly}} |
|||
{{omit from|8051 Assembly}} |
{{omit from|8051 Assembly}} |
||
{{omit from|8080 Assembly}} |
{{omit from|8080 Assembly}} |
||
{{omit from|8086 Assembly}} |
{{omit from|8086 Assembly}} |
||
{{omit from|68000 Assembly}} |
|||
{{omit from|AArch64 Assembly}} |
{{omit from|AArch64 Assembly}} |
||
{{omit from|ARM Assembly}} |
{{omit from|ARM Assembly}} |