- Subject: Re: [slang-users] Include files like C #include does
- From: Jörg Sommer <joerg@xxxxxxxxxxxx>
- Date: Mon, 3 Jul 2006 18:12:31 +0200
Salut Laurent,
Laurent Perez schrieb am Mon 03. Jul, 09:40 (+0200):
> * Jörg Sommer <joerg@xxxxxxxxxxxx> [2006-07-02 22:04] :
>
> > is it possible to include/evaluate files in a way their content is
> > evaluated as it was there? I would like to split a file and take out a
> > big block. But if I do this I must lower some access restrictions to make
> > it possible to access the functions from the split-out-code. I search a
> > function like #include for C that imports the content of a file into
> > another file. Is this possible with SLang?
>
> Hi,
>
> Doesn't
>
> () = evalfile ("myfile.sl");
>
> fit your needs ?
No. I have this:
#v+
implements("foo");
private fun() {}
static do_something() { fun(); }
#v-
If I want to move do_something() in a separate file I must make fun at
least static.
#v+
implements("foo");
static fun() {}
() = evalfile("new_file", current_namespace());
#v-
But then fun is accessable form anywhere.
Bye, Jörg.
--
"...anytime you install something new on the Windows platform, you risk
spending the next five or six hours trying to figure out what happened"
-- Robert Roblin, Adobe
_______________________________________________
To unsubscribe, visit http://jedsoft.org/slang/mailinglists.html
[2006 date index]
[2006 thread index]
[Thread Prev] [Thread Next]
[Date Prev] [Date Next]