First-class function: Difference between revisions

Content deleted Content added
m Reverted edits by 187.19.130.69 (talk) (HG) (3.4.10)
Undid revision 1131781906 by 24.20.9.123 (talk)
Line 199:
| [[Python (programming language)|Python]] || {{yes}} || {{yes}} || {{yes}} || {{partial|Expressions only}} || {{yes}} || {{yes|2.5}}<ref>{{Cite web|url=https://docs.python.org/whatsnew/2.5.html#pep-309-partial-function-application|title=What's New in Python 2.5 — Python 3.10.0 documentation}}</ref> || (see below)
|-
| [[Ruby (programming language)|Ruby]] || {{yespartial|Syntax}} || {{yespartial|Syntax}} || {{no|Unscoped}} || {{yes}} || {{yes}} || {{yespartial|1.9}} || Methods must be converted to procs (boundsee methodsbelow)
|-
| rowspan=6 | Other languages
Line 222:
: Explicit partial application with <code>[https://docs.python.org/library/functools.html#functools.partial functools.partial]</code> since version 2.5, and <code>[https://docs.python.org/library/operator.html#operator.methodcaller operator.methodcaller]</code> since version 2.6.
; Ruby
: The identifier of a regular "function" in Ruby (which is really a method) cannot be used as a value or passed. It must first be retrieved into a <code>Method</code> or <code>Proc</code> object to be used as first-class data. The syntax for calling such a function object differs from calling regular methods.
: Nested method definitions do not actually nest the scope.
: Explicit currying with <code>[http://www.ruby-doc.org/core-1.9.3/Proc.html#method-i-curry]</code>.