[fpc-devel] delegate objects

ik idokan at gmail.com
Sun Jan 28 21:21:20 CET 2007


Hi List,

There is a small conversation I read regarding delegating methods in objects.

The thing is something like so (from the original discussion)

<<<<<<<<<
sub factors
{
   my $self = shift;

   return $self->result()->factors();
}
>>>>>>>>>

And besides it similar declarations for some other functions:

<<<<<<<<<<
sub is_square
{
   my $self = shift;
   return $self->result()->is_square();
}

sub exists
{
   my ($self, $factor) = @_;

   return $self->result()->exists($factor);
}

sub first
{
   my $self = shift;

   return $self->result()->first();
}
>>>>>>>>>>>


Is there a way do delegate such methods on classes using Object Pascal ?
If so, how would you do it ?


Thanks,

Ido
-- 
http://ik.homelinux.org/



More information about the fpc-devel mailing list