Everything2
Near Matches
Ignore Exact
Full Text
Everything2

my

"my" is also a: user

created by RRaLeX

(thing) by ClockworkGrue (8.7 mon) (print)   ?   (I like it!) Tue Mar 13 2001 at 23:22:16

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.


(idea) by Frater 219 (5 y) (print)   ?   (I like it!) 1 C! Wed Mar 14 2001 at 0:16:09

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.


(definition) by Webster 1913 (print) 1 C! Wed Dec 22 1999 at 1:21:10

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.


printable version
chaos

M&uuml; Depression is a good thing mine Everyone is under surveillance!
Paucispiral patterns begin to reveal themselves It can't rain all the time local
One of the most irritating things that can happen when talking Mariposa lily America and incest: A society under the looking glass Block
June 14, 2008 Some Kind of Wonderful Forenamed I still find strands of her hair in bed
July 6, 2000 Filiety lick ass
lexical scope yours Perl as a functional language I
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.
  Epicenter
Login
Password

password reminder
register

Everything2 Help

Cool Staff Picks
Nodes to live by:
Against you I will fling myself, unvanquished and unyielding, O Death!
I don't remember what life was like when I was seven. I like the taste of air. What should I do?
Oxford English Dictionary
It's only love: at the end of the day, there are still thunderstorms and sunsets
How to pick up women
eternal recurrence
node
fried rice
At the front with Dylan's army
West Side Story
Abats in Provence
History of the POW/MIA Bracelet
Zippo
New Writeups
Ctrl Y
cognitive dissonance(fiction)
SharQ
Gone Baby Gone(review)
halfWit
If I could, I'd title this "Freedom"(thing)
Roninspoon
Airline Hero(thing)
Ktistec
Why Women Are Always Cold(person)
doctor wilson
Drug policy reform(thing)
tejasa
Easy Raspberry Cheesecake(recipe)
Joysim
Drug policy reform(idea)
aneurin
Tyburn(place)
niruena
Boiling to death(idea)
artman2003
summer(thing)
doctor wilson
The Silver City and the Silent Sea(log)
Dreamvirus
The Silver City and the Silent Sea(poetry)
Aerobe
A nihilist's soulmate(poetry)
BookReader
Soup, of the green variety(recipe)
This affordable entertainment brought to you by The Everything Development Company