Next: , Previous: , Up: Infix Binary Operators   [Index]


3.9.6 String Assignment Operator Example

For all its usefulness, the libaime infix binary operators set does not provide the string attribution operator. That is due to the operator requirements: it needs to allocate memory to make a copy of its right side operand and just as well, it needs to free the memory reserved by its left side operand (just before setting it to the copy of the right side). And it needs to allocate and free memory with respect to the application memory management policies. In turn, the memory operations are due to the immediate character of the intrinsic string type: data of this type is exactly what it appears to be and no fancy management mechanism is tracking it.

See C Infix Binary Operators Set.

More than that, the string to be freed (the previous value of the left operand) cannot be freed immediately, instead its deallocation needs to be deferred until after the expression evaluation. The later deallocation has to be arranged by the operator.

See Writing Functions.

A string assignment operator is provided by the libaime text library.

See Text Library.

See Text Operators.