Dear Ashis,

There is a simpler way to load a module from an .ozf file: Module.link.  It
takes a list of urls (or file names) and returns a list of modules
(instantiated from the functors found in the files):

[ModuleFoo]={Module.link ['Foo.ozf']}

Cheers,
raph

On Thu, Oct 16, 2008 at 7:01 PM, Maity, Ashis K <[EMAIL PROTECTED]>wrote:

>  Hello,
>
>
>
> I am new to Mozart. I am trying the following piece of code where I am
> trying to import .ozf files dynamically. Is it possible? Seems like I am
> always getting the following error (tried "import" both at inside the proc
> or calling it from outside) where I try to link the dynamically obtained
> file name with a variable name e.g., *Sched at X* : syntax error,
> unexpected T_VARIABLE, expecting T_OZATOM
>
>
>
> % Get the .ozf files from ProgramSpecificConstraint dir
>
>     proc{ImportFiles dirName ?File} Files in
>
>       Files = {OS.getDir dirName}
>
>       {ForAll Files proc{$ X} Y Z  in
>
>                                {String.token X &. Y Z}
>
>                                if Z == "ozf" then XX in
>
>                                       functor XX
>
>                                       import
>
>                                          Sched at X
>
>                                       end
>
>                                      File = X
>
>                                else
>
>                                       {Browse 'did nothing'}
>
>                                end
>
>                             end
>
>       }
>
>    end
>
>
>
> %import
>
>    %Sched at {ImportFiles '.'}
>
>
>
> Thanks so much,
>
>
>
> Ashis
>
>
>
>
> _________________________________________________________________________________
> mozart-users mailing list
> [email protected]
> http://www.mozart-oz.org/mailman/listinfo/mozart-users
>
_________________________________________________________________________________
mozart-users mailing list                               
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users

Reply via email to