Function prototype: Difference between revisions

Content added Content deleted
Line 618: Line 618:


=={{header|Julia}}==
=={{header|Julia}}==
Julia does not need or use function prototypes in general. Generic functions are further specialized as to argument type and return type during just-in-time compilation if required. Julia can protoype its functions for passing its fuctions to extrenal languages such as C with the @cfunction macro:
Julia does not need or use function prototypes in general. Generic functions are further specialized as to argument type and return type during just-in-time compilation if required. However, when interacting with other languages such a C which use function prototypes, Julia can prototype its functions for passing its functions to external languages with the @cfunction macro:


<lang julia>julia > function mycompare(a, b)::Cint
<lang julia>julia > function mycompare(a, b)::Cint