Finding Functions by Name

[ Start > Finding Functions by Name ] [ Edit this Page | Show Page Versions | Show Raw Source ]


There are a number of ways to get a function by name, but it depends on where the function is located. The following is an incomplete list of techniques.

Based on a posting to the Pike mailing list by Grubba

  • Visible in any object:

obj[fun]

  • Visible in the current object:

this_object()[fun]

or

       this[fun]

or

       ::`[](fun, 2)

  • Visible in some lexically scoped object:

scope::this[fun]

  • In the current object including private and protected:

::`[](fun, 3)

  • Visible in the current program:

this_program::this[fun]

or

       ::`[](fun)

  • In the current program (including private and protected):

::`[](fun, 1)

  • efun:

all_constants[fun]

  • Module function:

master()->resolv(fun)

See Also

IndexingOverview


Powered by PikeWiki2

 
gotpike.org | Copyright © 2004 - 2009 | Pike is a trademark of Department of Computer and Information Science, Linköping University