[futurebasic] Re: [FB] Dynamic Functions?

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : July 2008 : Group Archive : Group : All Groups

From: Brian Stevens <bstevens33@...>
Date: Fri, 18 Jul 2008 08:53:19 -0700
On Jul 17, 2008, at 10:26 PM, Max Taylor wrote:

>>> Could the number and type of the parameters be totally dynamic?
>>> Is it possible to build such a FN?
>> The question's timing is good. Recently, the FBtoC team ( mostly  
>> Bernie ) pondered how to use a Core Foundation call that accepts a  
>> variable number of parameters ( CFStringCreateWithFormat ) without  
>> interfering with the possible use of the same call by the FBer's  
>> code. A PASSTHROUGH solution is possible but ugly. Bernie did some  
>> research and came up with the va_start and va_list C macros. The  
>> work is still in progress ( and experimental ---so no promises )   
>> and hasn't been submitted to the team yet, but initial work is  
>> promising. So, yes there is a possibility that calling user FNs  
>> with multiple parms is possible. However, when/if implemented it  
>> will be FBtoC-only.
> Thanks for the above paragraph. It is interesting to see how others  
> may solve a closely related problem.
> Maybe I should try creating my own stack, putting the values  
> thereon, calling a FN by its address and then retrieving the  
> parameters from my custom stack that are required for that  
> particular FN.

Bernie's implementation uses a stack, so you might want to wait and  
see how it turns out unless there is an urgent need to write your own  
code now.

Brian S.