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 95B027F02D for ; Sun, 19 Oct 2014 14:31:38 +0200 (CEST) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of gabriel.scherer@gmail.com) identity=pra; client-ip=209.85.218.41; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="gabriel.scherer@gmail.com"; x-sender="gabriel.scherer@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of gabriel.scherer@gmail.com designates 209.85.218.41 as permitted sender) identity=mailfrom; client-ip=209.85.218.41; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="gabriel.scherer@gmail.com"; x-sender="gabriel.scherer@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-oi0-f41.google.com) identity=helo; client-ip=209.85.218.41; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="gabriel.scherer@gmail.com"; x-sender="postmaster@mail-oi0-f41.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Aj8BAKWtQ1TRVdoplGdsb2JhbABbg2BYBIMCuQOOHoFwh04CgQcHFgERAQEBAQcLCwkSMIQDAQEDARIRBBkBGxILAQMBCwYFBAcDFx0CAiIBEQEFAQoSBhMIChCICAEDCQgNnXluizCBcoMQiBAKGScDCmeFSgEBAQEBAQQBAQEBAQEWAQUOkD8EB4J3gVQBBIUVBY1tgz+HE4FskkEYKYMRghw7L4JLAQEB X-IPAS-Result: Aj8BAKWtQ1TRVdoplGdsb2JhbABbg2BYBIMCuQOOHoFwh04CgQcHFgERAQEBAQcLCwkSMIQDAQEDARIRBBkBGxILAQMBCwYFBAcDFx0CAiIBEQEFAQoSBhMIChCICAEDCQgNnXluizCBcoMQiBAKGScDCmeFSgEBAQEBAQQBAQEBAQEWAQUOkD8EB4J3gVQBBIUVBY1tgz+HE4FskkEYKYMRghw7L4JLAQEB X-IronPort-AV: E=Sophos;i="5.04,749,1406584800"; d="scan'208";a="101890250" Received: from mail-oi0-f41.google.com ([209.85.218.41]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-SHA; 19 Oct 2014 14:31:37 +0200 Received: by mail-oi0-f41.google.com with SMTP id u20so2539548oif.0 for ; Sun, 19 Oct 2014 05:31:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=1c0SDfkSbRd95N+8Mg0ctx8/sWZZ8e12T8TvKot2SBI=; b=laL5AeDUFmgPXRme0IW04YJbHi61KDtbr4ooHI69HBGAJ6en4GDj3HMYUszuEwLyy+ e62Aksrjb7kaC0nAzBkgMnSzPVXBabJ9B1H/M3PZ6wPdI+rp8SjuZfgnjwEsyvnPQBiJ prqHkuZvVh+aoSKZYxZ+5Qm+D/qB5x0//u2itFcBXTXi8sFR6vbtrKnXxMXlagrUduJx w/ZW7SOq+ZkCIkyrKu0kr/XO2upxqqCh+4HoRbknrxtKJhQ+E6FEZp8Jx230dLvS/hNA Qw2TCsZ63k8EOvDfZE/5s18y7cOwAaniL4LJGNDomolYHZO+qaLZWKQFB7aRaI5X8D+r Ts9w== X-Received: by 10.202.169.207 with SMTP id s198mr16572647oie.7.1413721896778; Sun, 19 Oct 2014 05:31:36 -0700 (PDT) MIME-Version: 1.0 Received: by 10.76.105.196 with HTTP; Sun, 19 Oct 2014 05:30:56 -0700 (PDT) In-Reply-To: <5443A96B.5010505@home.nl> References: <5443A96B.5010505@home.nl> From: Gabriel Scherer Date: Sun, 19 Oct 2014 14:30:56 +0200 Message-ID: To: Roelof Wobben Cc: caml users Content-Type: multipart/alternative; boundary=001a113cd9ae7802030505c5c7ee Subject: Re: [Caml-list] reverse a list --001a113cd9ae7802030505c5c7ee Content-Type: text/plain; charset=UTF-8 Yes. As an intermediate step, you should consider implementing the function reverse_append : 'a list -> 'a list -> 'a list such that (reverse_append li1 li2) adds li1 *reversed* on top of li2. For example, reverse_append [1;2] [3;4] is [2;1;3;4]. Is there a particular reason why you're not using the ocaml_beginners list anymore? It's a good list for this kind of questions and, if you perceived a problem with it, it would be interesting to have some feedback about it. On Sun, Oct 19, 2014 at 2:07 PM, Roelof Wobben wrote: > Helllo, > > Im a beginner which tries to do the 99 ocaml problems. > > Now I try to reverse a list. > Does I need to use two list . one for the old one and one for the reversed > list. > > 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 > --001a113cd9ae7802030505c5c7ee Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Yes.

As an intermediate s= tep, you should consider implementing the function
=C2=A0 reverse_= append : 'a list -> 'a list -> 'a list
such that= (reverse_append li1 li2) adds li1 *reversed* on top of li2. For example, r= everse_append [1;2] [3;4] is [2;1;3;4].

Is there a particular = reason why you're not using the ocaml_beginners list anymore?=C2=A0 It&= #39;s a good list for this kind of questions and, if you perceived a proble= m with it, it would be interesting to have some feedback about it.

On Sun, Oct 19, = 2014 at 2:07 PM, Roelof Wobben <r.wobben@home.nl> wrote:
<= blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px= #ccc solid;padding-left:1ex">Helllo,

Im a beginner which tries to do the 99 ocaml problems.

Now I try to reverse a list.
Does I need to use two list . one for the old one and one for the reversed = list.

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

--001a113cd9ae7802030505c5c7ee--