- oof proposal

From: ForthCAD <mail_at_forthcad.com>
Date: Fri, 12 Feb 1999 12:02:42 -0000

Playing with the Wil Baden syntax proposal in my oof, it appear that =
COMMON is less interesting that SELF when defining big classes. (my =
opinion)

Wil Baden propose:

        Class Point

        Public
          variable x
          variable y

          : ! ( x y -- ) y COMMON ! x COMMON ! ;
          : @ ( -- x y ) x COMMON @ y COMMON @ ;
        End

I propose now the following syntax...

        Class Point

        Public
          variable x
          variable y

          : ! ( x y -- ) SELF y ! SELF x ! ;
          : @ ( -- x y ) SELF x @ SELF y @ ;
        End

Why ?
-----
1. This syntax is more clear because native Forth words remain what they =
are in all classes definition story. ( no confusion when using =
SubSubSub...Classes where you can be afraid when using word such as @ or =
! ... what do it finally )

2. Out of a class, the syntax is OBJECT->METHOD, its better to have the =
same logic inside a class: SELF->METHOD, SUPER->METHOD

3. This syntax enable other class system implementation, with =
hash-table, better when using virtual-method tables.

4. Always possible to define SELF as NOOP.

Charles Melice

.
Received on Fri Feb 12 1999 - 12:02:42 PST


Subscribe to our e-mail list service. It's free for all SwiftForth and SwiftX users!

This archive was generated 08-Feb-2012. Archive updated nightly.