In computer science, a prefix denoting a function coded locally by a programmer, especially for use as an example or a coding exercise.

For example, in the glut library of OpenGL there exists the function

glutSolidCube(<size>)

Which draws a cube with a side length of size. Non-user-defined functions are usually generalized to work in many situations at the cost of overhead testing for those special cases. If a programmer wanted to write their own version of the code, either for practice, or to stream-line the code to their specific purposes, cutting out the overhead, a common notation for this function might be

mySolidCube(<size>)

Computer Science text books are rife with myFunctions.

In Perl, my is an adjective modifying a newly-referenced variable. It causes the variable named to be lexically local to the surrounding BLOCK, instead of being global as is the default.

For instance, if you read a line into a new variable $line as such, the variable will be global:

$line = <STDIN>;
In order to cause this to be a local variable instead, you must do this:
my $line = <STDIN>;
Note that my has a completely different effect from the (somewhat confusingly-named) adjective local. my causes the modified variable to go out of lexical scope at the end of the BLOCK. local causes an otherwise global variable to carry a temporary local value for the remainder of the BLOCK.

You probably want to be using my, not local, so you get all the scope checking featurefulness.

My (?), a. & poss. pron. [OE. mi, fr. min. See Mine, and cf., for loss of n, A, a., An, a.]

Of or belonging to me; -- used always attributively; as, my body; my book; -- mine is used in the predicate; as, the book is mine. See Mine.

 

© Webster 1913.

Y'know, if you log in, you can write something here, or contact authors directly on the site. Create a New User if you don't already have an account.