Gen
unread,Feb 28, 2012, 5:10:04 AM2/28/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to General Dart Discussion
Hi,
yesterday I have tried to find some information about #library,
#source, #import and the Dart editor.
Now here is what I have learned:
#library
----------
1)
Indicates a source file to be used as a library.
The name given as in:
#library("name");
is without importance for the compiler.
But the Dart Editor uses these names for the Tools/Libraries view.
2)
If no #library declaration is given in the file with the "main"
function,
the compiler will add implicitly:
#library("filename");
3)
Only one "main" function per program (and library) is allowed.
#source
-----------
This links a single file.
Linking happens by using a file path as in:
#source("path/of/xxx.dart");
You can link a file with a #library declaration only via #import.
#import
-----------
This links a file and its linked files.
Linking happens by using a file path as in:
#import("path/of/xxx.dart");
or
#import("path/of/xxx.dart", prefix: "somePrefix");
You can link a file with a #library declaration only via #import.
Dart editor: Tools/Libraries view
---------------------------------------------
1)
The Libraries folder structure corresponds to the #import structure
but not the folder structure of the file system.
2)
The Libraries folder names correspond to the names given in the
#library("name")
declarations.