> days_in_month 12: > 31 > 30 > 28 > 31 > ... > 30 > 31 > assign $days days_in_month[$month] > > This program consists of 2 operations (table jump and assignment) > and 12 values. This makes a memory consumption of 12+2 = 14
Along the same lines, you could populate the table somewhat sparsely, and goto a modulo key. You could even put functions in it: setreturn $endoftable hash month goto -0 -1 -2 jan.-> 3: setvjmp janfun -4 -5 apr.-> 6: setvjmp aprfun $endoftable Sweet! Are you stack-ops? -- http://mail.python.org/mailman/listinfo/python-list