Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^3: Attempting to use $_ in "sub" inside "map"

by tobyink (Canon)
on May 10, 2021 at 14:30 UTC ( #11132339=note: print w/replies, xml ) Need Help??


in reply to Re^2: Attempting to use $_ in "sub" inside "map"
in thread Attempting to use $_ in "sub" inside "map"

In languages without lexically scoped variables or something approximating them, there's not really any such thing as a closure. You can still have first-class functions (i.e. coderefs); they just have no need to close over anything.

  • Comment on Re^3: Attempting to use $_ in "sub" inside "map"

Replies are listed 'Best First'.
Re^4: Attempting to use $_ in "sub" inside "map"
by LanX (Sage) on May 10, 2021 at 14:40 UTC
    > first-class functions (i.e. coderefs)

    Doesn't equal closures. OK PHP is using that terminology, but it's wrong ...

    ... anyway who's using PHP anymore ;-)

    > In languages without lexically scoped variables or something approximating them

    do you have an example for such a language with functions as first class objects?

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    Wikisyntax for the Monastery

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11132339]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (1)
As of 2021-10-23 03:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My first memorable Perl project was:







    Results (86 votes). Check out past polls.

    Notices?