Re: [POLL] Typing elements within a Type
- Posted by CChris <christian.cuvier at agricul?ure.gou?.fr> Aug 29, 2007
- 534 views
Peter Robinson wrote: > 1. Do you support the introduction of syntax in one of the following forms to > allow a programmer to declare the types of elements within a user-defined type > based on a sequence? > [ANSWER YES OR NO] > > Variation A1: > > type customer( sequence x ) > fields > integer x[1] > sequence x[2] > sequence x[3] > end fields > -- insert other code here > end type > > > Variation B1: > > type customer( sequence x ) > fields > integer -- x[1] is assumed > sequence -- x[2] is assumed > sequence -- x[3] is assumed > end fields > -- insert other code here > end type > NO > 2. Regardless of your answer to the previous question:- > > (a) which variation do you prefer? {ANSWER A1 or B1] > B1 > (b) would you support the introduction of both together? > [ANSWER YES OR NO] YES > > 3. Regardless of your previous answers, do you support the introduction of > syntax > of the same kind but with naming of elements, like this: > [ANSWER YES or NO] > > Variation A2: > > type customer( sequence x ) > fields > integer x[1] id > sequence x[2] name > sequence x[3] address > end fields > -- other code here > end type > > > Variation B2: > > type customer( sequence x ) > fields > integer id -- x[1] is assumed > sequence name -- x[2] is assumed > sequence address -- x[3] is assumed > end fields > -- other code here > end type > YES > 4. Regardless of your answer to the previous question:- > > (a) which variation do you prefer? {ANSWER A2 or B2] > B2 > (b) would you support the introduction of both together? > [ANSWER YES OR NO] > YES > 5. Regardless of your previous answers, if syntax with naming were introduced, > would you prefer the elements in an object declarded with this type to be > accessible > by:- [ANSWER a or b] > > (a) dot access e.g. customer_x.name; or > > (b) subscript/indexes e.g. customer_x[name] > a > 6. Regardless of your previous answers, if such syntax were introduced (with > or without naming), would you prefer it to imply: [ANSWER a or b] > > (a) length(x) = 3 -- the interpreter would enforce this > > -- or merely > > (b) length(x) >= 3? > b > Regards > Peter Robinson CChris