Dear Mark

Classes are first-class values, you can bind them to variables, store them in data structures, return them by functions etc. So, you can also export them by functors.

You only need to export the class, but not its methods. You can then instantiate this class and the resulting objects will understand all the class methods. If you want to have private methods (which cannot be called outside), use variables instead of atoms for their name (the record label of the method). These methods can then only be called within the scope of these variables (e.g., within the functor definition).

Best
Torsten

On Sep 8, 2008, at 11:28 AM, mark wrote:

Hi,

This may have answered my question. I'm happy with defining a new class, my confusion was how to integrate it into a functor definition. I was thinking along the lines of how to export all the methods of the class. If you just export the class itself then I think I'm OK. I'll try it later.
(Should have been obvious really I suppose).

Thanks

Mark
Gustavo Gutierrez wrote:



On Fri, Sep 5, 2008 at 9:03 PM, mark <[EMAIL PROTECTED]> wrote:
Hi,


How can I wrap all this in a class definition instead so that FileName and Record are attributes of a class?

My advise is to go to http://www.mozart-oz.org/documentation/ tutorial/node10.html#chapter.classes where classes and objects are explained. Section 10.3 gives you a complete example on how to define classes and create objects from them.

When you have finished to create a class version of your code then just export the class in the functor. Having this, you will be able to create different objects by importing the new created funtor from other functors.

If you have any problem, feel free to post your new code and ask any question.

Regards,
Gustavo Gutierrez
_____________________________________________________________________ ____________ mozart-users mailing list [email protected] http://www.mozart-oz.org/mailman/listinfo/mozart-users


-- Mark Richardson Final year undergraduate University of Teesside <ATT00001.txt>

--
Torsten Anders
Interdisciplinary Centre for Computer Music Research
University of Plymouth
Office: +44-1752-586219
Private: +44-1752-558917
http://strasheela.sourceforge.net
http://www.torsten-anders.de





_________________________________________________________________________________
mozart-users mailing list                               
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users

Reply via email to