Many programming languages permit natural manipulation of strings, and some languages permit the manipulations of lists too.
More often then not (always?), these operations are done as procedure calls, or as member functions.
Many programming languages do implement in syntax the fairly typical set {prepend, replace, append} on lists (and/or strings).
I would like to know if there as/was a programming language that has a syntax that minimises/rationalises/orthogonalises the insertion syntax of items into a list by syntax design?
Python - as a simple example - has only: https://stackoverflow.com/questions/18033339/python-insert-operation-on-list
mylist.insert(10,'5')
Note: In python list insertion is implemented as a member function.
But: Python does have some syntactic sugar for removing elements from a list: e.g.
del mylist[4:7]
I like to know of any languages actually try to integrate (or have strategy) for list insertion as part of the syntax?
An example of insertion by construction: Here is some code from a fairly typical "Brand X" language, demonstrating typical prepend/replace/append operations {or operators, vis-à-vis syntatic sugar}, notice there is no obvious syntax for {in place} inserting (or removing) from the middle of a list. {It has to be done "by construction", or by calling a procedure}
# Demonstration of prefix, replace and append operations to a string {or list} #
string s := "23XX78";
"1" +=: s; # Prefix a char "1" to the string "in place" #
s[4:5] := "46"; # In place replace a char at pos 2 in a string #
s +:= "9!"; # Append a string "9!" char to the string #
#
Although inserting into a list is intuitive,
* it is by construction (hence prone to typos/index-flips)
* it is not "in place"
e.g. ...
#
s:=s[:4]+"5"+s[5:];
print(s)
Output: "123456789!"
Another example for strings:
s[:4]+="5"