Re: New switch/case idea
- Posted by jimcbrown (admin) Apr 08, 2009
- 1667 views
kinz said...
Dear Devs,
Let's see one specific example of switch, used in compile.e :
Why not to code this strongly switching, not cascadeing, part just as:
sequence routine_name routine_name = { "opAND_BITS", -- AND_BITS "opAND", -- AND "opAPPEND", -- APPEND "opARCTAN", -- ARCTAN "opASSIGN_I", -- ASSIGN_I "opASSIGN_OP_SLICE", -- ASSIGN_OP_SLICE } for i=1 to length(routine_name) do operation[i] = routine_id(routine_name[i]) end for
Just curious... Looks just as reordering and renameing of opnames ...
Anyway you reorder and rename them by hands in switch blok code, no?
kinz
This is what the old version of the code (before switch was added) used to do.
This was changed