Help for this page

Select Code to Download


  1. or download this
    Object subclass: 'Point' instanceVariables: 'x y '
    
    ...
    init
     x := Float new.
     y := Float new.
    
  2. or download this
    p := Point new.
    p init.
    p x: 1.5.
    p y: 1.5.
    
  3. or download this
    my $p = bless {}, Point;
    $p->init;
    $p->x(1.5);
    $p->y(1.5);
    
  4. or download this
    newX: xc Y: yc
     p := Point new.
    ...
     p x: xc.
     p y: yc.
     ^p
    
  5. or download this
    Point newX: 1.5 Y: 1.5.
    
  6. or download this
    sub init
    {
    ...
        $object->init(@_);
        return $object;
    }