Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

rugby XPi beta1/add-functions

 [1/2] from: pat665::ifrance::com at: 29-Jan-2002 22:59


Hi Maarten, When add-functions is used repeatedly with the same function. This fonction appears several times in the function list. Here is my code.
>> rx: context get-rugby-service tcp://192.168.1.53:8001 >> psw: "pat665" >> rx/remove-functions "pat665" [double]
== none Once removed the function cannot be used anymore.
>> rx/double 3
** User Error: Rugby server error: Unsupported function: [double 3] ** Near: make error! rejoin ["Rugby server error: Unsupported function: " mold statement]
>>
Restoring the double function is easy with add-functions
>> rx/add-functions "pat665" [double]
== none
>> rx/double 3
== 6
>>
Calling add-functions repeatedly seems armless...
>> rx/add-functions "pat665" [double]
== none
>> rx/add-functions "pat665" [double]
== none
>>
In fact experimentation shows that after three add-functions, the added functions really appears three times on the function list.
>> psw: "pat665"
== "pat665"
>> f-list: rx/functions? psw >> foreach f-name f-list [print f-name]
triple get-stubs exec-code add-functions remove-functions functions? start-profiling profile-data reset-profiler ping set-pass-phrase double double double
>>
However only one remove-functions suffice to remove the function.
>> rx/remove-functions "pat665" [double]
== none
>> rx/double 3
** User Error: Rugby server error: Unsupported function: [double 3] ** Near: make error! rejoin ["Rugby server error: Unsupported function: " mold statement] Patrick

 [2/2] from: m:koopmans2:chello:nl at: 30-Jan-2002 10:55


You are correct. Currently add-function does not check if the functions is already there which gives you duplicates, where remove-function removes all. Note that add-function and remove-function may probably disappear in one of the next betas due to themodule system. Leaving you with add-module and remove-module instead. --Maarten