Can Handler Know What Params It Should Have

Bernard Devlin bdrunrev at gmail.com
Wed Feb 3 06:22:58 EST 2016


Hi Pierre

I think we might be talking about different things.

For a few minutes, I thought you were saying that "get function
someFunctionName()" would return the "signature" of that function (in Java
the "signature" of a handler is "name param1 paramN").  But in LC it
appears we can't ask the runtime for information about defined code. I
tried running what I understood you to be saying, and it did not work.  On
reflection, I think you are providing a mechanism to hard code a number of
different handlers, in response to a handler receiving a (varying) number
of possible parameters.

Basically, it seems that other languages are able to introspect in a way
that we can't in LC.

Another thing I think would be good, would be to have an "undefined"
handler. Smalltalk has this; IIRC so does TCL.

Regards
Bernard

On Tue, Feb 2, 2016 at 5:35 PM, Pierre Sahores <sc at sahores-conseil.com>
wrote:

> Bernard,
>
> It’s the way most AI programs are running (functional programming +
> lambda-calcul => 24/7 enabled recursive call-backs)
>
> 1.- as a startup example :
>
> on idle
>  if var1 and var2 is «  » then
>         get function function_1
> else
>         get function function_n
> end if
> end idle
>
> or more simple :
>
> on idle
>         get function function_1(var1, var2)
> end idle
>
> function function_1
>> end function_1
>
>>
>
> function function_n
>> end function_n
>
> 2.- where idle can be replaced with a first direct call (on startup, on
> opencard,…) to function_1 as long as function_n ends up with :
>
> wait 10
> send function_1 to me in 10 ticks — garbage collector
>
> HTH,
>
>
>
>



More information about the use-livecode mailing list