Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8735167
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T09:59:24+00:00 2026-06-13T09:59:24+00:00

In Play2 documentation, I find things like this: def LoggingAction(f: Request[AnyContent] => Result): Action[AnyContent]

  • 0

In Play2 documentation, I find things like this:

def LoggingAction(f: Request[AnyContent] => Result): Action[AnyContent] = {
  Action { request =>
    Logger.info("Calling action")
    f(request)
  }
}

Is it a convention in Scala to use an uppercase first letter for definitions that can be called with { ... } because of curryfication? Or is it just a Play2’s choice?

I’m talking about both LoggingAction and Action.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T09:59:25+00:00Added an answer on June 13, 2026 at 9:59 am

    First, as @pedrofurla points out in his comment, currying has nothing to do with what you’re seeing here. Second, while LoggingAction and Action behave similarly from the perspective of an API user, it’s important to distinguish between them.

    Action is capitalized by convention because it is the name of a class and a companion object. This may not be obvious from the context since it appears that Action is being called like a function, but what’s really going on is more subtle. Since the Action companion object defines an apply method,

    Action(arg)
    

    is treated as shorthand for

    Action.apply(arg)
    

    That is, what looks like a function invocation is really just an invocation of the Action object’s apply method. In cases like this where a method takes a single function as an argument it’s common to use braces:

    Action apply { request =>
       // ...
    }
    

    LoggingAction, on the other hand, is a method. Uppercase method names are not conventional and could potentially confuse users of the API. However, it may be appropriate in cases like this one, since it creates consistency throughout the API. Generally, the intent of such usage is to make it clear that the call is creating some thing (here, a logging action) rather than doing something. A rough rule of thumb is that a capital letter indicates a noun, while a lowercase indicates a verb.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I can't seem to find any documentation saying this is possible, but Google turned
From the play2's doc: http://www.playframework.org/documentation/2.0/ScalaForms , there is a sample code: val loginForm =
I wondering is there an equivalent of this feature from play framework http://www.playframework.org/documentation/2.0/JavaAsync Basicly
I haven't be able to find a resource explaining if this is possible at
I feel really silly to not be able to find this answer anywhere. Could
This should be the classic simple error which I can't really find.. I am
I was trying to get some info from documentation, but it seems that it
I haven't been able to find anything on this so maybe someone can give
I cannot find any documentation on error codes with regard to Android. I am
The play documentation says that « By default, [the Assets] controller provides caching, ETag,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.