1 Matching Annotations
  1. Dec 2023
    1. ref !lst

      Why do we need to dereference and then immediately reference here?

      !lst would give us the list itself, rather than the reference location the list is stored at.

      But then ref turns it immediately back into a reference location to keep it mutable.

      It seems like ref !lst should be basically equal to lst, but replacing the former with the latter causes an OOM error with every small (ex. two-item) lists in my browser's OCaml playground. Why?