Talk:First-class functions/Use numbers analogously: Difference between revisions
Content deleted Content added
m →Whats's the Point?: code... |
|||
Line 6:
What is the point of this exercise? This doesn't really demonstrate anything interesting about a language's handling of numbers or functions, and it isn't related to a real-world task. --[[User:Psly4mne|Psly4mne]] 19:04, 6 December 2009 (UTC)
: Howso? --[[User:Paddy3118|Paddy3118]] 16:18, 19 August 2010 (UTC)
: Here is how it can have a point, though the solutions are missing it. The solution should demonstrate generic operations such that multiplication works not only with numbers, but with functions and mixtures of numbers and functions. If we have f(x) and g(x) then the composition f x g gives us the function h such that h(x) = f(x) x g(x). In the ordered collections referred to in the problem statement, we can keep the expression x + y in expression form, as the body of a function. All the variables are bound, so e.g. x + y is a function of no arguments which can be called to force the value. Same with 1.0/(x + y). Zero-argument functions can force automatically under arithmetic, whereas functions requiring arguments compose. Something along those lines.[[User:Kazinator|Kazinator]] ([[User talk:Kazinator|talk]]) 00:41, 18 October 2022 (UTC)
I stumbled upon this page, while looking for Algol-68 code using first-class function, and was quite puzzled by the numerous pink boxes
:In the pink box it says they have failed to compare and contrast, as mentioned in the task description. Unfortunately, the template states fix the code, but in this case it should be fix the language example. You can also compare that example with others to also show what it lacks. --[[User:Paddy3118|Paddy3118]] ([[User talk:Paddy3118|talk]]) 21:47, 24 September 2014 (UTC)
|