Quantcast
Channel: Cemetech
Viewing all articles
Browse latest Browse all 75829

Other & Upcoming Projects :: RE: jsTIfied 1.0 Release Candidate 1

$
0
0
Author: elfprince13
Posted: 17 Oct 2012 12:06:57 am (GMT -5)

AHelper wrote:
Does js have function pointers? That can solve it.

I think it does, and this seems reasonable. Instead of an if, have a 2 entry array of function references, and call it with


Code:

read_behavior[!(boolean && test || condition || here)](reference,to,necessary,state,here);


A switch statement could be used to do the same thing inline, which sheds some overhead if the Javascript interpreter is smart enough to turn that into a jump table instead of a conditional.
_________________
StickFigure Graphic Productions || VSHI: Vermont Sustainable Heating Initiative




Viewing all articles
Browse latest Browse all 75829

Latest Images

Trending Articles



Latest Images