Does anyone know how I could write a function that could create other functions using the contents of a variable for that name?
Here is a basic example of what I am saying in php:
function nodefunctioncreator()
{
for ($i =1, $i < 10, $i++)
{
$newfunctionname = "Node".$i;
function $newfunctionname()
{
//code for each of the functions
}
}
}
Does anyone know a language that would allow me to do this?
source
share