Re: New switch/case idea

new topic     » goto parent     » topic index » view thread      » older message » newer message
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

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu