10_cndtnl_struct

10_cndtnl_struct - Introduction to Computers and...

Info iconThis preview shows pages 1–5. Sign up to view the full content.

View Full Document Right Arrow Icon
Introduction to Computers and Programming Lecture 10 Recap relational operators are defined number Prof. I. K. Lundqvist Reading: FK pp. 175-182, 193-194, 347-353 Sept 24 2003 • User defined types –Sca lar types • Ordered • Each value of a discrete type has a position – Operations on scalar types –Sub-types –Enumerat ion types – Derived types •Packages –Procedures
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Scope of Declarations point? subprogram that contains it Visibility procedure P is X : Integer; procedure Q is begin X := 2 ; P.X := 3 end Q; begin Q; end ; A declaration can be hidden from direct visibility, but not hidden from all visibility, and can be accessed using selector syntax: • Where does a given declaration apply? • What declarations apply at a given • Scope of a declaration – From where it is made, to the end of the X : Integer; -- hides outer declaration -- local decl. directly visible ; -- global decl. Visible, -- but not directly
Background image of page 2
Visibility type T is (A, B, C, D); procedure P (X : T ); type T1 T; procedure P (X : T1 ); once an inherited declaration is overridden, there is no way to name it: Example 1 with TEXT_IO; use TEXT_IO; 2 3 procedure main is 4 5 length : constant := 4; 7 num : INTEGER; 8 9 10 procedure in INTEGER) is 11 13 14 begin 16 end one; 17 18 is new -- inherited P is visible -- inherited P is hidden from all visibility Some declarations are hidden from all visibility, in particular 6 str : string (1. .length); one (num, len : 12 str : string (1. .10); -- one 15 . .. . .. . .. . ..
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
19 X, Y : FLOAT; 20 21 22 procedure in INTEGER) is 23
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 01/28/2012 for the course AERO 16.01 taught by Professor Markdrela during the Fall '05 term at MIT.

Page1 / 12

10_cndtnl_struct - Introduction to Computers and...

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online