[toronto-lisp] OCaml
Vish Singh
vishvajitsingh at gmail.com
Fri Jan 14 04:05:57 UTC 2011
On Thu, Jan 13, 2011 at 8:04 PM, Abram Hindle
<abram.hindle at softwareprocess.es> wrote:
> On 01/13/2011 04:23 PM, D. J. Penton wrote:
>
>> Michael: You have hit the nail right on the head. Basically my
>> complaint is about syntax, and perhaps also about too many features
>> (not sure on the features issue). The syntax seems ad hoc and a
>> little cryptic. Perhaps it is no coincidence that I have also always
>> disliked C++.
>
> The let syntax is mathetmatical. You're supposed to read it out.
>
> So if I say let x be a value in the set I convert that into ocaml:
>
> let x = choose set in
>
> so let x equal a value IN
>
> then the rest follows.
>
> So what I recommend about syntax is avoid semi colons.
>
One of the things I find weird about the let-syntax in Ocaml is the
indentation style that's commonly used. Ocaml programmers don't indent
the code that follows the "in" keyword, whereas in Lisp we would
certainly indent the body of a (let (...) ...).
See, for example, the raytracer code here:
http://www.ffconsultancy.com/languages/ray_tracer/comparison.html
The let-syntax is always on the same indentation level as the code following it.
I guess that's just Ocaml's style and it makes sense in that language.
However it's something that can be confusing for a Lisp programmer at
first glance.
More information about the toronto-lisp
mailing list