user797257
user797257

Reputation:

Import module into current scope?

The modules have very long names (they make names of the imported functions three times longer then needed), for example: mapconcat looks Project.Utils.mapconcat is there any way to import this function and use it w/o fully qualifying it by the module name?

Upvotes: 2

Views: 370

Answers (1)

basarat
basarat

Reputation: 276239

You can always do :

var x = Project.Utils.mapconcat;
// now use x in place of mapconcat

PS: you can use the import statement to create an alias for a module

import pu = Project.Utils;
// now: 
pu.mapconcat

This is assuming Utils is a module name (and not a class).

Upvotes: 2

Related Questions