From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id 6CB897FADB for ; Wed, 5 Nov 2014 19:54:44 +0100 (CET) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of mmatalka@gmail.com) identity=pra; client-ip=209.85.217.173; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="mmatalka@gmail.com"; x-sender="mmatalka@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of mmatalka@gmail.com designates 209.85.217.173 as permitted sender) identity=mailfrom; client-ip=209.85.217.173; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="mmatalka@gmail.com"; x-sender="mmatalka@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-lb0-f173.google.com) identity=helo; client-ip=209.85.217.173; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="mmatalka@gmail.com"; x-sender="postmaster@mail-lb0-f173.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AsYBACtxWlTRVdmtlGdsb2JhbABcg2JZBIMCuT6Oa4Fvh00CgRYHFgEBAQEBEQEBAQEHCwsJEjCEAwEBAwESEQQZARsSCwEDAQsGAwIEAQYDFx0CAiIBEQEFAQoSBhMSEIgJAQMJCQ2aBZA+PTGLM4FzgxGJDQoZJwMKaIVVAQEBAQEBBAEBAQEBAQEBAQESAQUOkH8EB4J3gVQFhR0FkVCHHoFukmwYKYMXghw8L4JLAQEB X-IPAS-Result: AsYBACtxWlTRVdmtlGdsb2JhbABcg2JZBIMCuT6Oa4Fvh00CgRYHFgEBAQEBEQEBAQEHCwsJEjCEAwEBAwESEQQZARsSCwEDAQsGAwIEAQYDFx0CAiIBEQEFAQoSBhMSEIgJAQMJCQ2aBZA+PTGLM4FzgxGJDQoZJwMKaIVVAQEBAQEBBAEBAQEBAQEBAQESAQUOkH8EB4J3gVQFhR0FkVCHHoFukmwYKYMXghw8L4JLAQEB X-IronPort-AV: E=Sophos;i="5.07,321,1413237600"; d="scan'208";a="105020572" Received: from mail-lb0-f173.google.com ([209.85.217.173]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-SHA; 05 Nov 2014 19:54:43 +0100 Received: by mail-lb0-f173.google.com with SMTP id n15so1210263lbi.32 for ; Wed, 05 Nov 2014 10:54:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=HSKT5xGOhqimGyHAntJXUBNMeSJHiog6PuIcMppMrO8=; b=RYz/mOL1VmdI5Q4zBtR3RPORKHZTk1V1W8AchRIdP1S/hhuuBTijW92pjgcwwoLmcA PaAWoNkCqXTd+nSlMaSFTWUZIWEL7eD8ElKS0Bnx4vIRfyE+QbIQT42fec2AV9eoofRc P7m6LePQbj2VtPHEYA2JJzsyVF1EqkMA89LUSxnFjbZU2CHp75IUDTVqxO2ZLQihznV6 bChEXaZnP4nQ64TM+spIPeBbRGlcqDMvbz1loT47ZyZVYEtXTNLjNNvgFs25IWgzHIiC 6ZWdCqzNmnBMh3msV26FmOGmWaxQSmoYYlO0A3n1MoHKdRb8j1EmCgsh92a4MNVl7Zyg xn9g== MIME-Version: 1.0 X-Received: by 10.152.7.229 with SMTP id m5mr61503482laa.32.1415213683176; Wed, 05 Nov 2014 10:54:43 -0800 (PST) Received: by 10.25.79.202 with HTTP; Wed, 5 Nov 2014 10:54:43 -0800 (PST) Received: by 10.25.79.202 with HTTP; Wed, 5 Nov 2014 10:54:43 -0800 (PST) In-Reply-To: <545A708C.6060900@home.nl> References: <545A708C.6060900@home.nl> Date: Wed, 5 Nov 2014 19:54:43 +0100 Message-ID: From: Malcolm Matalka To: Roelof Wobben Cc: caml-list Content-Type: multipart/alternative; boundary=001a11c35596ddfb500507211cd1 Subject: Re: [Caml-list] why is the variable here unbound. --001a11c35596ddfb500507211cd1 Content-Type: text/plain; charset=UTF-8 I think you mean ... in length2 list [] Den 5 nov 2014 19:47 skrev "Roelof Wobben" : > Hello, > > I asked this question also on the beginners list but till now no respons. > > I have this : > > let length list = > let rec length2 list2 acc = > match list2 with > | [] -> acc > | x::xs -> length2 xs (acc + 1) > in acc 0 list2 list ;; > > But as soon as I copie it into the ocaml prompt I see a message that the > acc in the part in acc 0 list2 list is unbound. > > Roelof > > > > -- > Caml-list mailing list. Subscription management and archives: > https://sympa.inria.fr/sympa/arc/caml-list > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs > --001a11c35596ddfb500507211cd1 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

I think you mean ... in length2 list []

Den 5 nov 2014 19:47 skrev "Roelof Wobben&q= uot; <r.wobben@home.nl>:
Hello,

I asked this question also on the beginners list but till now no respons.
I have this :

let length list =3D
=C2=A0 =C2=A0 let rec length2 list2 acc =3D
=C2=A0 =C2=A0 =C2=A0 =C2=A0 match list2 with
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0| [] -> acc
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0| x::xs -> length2 xs (acc + 1)=
=C2=A0 =C2=A0 in acc 0 list2 list ;;

But as soon as I copie it into the ocaml prompt I see a message that the ac= c in the part in acc 0 list2 list is unbound.

Roelof



--
Caml-list mailing list.=C2=A0 Subscription management and archives:
ht= tps://sympa.inria.fr/sympa/arc/caml-list
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners<= /a>
Bug reports:
http://caml.inria.fr/bin/caml-bugs
--001a11c35596ddfb500507211cd1--