Scala: How to get access to my declared val? -
if declare val 1 how can access without changing name val 1?
val 1 = 1 def 1 = 1 print(1) // `1` should reference 1 declared above.
this not declare variable name 1:
val 1 = 1 what instead pattern matching - , result not useful.
try this, , you'll pattern match error:
def 1 = 2 val 1 = 1 variables in scala cannot have names consists of digits, or start digit. cannot declare variable name 1.
Comments
Post a Comment