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 1052517
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T17:06:21+00:00 2026-05-16T17:06:21+00:00

I come from a Python background and really like the power of Python Decorators.

  • 0

I come from a Python background and really like the power of Python Decorators.

Does Lua support Decorators?

I’ve read the following link but it’s unclear to me: http://lua-users.org/wiki/DecoratorsAndDocstrings

UPDATE

Would you also mind given an example how how to implement it in Lua if it’s possible.

  • 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-05-16T17:06:21+00:00Added an answer on May 16, 2026 at 5:06 pm

    The “decorators” documented at the page you quote (and used for example in this one to add type-checking) have little to do with Python’s oddly-named “decorator syntax” for a specific way to apply a higher-order function (HOF) — rather, the decorators described and used in Lua’s wiki are a Lua idiom to support an application of the Decorator Design Pattern to Lua functions (by holding “extra attributes” — such as docstrings, typechecking functions, etc — in separate global tables).

    Lua does support HOFs (I’m not sure if you can re-bind a function name to the result of applying a HOF to the function, but you can easily, as the wiki pages show, use an anonymous “original function” and only bind a name to the HOF’s result with that anon function as the arg).

    Python’s “decorator syntax” syntax sugar is nice (and, to my surprise, seems to have increased the use of HOFs by most Pythonistas by an order of magnitude!-), but there’s nothing intrinsic or essential about them that you can’t do in Lua (and Lua’s anonymous functions run circle around Python’s goofy, limited lambda anyway — just like in Javascript, they have essentially the same power, and pretty much the same syntax, as a “normal” named function!-).

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

Sidebar

Ask A Question

Stats

  • Questions 529k
  • Answers 529k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer The option I went with was to implement IDataErrorInfo explicitly… May 16, 2026 at 11:13 pm
  • Editorial Team
    Editorial Team added an answer The proper Rails way to do this would be to… May 16, 2026 at 11:13 pm
  • Editorial Team
    Editorial Team added an answer It's probably easy to solve your problem using output buffering.… May 16, 2026 at 11:12 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I am following a book to learn C++ (come from a python background). I've
I come from a background of C, Fortran, Python, R, Matlab, and some Lisp
I come from a PHP background and would like to know if there's a
Though I come from a purely PHP background on the web development side of
I come from a background where I normally create one file per class. I
I come from a statically/strongly typed language background (java), and I recently started to
I have just started learning python and am getting caught up. I come from
My question does not really have much to do with sqlalchemy but rather with
How can I launch a new Finder window (or Explorer on Win) from python
Obs: I know lists in python are not order-fixed, but think that this one

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.