[fpc-pascal] Adding method dynamically to a class

ik idokan at gmail.com
Wed Jun 20 08:47:22 CEST 2012


On Wed, Jun 20, 2012 at 8:33 AM, LacaK <lacak at zoznam.sk> wrote:

> **
> Class helpers would not help ?
>
> http://wiki.freepascal.org/Helper_types
>


They can, but there is a protocol that I'm trying to create that provides
me information what to execute (out of white list). The thing is, that the
first request maps the methods to be used, and there could be 2 or 200. To
implement 200 methods that might be used is not a good idea imho, but
adding the proper method to the instance/class will work much better.

It's easy to do in dynamic language, and I might need to implement it there
instead :(


>
> -Laco.
>
>
>>
>>   Hello,
>>
>> Is there a way to tell in run-time that a specific function/procedure
>> should belong to a class ?
>>
>> For example, let's say I have the following class:
>>
>> Type
>>   TTest = class
>>     procedure Foo;
>>   end;
>>
>> And I have also:
>>
>> procedure Bar;
>> ...
>> end;
>>
>>
>
> _______________________________________________
> fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20120620/38b7e51e/attachment.html>


More information about the fpc-pascal mailing list