# New .%() operators

**URL:** <https://discuss.ocaml.org/t/new-operators/10124>\
**Category:** Learning\
**Created:** [July 2, 2022, 5:51pm UTC](https://discuss.ocaml.org/t/new-operators/10124 "2022-07-02T17:51:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![struktured](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/struktured/32/385_2.png) [@struktured](https://discuss.ocaml.org/u/struktured)\
**Post date:** [July 2, 2022, 5:51pm UTC](https://discuss.ocaml.org/t/new-operators/10124/1 "2022-07-02T17:51:02Z")

</div>

Quoting @art-w in a previous post about syntactical sugar:

> The [new `.%()` operators](https://sherlocode.com/?q=.%5C%5B-%3F%21%2B%40*%25%24%26%5C%5D%5C%5B%28%5B%7B%5C%5D) aren’t really popular. It takes a lot of time and motivation to introduce new syntax.

I’m embarrased to say I couldn’t find any information on these operators. Does anyone have a good blog or documentation on them?

Thanks!

---

<div class="post-metadata">

**Author:** ![nojb](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/nojb/32/519_2.png) [@nojb](https://discuss.ocaml.org/u/nojb)\
**Post date:** [July 2, 2022, 6:00pm UTC](https://discuss.ocaml.org/t/new-operators/10124/2 "2022-07-02T18:00:48Z")

</div>

> [@struktured](#):
>
> Does anyone have a good blog or documentation on them?

[https://ocaml.org/manual/indexops.html](https://ocaml.org/manual/indexops.html)

Cheers,  
Nicolas

---

<div class="post-metadata">

**Author:** ![octachron](https://avatars.discourse-cdn.com/v4/letter/o/49beb7/32.png) [@octachron](https://discuss.ocaml.org/u/octachron)\
**Post date:** [July 2, 2022, 6:40pm UTC](https://discuss.ocaml.org/t/new-operators/10124/3 "2022-07-02T18:40:37Z")

</div>

[Owl](https://ocaml.xyz/) is one of the main user of those operators (which is expected since they were introduced with numerical libraries in mind) in particular to get a lighter syntax for slicing: [Slicing and Broadcasting - Owl Online Tutorials](https://ocaml.xyz/tutorial/slicing.html) .  
For instance, the linked tutorial provides an example for zeroing a slice of an array:

```ocaml
let x = sequential [|10; 10; 10|] in
let a = x.${[0;4]; [6;-1]; [-1;0]} in
let b = zeros (shape a) in
x.${[0;4]; [6;-1]; [-1;0]} <- b 

```
