@nikitonsky For a while I was thinking about a language where the semantics of brackets was user-definable at compile time. You could have (a,b,...) assemble one sort of list, and [a,b,...] assemble a second sort, and then similarly “applying” (juxtaposing) the expression E to the object from [a,b,...] might perform an array lookup on E or something like that.
My main idea was to permit the programmer to choose and define notations for things like sets, bags, tuples, and vectors, and for array and hash subscripting to be controllable and not hardwired into the syntax. But I'm sure that `|x|` was one of my example use cases.
Some paper of @pigworker has a horrible hack in which `Ii x y z … iI` is defined so as to perform a certain sort of computation, with `Ii` and `iI` playing the role of brackets `Ii` has a typeclass defined so that `Ii x y z...` accumulates the `[x, y, z, ...]` at compile time, and then `iI` is some unique value with a special type that triggers the compiler to figure out that it has seen the whole list and should actually do the thing.