[POLL] Typing elements within a Type
- Posted by Peter Robinson <indorlaw at yahoo.?om.a?> Aug 29, 2007
- 586 views
Hello all The next poll is presented below. There is no strict time limit on the poll. You can argue as long as you want, but please do so in a different thread from this POLL thread. If you want to make sure I allow enough time, just say clearly in this thread what you want (and post your arguments elsewhere). Votes in the poll are limited to the specific questions asked. 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 2. Regardless of your answer to the previous question:- (a) which variation do you prefer? {ANSWER A1 or B1] (b) would you support the introduction of both together? [ANSWER YES OR NO] 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 4. Regardless of your answer to the previous question:- (a) which variation do you prefer? {ANSWER A2 or B2] (b) would you support the introduction of both together? [ANSWER YES OR NO] 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] 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? COMMENTS: The questions have been derived from a thread started by Salix on 19/8/07 entitled "Type - Start Again". Since that thread, a poll has supported the introduction of syntax like the following (though not yet implemented): sequence of integer sequence of sequence of integer If introduced, such syntax could be available in the examples either in the parameter of the type or in the field block. E.g. type customer( sequence of sequence x ) -- etc -- OR type customer( sequence x ) fields: sequence of integer x[1] -- or equivalent for variation B. -- etc This may be relevant to your consideration of the questions. Regards Peter Robinson