home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / lang / modula2 / 1727 < prev    next >
Encoding:
Text File  |  1993-01-23  |  1.2 KB  |  43 lines

  1. Newsgroups: comp.lang.modula2
  2. Path: sparky!uunet!newsgate.watson.ibm.com!yktnews2.watson.ibm.com!yktnews!admin!nordruth!seurer
  3. From: seurer@rchland.vnet.ibm.com (Bill Seurer)
  4. Subject: Re: pascal code to modula
  5. Sender: news@rchland.ibm.com
  6. Message-ID: <1993Jan22.201048.10258@rchland.ibm.com>
  7. Date: Fri, 22 Jan 1993 20:10:48 GMT
  8. Reply-To: BillSeurer@vnet.ibm.com
  9. Disclaimer: This posting represents the poster's views, not necessarily those of IBM
  10. References:  <8267@kielo.uta.fi>
  11. Nntp-Posting-Host: nordruth.rchland.ibm.com
  12. Organization: IBM Rochester
  13. Lines: 28
  14.  
  15. In article <8267@kielo.uta.fi>, csfraw@vehka.cs.uta.fi (Francis Akoto) writes:
  16. |> This is a pascal code
  17. |> 
  18. |>    i,j: integer ;
  19. |> 
  20. |>           i := i or j ;
  21. |> 
  22. |> what will be ite equivalent in modula-2 ?
  23. |> 
  24.  
  25. With JPI it would be:
  26.  
  27.    i, j: INTEGER;
  28.  
  29.    i := i OR j;
  30.  
  31. assuming you turn on the "bitwise logical operator" option previously
  32. mentioned here.
  33.  
  34. In more "standard" Modula-2 this works (I think):
  35.  
  36.   i := INTEGER(BITSET(i) + BITSET(j));
  37.  
  38. You might need VALs or CASTs or something in there though.
  39. -- 
  40.  
  41. - Bill Seurer     Language and Compiler Development      IBM Rochester, MN
  42.   Internet: BillSeurer@vnet.ibm.com    America On-Line: BillSeurer@aol.com
  43.