Jump to content

Talk:Call a function: Difference between revisions

m
Hey, I found some notes entitled "Metaoperators".
(if an operator is a function, can it be redefined?)
m (Hey, I found some notes entitled "Metaoperators".)
Line 26:
: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)
::Ok, cheers Tim. If that is the case, then I agree it was right to document it here. Like I say I don't know the language. Out of interest, if an operator is a function, can it be redefined? Is there an example of say, a redefinition of an addition function that is used for the addition operator? I plan to learn Perl 6 in future, when the compiler rolls down into Debian stable. [[User:Markhobley|Markhobley]] 06:34, 18 July 2011 (UTC)
:::Hey, I found some notes entitled "Metaoperators", that explains this operator/function stuff. Cheers all. [[User:Markhobley|Markhobley]] 06:42, 18 July 2011 (UTC)
Cookies help us deliver our services. By using our services, you agree to our use of cookies.