[POLL RESULT] Typing within a Type
Hi all
Here are the results of the poll "Typing elements within a Type".
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
RESULT Q1:
YES = 5
NO = 6
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]
RESULT 2(a):
A1 = 3
B1 = 8
RESULT 2(b)
YES = 1
NO = 10
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
RESULT 3:
YES = 8
NO = 2
ABSTENTION = 1
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]
RESULT 4(a)
A2 = 3
B2 = 8
RESULT 4(b)
YES = 1
NO = 10
5. Regardless of your previous answers, if syntax with naming were introduced,
would you prefer the elements in an object declared 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]
RESULT 5:
a = 6.5
b = 3.5
abstention = 1
PS. Matt voted for both.
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?
RESULT 6:
a = 5
b = 5
abstention = 1
Thanks to all who contibuted.
Cheers
Peter Robinson
|
Not Categorized, Please Help
|
|