skip to main | skip to sidebar

this.getClass()

Monday, September 24, 2012

Syntactic Sugar

  class Person {
    def isst(essen : String) = 
      println("Hmm " + essen);
    
    def +(person : Person) = "Frust";
  };
  
  val thomas = new Person;
  thomas.isst("Zucker");
  thomas isst "Zucker"
  
  val horst = new Person;
  val monika = new Person;
  println(horst + monika);
Posted by tkr at 4:21 AM
Labels: Scala

No comments:

Post a Comment

Newer Post Older Post Home
Subscribe to: Post Comments (Atom)

Labels

  • Scala
  • DSL
  • AspectJ
  • Groovy
  • Java

Blog Archive

  • ▼  2012 (25)
    • ▼  September (25)
      • Structural Typing Zur Hilfe
      • Structural Food Typing
      • Pattern Matching Unpack
      • Pattern Matching Simplify
      • Pattern Matching Case Classes
      • Pattern Matching Cal
      • Pattern Matching Beverages
      • Pattern Matching Basics
      • Duck Typing
      • Case Classes
      • Closures
      • Schedule
      • Meassure Execution Time
      • Filter and Map
      • Brainteaser
      • Twice
      • Group By Task
      • Call with Retry
      • Syntactic Sugar
      • Functions, Params and Return
      • GroupBy, ForEach and Case
      • Reduce, Min, MinBy, Sum and MkString
      • Type Inference and Generics
      • Classes and Methods
      • Vals, Vars, Attributes and Contructors
  • ►  2008 (9)
    • ►  December (1)
    • ►  May (1)
    • ►  March (3)
    • ►  February (4)