5 ms·
It works in OCaml too, where lists certainly are not functions! let rec ones = 1 :: ones;;
by tome 12y ago
It works in OCaml too, where lists certainly are not functions!
let rec ones = 1 :: ones;;
- poizan42 12y agoI don't know OCaml, but logically it cannot be an actual realized list as the would take up an infinite amount of memory. Whether or not it acts like a function in the language wasn't really the point - internally it must still be an iterator unless you have a computer with an infinite amount of memory.
- tome 12y agoIt's not a function, an infinite list or an iterator. It's a cyclic linked list.