Hi Russel --

Depending on what filenames you use, an explicit 'module' declaration may never 
be needed.  Some cases where one might opt to use one include:


* when implementing multiple versions of the same module using distinct files 
and wanting all the versions to have a consistent name in spite of potentially 
differing filenames.


* when a filename, due to some other convention, contains symbols that are not 
part of a legal identity.  E.g., if my file is called 'foo-brad.chpl', I can't 
type 'use foo-brad;' in my code because '-' means subtraction.  So I could use 
a 'module foo { ... }' declaration within my code to give it a different name 
or avoid such filenames.


-Brad

________________________________
From: Russel Winder <[email protected]>
Sent: Sunday, September 4, 2016 3:45:39 AM
To: Chapel_Users
Subject: Files and modules

It isn't clear (I probably just haven't read the documentation enough!)
when an explicit module statement is needed in Chapel.

I believe that if there is no module statement then a file is a module,
thus no module statement is needed. So when is a module statement
needed given that file as module, module as file is an excellent thing
as proven by Python and D.

--
Russel.
=============================================================================
Dr Russel Winder      t: +44 20 7585 2200   voip: sip:[email protected]
41 Buckmaster Road    m: +44 7770 465 077   xmpp: [email protected]
London SW11 1EN, UK   w: www.russel.org.uk<http://www.russel.org.uk>  skype: 
russel_winder
------------------------------------------------------------------------------
_______________________________________________
Chapel-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/chapel-users

Reply via email to