🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.modula2
Article #3735

some questions about modula2

#3735
From: Mukesh Dalal
Date: Thu, 13 Aug 1987 16:27
47 lines
1716 bytes
I am beginner in modula2 programming. I am confused about some
features:

1. Is the type checking based on name equivalence or structure
equivalence? More specifically, Is the following construct allowed:

	Type
	 P= Record
		...
	    End;
	 Q = P;
If yes, can a variable of type P be assigned a value of type Q and
vice-versa?

2. Can a global module export an item which it has imported?

3. Can the definition of a global-module M refer to a type P which is
neither declared there (either as opaque or transparent) nor is
imported from some other module but is defined/imported in the
corresponding implementation module of M?

4. Is the following construct allowed:

	Definition:
		procedure abc (..);
	Implementation:
		var x: ...;
		procedure abc (...);
			...
			x := ...;
		end;
		...

i.e., can an exported procedure make a change in a variable defined in
the module exporting that procedure?

I suspect that the ans to 4 is yes, but I want to make sure.


Thanks in advance for helpful responses.
-- 

Mukesh Dalal				Voice: (201)-878-1763
Dept. of Computer Sc. (Rutgers)		Net: dalal@topaz.rutgers.edu

	"To every action, there is an OVER-REACTION" 
Technical Details
Message-ID: <13951@topaz.rutgers.edu>
Path: arc1-ca.pugleaf.net!utzoo!mnetor!uunet!husc6!rutgers!topaz.rutgers.edu!dalal

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!mnetor!uunet!husc6!rutgers!topaz.rutgers.edu!dalal
From: dalal@topaz.rutgers.edu (Mukesh Dalal)
Newsgroups: comp.lang.modula2
Subject: some questions about modula2
Message-ID: <13951@topaz.rutgers.edu>
Date: Thu, 13-Aug-87 12:27:26 EDT
Article-I.D.: topaz.13951
Posted: Thu Aug 13 12:27:26 1987
Date-Received: Sat, 15-Aug-87 09:16:58 EDT
Organization: Rutgers Univ., New Brunswick, N.J.
Lines: 47
Keywords: modula2, type, vars