>sets in modula 
Author Message
 >sets in modula

        Reply to:   RE>>sets in modula

Quote:

>   Unfortunately, Modula-2 still lacks a set complement operator.  As far
> as I can tell, even the ISO standard will not correct this oversight.

  In the fourth draft of the ISO standard, the "-" operator was defined as a
binary operator only.  There has been no move for any change.
Whether this is an oversight or not is a matter for debate.  The ISO
committee has never dealt with the matter to my recollection.  Perhaps
Herr Wirth would respond by saying "If it is an oversight, it is a
deliberate one."  For my part, I use sets relatively infrequently, and have
not missed set complement.

Rick Sutcliffe
Canadian Chair, WG13 (Modula-2 standard)



Wed, 14 Sep 1994 05:29:42 GMT  
 >sets in modula

Quote:

>>   Unfortunately, Modula-2 still lacks a set complement operator.  As far
>> as I can tell, even the ISO standard will not correct this oversight.

>  In the fourth draft of the ISO standard, the "-" operator was defined as a
>binary operator only.  There has been no move for any change.

  Using the ~ as a notation for complement would be a better choice than
re-using the "-", but unfortunately it was defined to mean the same thing
as NOT, thereby wasting a perfectly good character.

Quote:
>Whether this is an oversight or not is a matter for debate.  The ISO committee
>has never dealt with the matter to my recollection.  Perhaps Herr Wirth would
>respond by saying "If it is an oversight, it is a deliberate one."

  I wouldn't be surprised.  Wirth always did seem to have a bit of
an attitude problem.

Quote:
>  For my part, I use sets relatively infrequently, and have
>not missed set complement.

  I think it would be more useful than set difference.


Thu, 15 Sep 1994 18:19:26 GMT  
 >sets in modula

Quote:

>        Reply to:   RE>>sets in modula

>>   Unfortunately, Modula-2 still lacks a set complement operator.  As far
>> as I can tell, even the ISO standard will not correct this oversight.

>  In the fourth draft of the ISO standard, the "-" operator was defined as a
>binary operator only.  There has been no move for any change.
>Whether this is an oversight or not is a matter for debate.  The ISO
>committee has never dealt with the matter to my recollection.  Perhaps
>Herr Wirth would respond by saying "If it is an oversight, it is a
>deliberate one."  For my part, I use sets relatively infrequently, and have
>not missed set complement.

It just came in my mind...  I haven't written in MODULA-2 for a while,
so either the syntax or the way I've defined the 'complement' procedure can
be wrong, but that should work (somehow):

TYPE
      T = SET OF <something>;

PROCEDURE complement(S: T): T;
BEGIN
   RETURN T {MIN(T)..MAX(T)} - S;
END complement;

The idea behind this is simple: the complement of a given set is the set
difference of the iniverse and the given set.  Easy, isn't it?  

Quote:

>Rick Sutcliffe
>Canadian Chair, WG13 (Modula-2 standard)

Witold

------



------

C:  A middle-level programming language which combines the power
    of assembly language with the readability of assembly language.



Fri, 16 Sep 1994 06:10:18 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. PIM->ISO and TopSpeed->XDS Modula-2 porting notes

2. PIM->ISO and TopSpeed->XDS Modula-2 porting notes

3. PIM->ISO and TopSpeed->XDS Modula-2 porting notes

4. Pascal->Modula->Ada?

5. setting the model of a TreePresenter in Dialog>>model:

6. get/set behaviour (was: >>Voluntary method typing)

7. HELP>>>>>>>Fortran-Pascal Linking

8. >>>>>>>FROM SMTK TO C++

9. array set { } not equivalent to set <arrayname>(<key>) <value>

10. sets in modula

11. sets in modula

12. ><><><><>Heeeeeeeeeeeeeeelp on INT 14!><><><><><>

 

 
Powered by phpBB® Forum Software