vary([callingContext]){
genes = getGenes(callingContext)
genome = _vary(genes)
save(genome)
}
_vary(genes){
for (gene in genes){
selected = selectVariant(gene)
genome[gene] = selected
callingContext[gene] = selected
}
return genome
}
save(genome){
saveToCookie(genome)
saveToDatabase(genome)
}
This general structure of the code is true for manipulating all types of object currently implemented -- PHP vars, Javascript objects, CSS rules, HTML elements. My hope is that this stays true as new languages are added -- Python, Ruby... who knows what else.
No comments:
Post a Comment