caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* using a wiki to answer low level language questions
@ 2006-11-13 11:54 Francois Colonna
  2006-11-13 12:16 ` [Caml-list] " Peter Gregory
  0 siblings, 1 reply; 2+ messages in thread
From: Francois Colonna @ 2006-11-13 11:54 UTC (permalink / raw)
  To: caml-list

Hello,

very often I  have great difficulties to understand why I got a 
compilation error in OCaml.
Instead of polluting this list with low level questions I give the 
erroneous code and the questions
I have on the wiki page
http://galileo.lct.jussieu.fr/~frames/WIKI/mediawiki/index.php/OCaml_Difficulty_serialize_list

I shall be very grateful if some of you would be interested to go there 
and solve my problem.

François Colonna


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Caml-list] using a wiki to answer low level language questions
  2006-11-13 11:54 using a wiki to answer low level language questions Francois Colonna
@ 2006-11-13 12:16 ` Peter Gregory
  0 siblings, 0 replies; 2+ messages in thread
From: Peter Gregory @ 2006-11-13 12:16 UTC (permalink / raw)
  To: colonna; +Cc: caml-list

Francois Colonna wrote:
> Hello,
> 
> very often I  have great difficulties to understand why I got a 
> compilation error in OCaml.
> Instead of polluting this list with low level questions I give the 
> erroneous code and the questions
> I have on the wiki page
> http://galileo.lct.jussieu.fr/~frames/WIKI/mediawiki/index.php/OCaml_Difficulty_serialize_list 
> 
> 
> I shall be very grateful if some of you would be interested to go there 
> and solve my problem.
> 
> François Colonna
> 

I don't really think it was too long a problem to post on the mailing 
list, and it would probably help others to list the code here anyway:

#let rec serialize_list string_list_a glue_a =
  begin
     match string_list_a with
     []         -> ""
     | head::rest -> (glue_with glue_a head (serialize_list rest 
glue_a))
  end 

;;
val serialize_list : string list -> string -> string = <fun>

# serialize_list ["a";"b";"c"] "--";; 

- : string = "a--b--c--"


Your problem was simply one of syntax, look at what you wrote:

  | head::rest -> glue_with (glue_a head serialize_list( rest glue_a ))

Your function glue_with takes three parameters, not one.

Cheers,
Peter.

> _______________________________________________
> Caml-list mailing list. Subscription management:
> http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
> Archives: http://caml.inria.fr
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-11-13 12:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-11-13 11:54 using a wiki to answer low level language questions Francois Colonna
2006-11-13 12:16 ` [Caml-list] " Peter Gregory

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).