In general, the semantics of the Scala Native language are the same as Scala on the JVM. However, a few differences exist, which we mention here.
NUMERALS = [
'zero',
'one',
'two',
...
]
def numeral2number(numeral):
return NUMERALS.index(numeral.lower)
NUMERALS = {
'zero': 0,
'one': 1,
'two': 2,
...
}
def numeral2number(numeral):
return NUMERALS.get(numeral.lower)