[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference azur::mcc

Title:DECmcc user notes file. Does not replace IPMT.
Notice:Use IPMT for problems. Newsletter location in note 6187
Moderator:TAEC::BEROUD
Created:Mon Aug 21 1989
Last Modified:Wed Jun 04 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:6497
Total number of notes:27359

1276.0. "The difference between SET and SET OF" by SWORD1::ES (Eugene Shvartsman) Mon Jul 22 1991 17:09

The title says it all.

Explanation and/or examples will be greatly appreciated.

BTW, same question in regards of SEQUENCE and SEQUENCE OF.

Thank you,
	Gene
T.RTitleUserPersonal
Name
DateLines
1276.1does this help?NAC::ENGLANDMon Jul 22 1991 18:5910
    SET and SEQUENCE mean virtually the same thing, they are basically
    analogous to a RECORD structure (or "C" struct).  The only difference
    is that the values in the SET can occur in any order, whereas the
    values in the SEQUENCE must occur in the order that the appear in
    the SEQUENCE definition.
    
    SET OF a-type means "an unordered series of values of a-type"
    
    SEQUENCE OF a-type means "an ordered series of values of a-type"
    
1276.2not yetSWORD1::ESEugene ShvartsmanTue Jul 23 1991 12:569
    .1
    
    Thank you, but you have answered the question: "What is the difference
    between SET and SEQUENCE?".
    
    My questions are: "What is the difference between SET and SET OF?" and
    "What is the difference between SEQUENCE and SEQUENCE OFF?".
    
    Gene
1276.3My turn!TOOK::GUERTINI do this for a living -- reallyTue Jul 23 1991 13:3138
    Here.  Let me try:
    
    A SET can contain an arbitrary collection of elements of DIFFERENT
    datatypes.
    
    A SET OF can contain an arbitrary collection of elements of the
    SAME datatype.
    
    A SEQUENCE contains an ORDER DEPENDENT collection of elements
    of DIFFERENT datatypes.
    
    A SEQUENCE OF contains an ORDER DEPENDENT collection of elements
    of the SAME datatype.
    
    Example of SET
    
    { apple, pear, 1, "Hello, world" } == { "Hello, world", 1, pear, apple }
    (Note that the SET values are the same, even though they are not in the
    same order)
    
    Example of SEQUENCE
    
    { 1, apple, pear, "Hello, world" } == { 1, apple, pear, "Hello, world" }
    (Note that the two SEQUENCE values must match EXACTLY in order to be
    the same)
    
    Example of SET OF
    
    { 1, 3, 5, 7 } == { 5, 3, 7, 1}
    (Note that the two SET OF values are considered the same)
    
    Example of SEQUENCE OF
    
    { "Matthew", "John", "Guertin" } <> { "John", "Matthew", "Guertin" }
    (Note that the two SEQUENCE OF values are NOT the same!)
    
    Does that make sense?
    -Matt.
1276.4Thank youSWORD1::ESEugene ShvartsmanTue Jul 23 1991 15:018
    Thank you, Matt. It has perfect sence to me, and that exactly what I've
    thought. I have to admit my fault that looking into the description of
    MSL syntax ot the beasts I have missed the difference between
    SET {base-type} and SET OF <base tape>. I've thought that SET is
    defined as SET <base-type> and hence my question.
    
    Thanks again,
    Gene