From: Peter Gregory <Peter.Gregory@cis.strath.ac.uk>
To: colonna@ccr.jussieu.fr
Cc: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] using a wiki to answer low level language questions
Date: Mon, 13 Nov 2006 12:16:18 +0000 [thread overview]
Message-ID: <45586212.1070206@cis.strath.ac.uk> (raw)
In-Reply-To: <45585D13.5050401@ccr.jussieu.fr>
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
prev parent reply other threads:[~2006-11-13 12:16 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-11-13 11:54 Francois Colonna
2006-11-13 12:16 ` Peter Gregory [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=45586212.1070206@cis.strath.ac.uk \
--to=peter.gregory@cis.strath.ac.uk \
--cc=caml-list@yquem.inria.fr \
--cc=colonna@ccr.jussieu.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox