syntax - Specman e: When colon equal sign ":=" should be used? -


i saw in specman e code example use of := (colon-equal sign), e.g.:

var regs_type := rf_manager.get_exact_subtype_of_instance(graphics_regs); 

when , why should use := ? thank help.

the := means declare variable of type expression on right returns , assign value. basically, in example, function get_exact_subtype_of_instance(...) returns value of type rf_struct. regs_type variable declared type.

this code equivalent (but shorter than):

var regs_type : rf_struct = rf_manager.get_exact_subtype_of_instance(graphics_regs); 

this syntax particularly helpful when casting:

 var foo := some_struct.as_a(foo some_struct_type); 

Comments

Popular posts from this blog

java - Oracle EBS .ClassNotFoundException: oracle.apps.fnd.formsClient.FormsLauncher.class ERROR -

c# - how to use buttonedit in devexpress gridcontrol -

nvd3.js - angularjs-nvd3-directives setting color in legend as well as in chart elements -