Reply to function "attributes"

Your name:

Reply:


Posted by Jon Slaughter on 06/07/07 00:56

is there any way to simply add an attribute like feature to a
function/method definition?

say I create a function like

function Test()
{

//....
}

but I want to assign a probability to it in the definition itself... maybe
something like

function Test()
{
static $probability = 0.234321;
//....
}

Now is there any way that I can get the probability from the function? I'm
using function pointers to call the functions in a random way. Essentially
having a list of functions that have assigned probabilities and calling them
based on that probability(I don't want to really seperate the probability
from the definition.


Ultimately it would be nice to extend the syntax to handle a new keyword
like

function Test():[Probability=0.123421]
{

}

or something like that but I know thats not going to happen.

Thanks,
Jon

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация