OCaml by Example?

This is exactly what I was willing to explain on RosettaCode. Did you understood something else?

So you wrote this ?

I mean if you understood my previous message you should see that this paragraph:

The OCaml programmer should be aware that when multiple values are returned with a tuple, the finalisation does not handle each values independently, but handles the tuple as a whole. So all the values are only finalised when all the values are not reachable anymore.

is technically wrong. More generally I don’t think it’s worth mentioning any of this on a site like rosetta since you will likely never run in a problem with this.

P.S. To maintainers is it possible to detach this discussion on another thread, it’s largely OT by now, sorry @zeroexcuses for hijacking the thread.

P.P.S. I see the paragraph has now been removed if that’s you @fccm then thanks for removing it.

You can see from the history that it was me, many years ago, when this was still true.
Now it became out dated, not plain wrong.

Sorry but I don’t see any difference. For me this is talking about the same thing.

If there is a problem, I don’t seem a point trying to hide it.
RosettaCode is about to compare languages, with their strengths and weaknesses.

Yes, it’s still me, but it’s a wiki, anyone can edit.

Is there anything else to fix on RosettaCode that you know?

This paragraph basically said that if you return multiple values with a function these values will only be gc’d once all the values are; this is wrong in general and has always been.

The reason why I asked to remove that paragraph is that the effect of such a paragraph on a newcomer (one of rosetta’s audience) will likely be either 1) not return tuples from a function or 2) start thinking about the lifetime of values which is precisely something OCaml frees you from most of the time.

It’s not about hiding a problem, it’s about not mentioning something that you are unlikely to run into in practice (I personally never did) and that mentioning there might mislead newcomers in the OCaml programming practice they are trying to acquire.

1 Like