3 ms·
Learning Scala in small bites
- joe_the_user 17y agoIs there a reason the variables in the first example are titled 'x1' through 'x13'? Seems strange and undesirable compared even pseudo-meaning variable names. As another post mentioned, sample code lives forever but this particular coding style isn't what I would to see sticking around.
- aschobel 17y agoI agree that it seems like an odd practice, could be a mental artifact from using the scala interpreter. When you create objects in the interpreter w/o a name it is starts enumerating at res0. Welcome to Scala version 2.7.5.final (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_15). Type in expressions to have them evaluated. Type :help for more information. scala> "hello" res0: java.lang.String = hello scala> "world" res1: java.lang.String = world
- fadmmatt 17y agoThanks for pointing that out. I don't remember why I did it that way. I changed them to more sensible variable names.