Naming conventions: Difference between revisions

no edit summary
(Scala contribution added.)
No edit summary
Line 792:
print(v)
end</lang>
 
=={{header|M2000 Interpreter}}==
 
M2000 is like Basic, identifiers are case insensitive.
Labels although are case sensitive
We have to use $ as last character in names for anything return string. We can use % as last character for integers (as values, because under it maybe double or something else, depends of the first value we assign it).
 
Groups which return strings also have to use $ in names, but these have two names as in this example:
<lang M2000 Interpreter>
Class Alfa$ {
Private:
myValue$
Public:
Set {
Read .myValue$
}
Value {
=.myValue$
}
Module Doit {
Function TwoChars$(A$) {
=Left$(Left$(a$,1)+Right$(a$,1)+"??",2)
}
Print TwoChars$(.myValue$)
Dim A$(3)
A$(0)="zero","one","two"
Print A$(1)
k$=Lambda$ A$() (x) -> {
if x>0 and x<3 then {=A$(x)} else =A$(0)
}
Print k$(2)
Dim A$()
Print Len(A$())=0
Print k$(2)="two"
}
}
A$=Alfa$()
Module CheckIt(&B$) {
Input "name:", B$
B.Doit
}
Checkit &A$
Print A$
</lang>
 
 
=={{header|Mathematica}}==
Anonymous user