Dear Ashis,
About Module.load: you're right, I made a mistake, it's Module.link that you
should use. Read carefully its documentation, you will understand why
nothing happens when you call that function: it loads modules *on demand*.
So
Mods = {Module.link {ImportFiles DirName}}
binds Mods to a list of variables, but does not load modules yet. You can
check that by running {Browse Mods}. The variables in Mods will be
determined (and the corresponding modules loaded) once the program will need
their value. A simple way to force the loading is to Wait on all variables:
{ForAll Mods Wait}
Now, there are several mistakes in your code...
> local Mods in
>
> Mods = {ImportFiles DirName}
>
> {ForAll Mods
>
> proc{$ File}
>
> ConstraintFileName = {FirstN {LastRemain File DirName} 4}
>
> {Browse 'do nothing'#{String.toAtom ConstraintFileName}}
>
> [ConstraintFileName] = {Module.link [File]} ß------------ Program
> appears to hang here / however works okay if I remove the line above Browse
>
> end
>
> }
>
> End
>
The program must fail after browsing the first filename. ConstraintFileName
is declared as a *global* variable, and you bind it twice in the loop! You
cannot reassign logic variables; here you are trying to assign it 2N values,
where N is the number of files you load. The first assignment (the result
of FirstN) succeeds, but the second one (the result of Module.link) fails,
because it loads the module, and tries to assign it to ConstraintFileName.
At that point, the program should stop.
Cheers,
raph
_________________________________________________________________________________
mozart-users mailing list
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users