Created
November 14, 2011 08:54
-
-
Save machisuji/1363559 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| object Hello extends App { | |
| val echo = new Echo with TcpConnection { | |
| val host = args.drop(1).headOption getOrElse "localhost" | |
| val port = args.drop(2).headOption.map(_.toInt) getOrElse 80 | |
| } | |
| val msg = args.headOption getOrElse "Hallo Welt!" | |
| Client.run(echo) { echo => | |
| val (text, letters) = echo.echo(msg) | |
| println("\"%s\" contains %d letters.".format(text, letters)) | |
| } | |
| } |
Author
Ich wusste garnicht, dass Scala nicht so schön sein kann. ;)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Ich wusste garnicht, dass Scala so schön sein kann :P