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
> 
> Van: "Patrick Philipot" <[EMAIL PROTECTED]>
> Datum: 2002/01/29 di PM 10:59:54 GMT+01:00
> Aan: <[EMAIL PROTECTED]>
> Onderwerp: [REBOL] rugby XPi beta1/add-functions
> 
> 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
> 
>  
> ______________________________________________________________________________
> ifrance.com, l'email gratuit le plus complet de l'Internet !
> vos emails depuis un navigateur, en POP3, sur Minitel, sur le WAP...
> http://www.ifrance.com/_reloc/email.emailif
> 
> 
> -- 
> To unsubscribe from this list, please send an email to
> [EMAIL PROTECTED] with "unsubscribe" in the 
> subject, without the quotes.
> 
>



-- 
To unsubscribe from this list, please send an email to
[EMAIL PROTECTED] with "unsubscribe" in the 
subject, without the quotes.

Reply via email to