Solve a Debate

Wolfgang Draxinger wdraxinger at darkstargames.de
Sun Feb 17 17:59:14 EST 2008


castironpi at gmail.com wrote:

>> days_in_month 12:
>> 31
>> 30
>> 28
>> 31
>> ...
>> 30
>> 31
>> assign $days days_in_month[$month]
> 
> This is missing
> days_in_month 12:
> 31
> break
> 30
> break

What shall there be missing? breaks? You noticed, that I defined
some artificial architecture on purpose. "days_in_month 12:"
tells it, that the next 12 blurps are tabular data, that can be
indexed. If the "interpreter" hits the line "days_in_month 12:"
it will unconditionally jump 12 instructions forward, where it
hits the assign instruction, which assignes a value from a table
by an index given into a variable. We're not talking about
Python here.

I introduced this "architecture" just to showcase that even in
the most "optimal" situation, where special RISC operations are
avaliable a LUT is still better suited.

Wolfgang Draxinger
-- 
E-Mail address works, Jabber: hexarith at jabber.org, ICQ: 134682867




More information about the Python-list mailing list