- Subject: Re: Object-oriented
- From: "John E. Davis" <davis>
- Date: Wed, 4 Jul 2001 10:00:19 -0400
Richard van Zon <rvanzon@xxxxxxxxxxxx> wrote:
>Well...I am looking for a matter to divide things like OOP...
>for example...
>
>TBook Book;
>Book.Open();
>Book.Read()
>Book.Page=10;
>Book.Page++;
You can do this:
static define tbook_open () {...};
static define tbook_read () {...};
public define new_tbook ()
{
variable t = struct { open, read, page };
t.open = &tbook_open;
t.read = &tbook_read;
t.page = 0;
return t;
}
variable Book = new_tbook ();
@Book.read ();
Book.page++;
--John
[2001 date index]
[2001 thread index]
[Thread Prev] [Thread Next]
[Date Prev] [Date Next]