Abstract

This chapter explains the EXPRESS pseudotypes and datatypes. You will also want to read about defined types and entity types, both of which are covered in Chapter 11. Datatypes represent domains of values. A domain is the set of possible values associated with an attribute, local variable or formal parameter. Datatype values can be operated upon as explained in Chapter 14. EXPRESS is fussy about the way datatypes are used. The datatypes are grouped this way: • Pseudo (Generic and Aggregate — see 10.1) • Simple (Integer, String, etc. — see 10.2) • Collection (Array, List, etc. — see 10.3) • Enumeration and Select (see 10.4 and 10.5). • Named (entities and defined types — Chapter 11) Then, the context in which a reference to a datatype is made will be • as the type of an attribute, • as the type of a local variable, • as the type of a formal parameter, or • as the underlying type of a defined type. At last, a summary of the datatypes that can be used in the different contexts is given in Table 10.1. Notice that pseudotypes can only be used as formal parameter types and, the enumeration and select types can only be used as the underlying types of defined types. Pseudotypes are used only as the types of the formal parameters of functions and procedures. They can be regarded as templates into which various specific types can be placed. See 11.5.1 for more about formal parameters. The domain of a generic pseudotype is every conceivable value. When a procedure or function that has a generic type parameter is invoked it will accept any kind of actual parameter. No questions asked! Functions or procedures that use formal parameters typed as generic must be prepared to deal with whatever actual stuff is tossed its way and any operations performed on them will depend on the specific type of the actual parameter. Generic parameters should never be used when a more specific type can be used instead. In any event, the mechanics involved in writing an algorithm that is capable of handling every possible input value are tricky. The message is: Don’t use generic parameters unless you simply have to.

Full Text
Paper version not known

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call

Disclaimer: All third-party content on this website/platform is and will remain the property of their respective owners and is provided on "as is" basis without any warranties, express or implied. Use of third-party content does not indicate any affiliation, sponsorship with or endorsement by them. Any references to third-party content is to identify the corresponding services and shall be considered fair use under The CopyrightLaw.