Loading ...
Sorry, an error occurred while loading the content.

"ocaml_beginners"::[] Re: Generate the combinations of K distinct objects chosen from an N-element list

Expand Messages
  • roparzhhemon
    ... I optimize for readability. If I understood the original question correctly, the point was to create a polymorphic function that works as well, say, on
    Message 1 of 9 , Nov 13, 2006
    • 0 Attachment
      --- In ocaml_beginners@yahoogroups.com, Radu Grigore <radugrigore@...> wrote:
      >
      > This is probably a question of personal taste, but I would not use l as a variable name when
      I optimize for readability.

      If I understood the original question correctly, the point was to create a "polymorphic"
      function that works as well, say, on ["a";"b";"c";"d"] as on [1;2;3;4]. This is why the
      *list* l (and not just its length n) is an argument in my function.


      Ewan
    • Radu Grigore
      ... I did not understand the question that way, but it is a minor difference. In case it was not clear, my point was that 1 and l, as 0 and O look very similar
      Message 2 of 9 , Nov 14, 2006
      • 0 Attachment
        --- roparzhhemon <roparzhhemon@...> wrote:

        > If I understood the original question correctly, the point was to
        > create a "polymorphic"
        > function that works as well, say, on ["a";"b";"c";"d"] as on
        > [1;2;3;4]. This is why the
        > *list* l (and not just its length n) is an argument in my function.

        I did not understand the question that way, but it is a minor
        difference.

        In case it was not clear, my point was that 1 and l, as 0 and O look
        very similar when rendered with certain fonts that are common for
        source code editing. So it is a bad idea to use them as variable
        names if you aim for readability.

        PS:
        let cons h t = h::t;;
        let rec comb es k = match (es, k) with
        | ([], 0) -> [[]]
        | ([], _) -> []
        | (h::t, _) ->
        List.rev_append
        (List.map (cons h) (comb t (k-1)))
        (comb t k);;





        ____________________________________________________________________________________
        Do you Yahoo!?
        Everyone is raving about the all-new Yahoo! Mail beta.
        http://new.mail.yahoo.com
      • MOHAMED TEYEB
        hi, Plz i want a solution (quickly)... first do you speak french?? if you does you will find the subject of the project in the files added else do you have
        Message 3 of 9 , Nov 15, 2006
        • 0 Attachment
          hi,
          Plz i want a solution (quickly)...
          first do you speak french??
          if you does you will find the subject of the project in the files added
          else do you have any idea about mini-interpreter of basic in ocaml ??
          else
          you can go in this url
          http://f.loulergue.free.fr/teaching/2007/l2-ocaml/devoir_de_programmation_2006-2007.tar.gz and you will find the mini-interpreter of basic in ocaml with many function incomplet
          if ou can help me and finish some or all this functions....
          think you and by
          Radu Grigore <radugrigore@...> a écrit :
          --- roparzhhemon <roparzhhemon@...> wrote:

          > If I understood the original question correctly, the point was to
          > create a "polymorphic"
          > function that works as well, say, on ["a";"b";"c";"d"] as on
          > [1;2;3;4]. This is why the
          > *list* l (and not just its length n) is an argument in my function.

          I did not understand the question that way, but it is a minor
          difference.

          In case it was not clear, my point was that 1 and l, as 0 and O look
          very similar when rendered with certain fonts that are common for
          source code editing. So it is a bad idea to use them as variable
          names if you aim for readability.

          PS:
          let cons h t = h::t;;
          let rec comb es k = match (es, k) with
          | ([], 0) -> [[]]
          | ([], _) -> []
          | (h::t, _) ->
          List.rev_append
          (List.map (cons h) (comb t (k-1)))
          (comb t k);;

          __________________________________________________________
          Do you Yahoo!?
          Everyone is raving about the all-new Yahoo! Mail beta.
          http://new.mail.yahoo.com





          ---------------------------------
          Découvrez une nouvelle façon d'obtenir des réponses à toutes vos questions ! Profitez des connaissances, des opinions et des expériences des internautes sur Yahoo! Questions/Réponses.

          [Non-text portions of this message have been removed]
        • Lee Render
          I don t think it s appropriate you re requesting others to complete an assignment for you in a public forum. I ve cc ed your your Professor ...
          Message 4 of 9 , Nov 15, 2006
          • 0 Attachment
            I don't think it's appropriate you're requesting
            others to complete an assignment for you in a public
            forum.

            I've cc'ed your your Professor


            --- MOHAMED TEYEB <mohamed_teyeb1@...> wrote:

            > hi,
            > Plz i want a solution (quickly)...
            > first do you speak french??
            > if you does you will find the subject of the
            > project in the files added
            > else do you have any idea about mini-interpreter
            > of basic in ocaml ??
            > else
            > you can go in this url
            >
            >
            http://f.loulergue.free.fr/teaching/2007/l2-ocaml/devoir_de_programmation_2006-2007.tar.gz
            > and you will find the mini-interpreter of basic in
            > ocaml with many function incomplet
            > if ou can help me and finish some or all this
            > functions....
            > think you and by
            > Radu Grigore <radugrigore@...> a écrit :
            > --- roparzhhemon
            > <roparzhhemon@...> wrote:
            >
            > > If I understood the original question correctly,
            > the point was to
            > > create a "polymorphic"
            > > function that works as well, say, on
            > ["a";"b";"c";"d"] as on
            > > [1;2;3;4]. This is why the
            > > *list* l (and not just its length n) is an
            > argument in my function.
            >
            > I did not understand the question that way, but it
            > is a minor
            > difference.
            >
            > In case it was not clear, my point was that 1 and l,
            > as 0 and O look
            > very similar when rendered with certain fonts that
            > are common for
            > source code editing. So it is a bad idea to use them
            > as variable
            > names if you aim for readability.
            >
            > PS:
            > let cons h t = h::t;;
            > let rec comb es k = match (es, k) with
            > | ([], 0) -> [[]]
            > | ([], _) -> []
            > | (h::t, _) ->
            > List.rev_append
            > (List.map (cons h) (comb t (k-1)))
            > (comb t k);;
            >
            >
            __________________________________________________________
            > Do you Yahoo!?
            > Everyone is raving about the all-new Yahoo! Mail
            > beta.
            > http://new.mail.yahoo.com
            >
            >
            >
            >
            >
            > ---------------------------------
            > Découvrez une nouvelle façon d'obtenir des réponses
            > à toutes vos questions ! Profitez des connaissances,
            > des opinions et des expériences des internautes sur
            > Yahoo! Questions/Réponses.
            >
            > [Non-text portions of this message have been
            > removed]
            >
            >
            >
            > Archives up to November 11, 2006 are also
            > downloadable at
            >
            http://www.connettivo.net/cntprojects/ocaml_beginners/
            > The archives of the very official ocaml list (the
            > seniors' one) can be found at http://caml.inria.fr
            > Attachments are banned and you're asked to be
            > polite, avoid flames etc.
            > Yahoo! Groups Links
            >
            > (Yahoo! ID required)
            >
            > mailto:ocaml_beginners-fullfeatured@yahoogroups.com
            >
            >
            >
            >


            "Work hard; increase production; prevent accidents, and be happy."
            - thx1138



            ____________________________________________________________________________________
            Sponsored Link

            $200,000 mortgage for $660/ mo -
            30/15 yr fixed, reduce debt -
            http://yahoo.ratemarketplace.com
          • Stalkern 2
            ... I ve not followed your URL, but yes, I have an idea : http://caml.inria.fr/pub/docs/oreilly-book/html/book-ora058.html Or go for page 155 of the hardcopy
            Message 5 of 9 , Nov 15, 2006
            • 0 Attachment
              MOHAMED TEYEB wrote:
              > hi,
              > Plz i want a solution (quickly)...
              > first do you speak french??
              > if you does you will find the subject of the project in the files added
              > else do you have any idea about mini-interpreter of basic in ocaml ??

              I've not followed your URL, but yes, I have an "idea":
              http://caml.inria.fr/pub/docs/oreilly-book/html/book-ora058.html

              Or go for page 155 of the hardcopy in French.

              Ernesto
            • Radu Grigore
              ... I believe it s inappropriate to ask a question that shows no effort to solve it yourself even in a private forum.
              Message 6 of 9 , Nov 15, 2006
              • 0 Attachment
                --- Lee Render <id2359@...> wrote:
                > I don't think it's appropriate you're requesting
                > others to complete an assignment for you in a public
                > forum.

                I believe it's inappropriate to ask a question that shows no effort
                to solve it yourself even in a private forum.





                ____________________________________________________________________________________
                Sponsored Link

                Mortgage rates near 39yr lows.
                $510k for $1,698/mo. Calculate new payment!
                www.LowerMyBills.com/lre
              • MOHAMED TEYEB
                ok all right i am sorry ...but i does t meany complete an assignment for me : i search any buddy can help me to finish my assignment... Lee Render
                Message 7 of 9 , Nov 15, 2006
                • 0 Attachment
                  ok all right
                  i am sorry ...but i does't meany complete an assignment for me : i search any buddy can help me to finish my assignment...


                  Lee Render <id2359@...> a écrit :
                  I don't think it's appropriate you're requesting
                  others to complete an assignment for you in a public
                  forum.

                  I've cc'ed your your Professor

                  --- MOHAMED TEYEB <mohamed_teyeb1@...> wrote:

                  > hi,
                  > Plz i want a solution (quickly)...
                  > first do you speak french??
                  > if you does you will find the subject of the
                  > project in the files added
                  > else do you have any idea about mini-interpreter
                  > of basic in ocaml ??
                  > else
                  > you can go in this url
                  >
                  >
                  http://f.loulergue.free.fr/teaching/2007/l2-ocaml/devoir_de_programmation_2006-2007.tar.gz
                  > and you will find the mini-interpreter of basic in
                  > ocaml with many function incomplet
                  > if ou can help me and finish some or all this
                  > functions....
                  > think you and by
                  > Radu Grigore <radugrigore@...> a écrit :
                  > --- roparzhhemon
                  > <roparzhhemon@...> wrote:
                  >
                  > > If I understood the original question correctly,
                  > the point was to
                  > > create a "polymorphic"
                  > > function that works as well, say, on
                  > ["a";"b";"c";"d"] as on
                  > > [1;2;3;4]. This is why the
                  > > *list* l (and not just its length n) is an
                  > argument in my function.
                  >
                  > I did not understand the question that way, but it
                  > is a minor
                  > difference.
                  >
                  > In case it was not clear, my point was that 1 and l,
                  > as 0 and O look
                  > very similar when rendered with certain fonts that
                  > are common for
                  > source code editing. So it is a bad idea to use them
                  > as variable
                  > names if you aim for readability.
                  >
                  > PS:
                  > let cons h t = h::t;;
                  > let rec comb es k = match (es, k) with
                  > | ([], 0) -> [[]]
                  > | ([], _) -> []
                  > | (h::t, _) ->
                  > List.rev_append
                  > (List.map (cons h) (comb t (k-1)))
                  > (comb t k);;
                  >
                  >
                  __________________________________________________________
                  > Do you Yahoo!?
                  > Everyone is raving about the all-new Yahoo! Mail
                  > beta.
                  > http://new.mail.yahoo.com
                  >
                  >
                  >
                  >
                  >
                  > ---------------------------------
                  > Découvrez une nouvelle façon d'obtenir des réponses
                  > à toutes vos questions ! Profitez des connaissances,
                  > des opinions et des expériences des internautes sur
                  > Yahoo! Questions/Réponses.
                  >
                  > [Non-text portions of this message have been
                  > removed]
                  >
                  >
                  >
                  > Archives up to November 11, 2006 are also
                  > downloadable at
                  >
                  http://www.connettivo.net/cntprojects/ocaml_beginners/
                  > The archives of the very official ocaml list (the
                  > seniors' one) can be found at http://caml.inria.fr
                  > Attachments are banned and you're asked to be
                  > polite, avoid flames etc.
                  > Yahoo! Groups Links
                  >
                  > (Yahoo! ID required)
                  >
                  > mailto:ocaml_beginners-fullfeatured@yahoogroups.com
                  >
                  >
                  >
                  >

                  "Work hard; increase production; prevent accidents, and be happy."
                  - thx1138

                  __________________________________________________________
                  Sponsored Link

                  $200,000 mortgage for $660/ mo -
                  30/15 yr fixed, reduce debt -
                  http://yahoo.ratemarketplace.com





                  ---------------------------------
                  Yahoo! Mail réinvente le mail ! Découvrez le nouveau Yahoo! Mail et son interface révolutionnaire.

                  [Non-text portions of this message have been removed]
                • Jon Harrop
                  ... If you guys could go ahead and make some kickass products for me (quickly), that d be great. -- Dr Jon D Harrop, Flying Frog Consultancy Ltd. Objective
                  Message 8 of 9 , Nov 15, 2006
                  • 0 Attachment
                    On Wednesday 15 November 2006 16:02, Radu Grigore wrote:
                    > --- Lee Render <id2359@...> wrote:
                    > > I don't think it's appropriate you're requesting
                    > > others to complete an assignment for you in a public
                    > > forum.
                    >
                    > I believe it's inappropriate to ask a question that shows no effort
                    > to solve it yourself even in a private forum.

                    If you guys could go ahead and make some kickass products for me (quickly),
                    that'd be great.

                    --
                    Dr Jon D Harrop, Flying Frog Consultancy Ltd.
                    Objective CAML for Scientists
                    http://www.ffconsultancy.com/products/ocaml_for_scientists
                  Your message has been successfully submitted and would be delivered to recipients shortly.