Talk:First-class functions/Use numbers analogously: Difference between revisions
m →Whats's the Point?: code... |
|||
Line 6: | 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) |
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) |
: 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 |
I stumbled upon this page, while looking for Algol-68 code using first-class function, and was quite puzzled by the numerous pink boxes sta ting the code example is incorrect and has to be fixed, although there seems to be nothing wrong with the code. I would have expected to find some sort of explanation of these boxes here, as to what exactly is perceived to be wrong, but none was found. Like [[User:Psly4mne|Psly4mne]] I don't quite see the point in this page. Could someone please explain what is going on here? --[[User:Lasse Hillerøe Petersen|Lasse Hillerøe Petersen]] ([[User talk:Lasse Hillerøe Petersen|talk]]) 21:15, 24 September 2014 (UTC) |
||
: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) |
: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) |
Latest revision as of 00:41, 18 October 2022
It seems redundant to duplicate the First-class functions code here. --glennj 17:37, 7 August 2009 (UTC)
- Maybe, but it depends on how you want to make your comparison. I note that some have just put a link to FcF; it would be nice to make their own comments too, as i would like the page to show a comparison rather than leave the comparison wholly to the reader. --Paddy3118 18:28, 7 August 2009 (UTC)
- Fair enough --glennj 19:13, 7 August 2009 (UTC)
Whats's the Point?
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. --Psly4mne 19:04, 6 December 2009 (UTC)
- Howso? --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.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 sta ting the code example is incorrect and has to be fixed, although there seems to be nothing wrong with the code. I would have expected to find some sort of explanation of these boxes here, as to what exactly is perceived to be wrong, but none was found. Like Psly4mne I don't quite see the point in this page. Could someone please explain what is going on here? --Lasse Hillerøe Petersen (talk) 21:15, 24 September 2014 (UTC)
- 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. --Paddy3118 (talk) 21:47, 24 September 2014 (UTC)