2006/12/19, Christian Lerrahn < ocaml%40penpal4u.net">ocaml
penpal4u.net>:
> Hi,
> I'm having difficulties with a function that produces a synstax error
> but I just don't get it why. Maybe somebody can give me a hint. This is
> the function.
>
> (* wrapper for ghostparticles routine in Vectorop *)
> let get_ghostparticles ~particle:particle =
> let list_of_ghostparticles = Vectorop.ghostparticle_loc particle.r
> in let rec newgparticles list_of_ghostparticles ?(newghostparts = []) =
> match list_of_ghostparticles with
> [] -> newghostparts
> | (gp :: gplist) -> let newgp = { r = gp; v = particle.v } in
> newgparticles gplist (newgp :: newghostparts)
your problem is that, at the exception of toplevel let, all let must
have their in.
BUt here, the let list_of_ghostparticles, and let newgp have their in,
but not the
let rec newgparticles: you define it, but you don't use it.
.