== Quote from Daniel Gibson ([email protected])'s article
> I guess something like that is possible.
> I'd prefer something like
> s.call("main", i);
> and also
> s.call("foo", 42, x);
> though - so you can define multiple functions in a script and call them.
Of course, I was thinking that if you omit the function name it would default to
main,
but that would prohibit the use of a string as first argument :)
> Or maybe, with more magic and support within the D compiler
> s.main(i);
> s.foo(42,x);
> But that means that the compiler needs to know the Script type, create a class
> for each script that contains the functions called on the script ("main",
> "foo"), create stubs for them that either do something like call("foo",i) or,
> if
> no function foo with an appropriate argument is found in the script, throws
> an
> exception..
> Probably possible, but certainly not easy.
> The first suggestion however (s.call("foo", i)) should be possible without
> support in the D compiler, all the work would be done in the Script class.
> Still
> not trivial, of course, especially with arguments for called functions and
> their
> type etc.
I would be more than happy with only the first method :)
Would DMDscript help?