Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Future: feature idea: "use Module as M" #3900

Merged
merged 2 commits into from
May 25, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions test/modules/cassella/use-module-as.bad
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use-module-as.chpl:5: syntax error: near 'as'
7 changes: 7 additions & 0 deletions test/modules/cassella/use-module-as.chpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module JohannGambolputtyDeVonAusfernSchplendenSchlitterAppleBangerVonHautkopftOfUlm {
var k = 7;
}

use JohannGambolputtyDeVonAusfernSchplendenSchlitterAppleBangerVonHautkopftOfUlm as J;

writeln(J.k);
10 changes: 10 additions & 0 deletions test/modules/cassella/use-module-as.future
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
feature request: Allow "use Module as M" to reference Module.x as M.x

That is, "use Module as M" or "use moduleX.moduleY.Module as M" would
allow referencing the symbols of the named module through the name M,
without importing the module's symbols into the current scope.


Discussion of several and diverse interpretations and approaches:

https://github.com/chapel-lang/chapel/pull/3900
1 change: 1 addition & 0 deletions test/modules/cassella/use-module-as.good
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
7