<font color='black' size='2' face='arial'><br>
<font color="black" face="arial" size="2">
<div style="font-family:arial,helvetica;font-size:10pt;color:black">
<br>
<div id="AOLMsgPart_0_58ad9bd3-e63e-426e-99ea-5d265d1e542d" style="margin: 0px;font-family: Tahoma, Verdana, Arial, Sans-Serif;font-size: 12px;color: #000;background-color: #fff;">
<pre style="font-size: 9pt;"><tt>On Sun, 2012-03-18 at 14:38 -0400, <a __removedlink__1240949911__href="mailto:jkaczorek@aol.pl">jkaczorek@aol.pl</a> wrote:
> Could anyone explain me how to create objects and their instances?
> [...]
Hello,
first you have to create a class. An empty class definition might look
like this:
(define foo%
(class object%
(super-new)))
Note that a class is a run-time value in Racket and can be assigned to a
regular variable.
Then you instantiate the class using the new operator, which might look
like this:
(define some-foo
(new foo%))
(define another-foo
(new foo%))
And that's it -- there are no special parameters or any other magic
involved :-)
You will probably want to pass arguments to your class' constructor and
perhaps store them in instance fields, but that's something you didn't
ask about, so I won't confuse you with extra examples ;-)
Ciao,
Thomas
Thanks for Your answer,<br>
it's all I wanted to know :)<a __removedlink__1240949911__href="http://lists.racket-lang.org/users" target="_blank"></a>
</tt></pre>
</div>
<!-- end of AOLMsgPart_0_58ad9bd3-e63e-426e-99ea-5d265d1e542d -->
</div>
</font></font>