YouTip LogoYouTip

Partially Applied Functions

Scala Partially Applied Functions | Tutorial

Tutorial --

Scala Tutorial

Scala TutorialScala IntroductionScala Installation and Environment ConfigurationScala Basic SyntaxScala Data TypesScala Literals Scala Escape Characters Scala VariablesScala Access ModifiersScala OperatorsScala IF...ELSE StatementsScala LoopsScala Methods and FunctionsScala ClosuresScala StringsScala ArraysScala CollectionScala IteratorScala Classes and ObjectsScala TraitScala Pattern MatchingScala Regular ExpressionsScala Exception HandlingScala ExtractorScala File I/O

Scala Loops

Scala Closures

Scala Partially Applied Functions

Image 3: Scala Functions Scala Functions

Scala partially applied functions are expressions where you do not need to provide all the parameters required by the function; you only need to provide some, or none, of the required parameters.

In the following example, we print log information:

import java.util.Date

object Test { 
   def main(args: Array) { 
      val date = new Date 
      log(date, "message1" ) 
      Thread.sleep(1000)
← Currying FunctionsAnonymous Functions β†’