Talk:Caml

Requested move

 * The following discussion is an archived debate of the . Please do not modify it. Subsequent comments should be made in a new section on the talk page. No further edits should be made to this section. 

move. -- Kjkolb 05:17, 27 August 2006 (UTC)

Categorical Abstract Machine Language → Caml – No longer an acronym. Should get an otheruses or similar template referring to CAML. Qwertyus 23:53, 20 August 2006 (UTC)

Survey
Add "* Support" or "* Oppose" followed by an optional one-sentence explanation, then sign your opinion with ~


 * Support Qwertyus 23:53, 20 August 2006 (UTC)

Discussion
Add any additional comments


 * The above discussion is preserved as an archive of the debate. Please do not modify it. Subsequent comments should be made in a new section on this talk page. No further edits should be made to this section.

Does one really need a reference to claim that a function is more easily expressed as a function? [in a functional form]

Caml vs OCaml
I do not know Caml or OCaml so this is a request for clarification. Should the Caml page talk about OCaml? For example, the statement "...it is easy to create and pass around functions in OCaml programs." does not explicitly say if the same is true from Caml without object extensions. Jaimico 09:58, 4 June 2007 (UTC)

Better example of Higher Order Function
I do not know CAML nor OCAML, I just used Standard ML a looooooong time ago!

I came to this article to know about this descendant of ML, because I want to understand a program in OCAML.

I did not find what I needed, this article is incomplete.

The example on Higher Order Functions is not right at all, you can implement that derivate function in plain C language, which is not higher order. You can write something like:

The C functions can return pointers to functions, but can not return new functions. Some tricks can be done, and C++ allows overloading, but there are no higher order functions. It is totally unnatural in C/C++, although some visitor classes and other virtual classes may be used in a similar way as the functional forms in the Ocaml example below.

To clarify the it I wrote the following examples of higher order functions.

The first maps a binary tree of 'a to a binary tree of 'b applying a function f : 'a -> 'b, to each Leaf, i.e. changes each (Leaf x) to (Leaf (f x)), preserving the structure of the tree:

Binary trees can be folded or reduced (both terms are used in the programming argot) by replacing each constructor function by other functions. This higher order function is important because it generalize the pattern of many recursive programs. Higher order functions return functions as values, something that does not happen in the example in the article.

Here is the foldBinTree function, followed by a new definition of mapBinTree in terms of foldBinTree:

Here are some examples:

The above functions are much more shorter and neat than:

you can try the following examples:

The examples in the article are not clear, I mean they do not highlight the advantage to use a functional language like Caml.

After writing the above example, I discovered there is a page about OCaml with good examples. As I said before, I do not know Caml nor OCaml (if it is more than an implementation of Caml). But Caml is derived from ML a language whose formal operational semantics where defined. Given the people involved in its genesis It is highly probable that Caml, OCaml, etc. have a formal semantics defined too. Although strange things may happen, Haskell 98 did not had a formal semantics. Unbelievable but true!

So I suggest to work more on such things, like the language semantics, the functional forms (like map, fold, etc.) included in the standard library, the characteristics of it's type system. How to deal with laziness (has delay and force?), etc. When that is finished, this article may be merged with the Ocaml, for that reason a sight of that article should help to work in an style which easies the process of merging.

Also the people active in that page, may work on the subjects mentioned above, in that page, but it would be healthy to work coordinately.

2017
"OCaml, as of 2017 the main implementation of Caml"

This whole article is misleading, since the Caml language itself is not anymore in development and its fork OCaml is "the main implementation since over a decade. — Preceding unsigned comment added by 194.96.126.235 (talk) 05:36, 1 November 2017 (UTC)