This should be a bit more clear (untested code).
--scrip1.d
import std.stdio;
writefln(i);
----
--main.d
import std.file;
import std.script;
void main(){
Script s = new Script(cast(ubyte[]) read("script1.d"));
assert(!s.validate);
int i = 1;
assert(s.validate);
s.compile();
s.execute(); // output 1
}
----
Oh, D doesn't have a scripting module as far as i know.
Sorry i thought you were implying something, knowing the the topic is
touchy for some people that has no idea how serious is this tiny issue.
--
Using Opera's revolutionary email client: http://www.opera.com/mail/