Class creation

Khadija EL MAHRSI khadija.elmahrsi at gmail.com
Thu Jun 14 21:15:09 CEST 2012


Hi,
what you said is close to what I meant: a way to create instances of a same
class that don't necessarily share the same number of passed arguments to
the init method (and eventually respond differently to the passed
arguments).
I've also thought about some of the solutions you've listed but to be
honest I thought it would be such a hassle when it could've been made alot
easier by allowing something close to multiple constructors where you could
have different initialization methods to call according to your need.
Thanks for the reply. I just wanted to make sure I had no other choice
before resorting to other solutions.

2012/6/14 Torsten Anders <torsten.anders at beds.ac.uk>

> Dear Khadija,
>
> I am not quite sure what you are after. Perhaps you specify in more detail
> what you actually want to do?
>
> Are you simply looking for a way to have more or less arguments given to
> the class initialisation method? All method arguments can be optional. If
> you want a more dynamic reaction to different init method arguments then
> you can test these arguments in various ways and call other methods or proc
> accordingly to create and initialise your object.  Further, you can even
> generate classes dynamically, e.g., a function can return a class, and that
> way you can further customise your init method on the fly.
>
> Best wishes,
> Torsten
>
> --
> Dr Torsten Anders
> Course Leader, Music Technology
> University of Bedfordshire
> Park Square, Room A315
> http://www.torsten-anders.de
>
>
>
> On 14 Jun 2012, at 18:49, Khadija EL MAHRSI wrote:
>
> > Hi,
> > I was reading the documentation about classes and noticed that there was
> no possibility to have something similar to multiple constructors. Is this
> correct? If so, is there a way to create a class which can be initialized
> in more than one way?
> >
> > Thanks.
> >
> _________________________________________________________________________________
> > mozart-users mailing list
> mozart-users at mozart-oz.org
> > http://www.mozart-oz.org/mailman/listinfo/mozart-users
>
>
> _________________________________________________________________________________
> mozart-users mailing list
> mozart-users at mozart-oz.org
> http://www.mozart-oz.org/mailman/listinfo/mozart-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.gforge.info.ucl.ac.be/pipermail/mozart-users/attachments/20120614/a00ba376/attachment.html


More information about the mozart-users mailing list