Talk:Call a function: Difference between revisions

→‎Operators: are truly functions in Perl 6
m (Operators may be outside the scope of this task)
(→‎Operators: are truly functions in Perl 6)
Line 27:
 
Operators are generally a separate concept from functions (and outside the scope of this task, unless they are called in the same way as functions, can be used in place of functions, or are needed to demonstrate a method of invoking a function). I notice that the perl6 examples contain explanations relating to operators. I don't know perl6, but presumably, these need to be extracted and moved to a task that describes operators and their utilization. [[User:Markhobley|Markhobley]] 18:21, 17 July 2011 (UTC)
:That is the point. In Perl 6 all operators <i>are</i> functions. They can be called in the same way as functions, can be used in the place of functions, and as such are needed to demonstrate a method of invoking a function. Just because operators are <i>generally</i> a separate concept in other languages doesn't make it specifically true in Perl 6. The true name of the binary addition operator is <tt>infix:<+></tt>, and that can be used anywhere any other function name can be used. The fact that the very same routine can also be called as an infix operator does not change the fact that it is fundamentally a function call. And the whole point of this task is to show all the ways you can call a function, not just one particular way that is already well documented in other tasks. So I will resist strongly the suggestion that we pretend one of Perl 6's fundamental unifying principles isn't there, when that is precisely one of the things that makes Perl 6 different from other languages, and should be documented right here. --[[User:TimToady|TimToady]] 00:48, 18 July 2011 (UTC)
Anonymous user