Branch: Tag:

2020-11-16

2020-11-16 16:59:31 by Henrik Grubbström (Grubba) <grubba@grubba.org>

LFUNs: Support atomic get and set with lfun::`->=() and lfun::`[]=().

`->=() and `[]=() should now return the previous value.

Also alters ::`->=() accordingly.

1091:    *! @[predef::`[]()], @[predef::`[..]]    */    - /*! @decl void lfun::`[]=(zero index, zero value, @ -  *! object|void context, int|void access) + /*! @decl mixed lfun::`[]=(zero index, zero value, @ +  *! object|void context, int|void access)    *! -  *! Index assignment callback. +  *! Atomic get and set index callback.    *!    *! @param index    *! Index to change the value of.
1122:    *! This function is to set the value at index @[index] of the current    *! object to @[value].    *! +  *! @returns +  *! Returns the previous value at index @[index] of the current object. +  *!    *! @seealso    *! @[predef::`[]=()], @[lfun::`->=()], @[lfun::_atomic_get_set()]    */
1160:    *! @[predef::`->()], @[::`->()]    */    - /*! @decl void lfun::`->=(string index, zero value, @ + /*! @decl mixed lfun::`->=(string index, zero value, @    *! object|void context, int|void access)    *! -  *! Arrow index assignment callback. +  *! Atomic get and set arrow index callback.    *!    *! @param index    *! Symbol in @[context] to change the value of.
1191:    *! This function is to set the value at symbol @[index] of the current    *! object to @[value].    *! +  *! @returns +  *! Returns the previous value at symbol @[index] of the current object. +  *!    *! @seealso    *! @[predef::`->=()], @[::`->=()], @[lfun::`[]=()],    *! @[lfun::_atomic_get_set()]
9504:   #endif       lfun_getter_type_string = make_pike_type(tFuncV(tNone, tVoid, tMix)); -  lfun_setter_type_string = make_pike_type(tFuncV(tZero, tVoid, tVoid)); +  lfun_setter_type_string = +  make_pike_type(tOr(tDeprecated(tFuncV(tZero, tVoid, tVoid)), +  tFuncV(tZero, tVoid, tMix)));       low_init_pike_compiler();