Re: Core screwed up Utop.

"Kenneth Miller [email protected] [ocaml_beginners]" <[email protected]> Sun, 25 Sep 2016 03:21:28 +0000 (UTC)
Newsgroups gmane.comp.lang.ocaml.beginners
Message-ID <[email protected]>
With opam, you can switch your compiler version with just a command. 

    On Saturday, September 24, 2016 11:14 PM, "Douglas Lewit [email protected] [ocaml_beginners]" <[email protected]> wrote:
 

     But I did use opam!  Or at least I thought I did.    :-(     Oh well, I'm glad this is not my only computer!!!
On Sat, Sep 24, 2016 at 6:17 PM, Kenneth Miller [email protected] [ocaml_beginners] <[email protected]> wrote:

     You did all that stuff manually when you could have been using opam?? 

    On Saturday, September 24, 2016 6:20 PM, "Douglas Lewit [email protected] [ocaml_beginners]" <ocaml_beginners@yahoogroups. com> wrote:
 

     Hi everyone,
I went on github ( a real computer jungle for sure! ) and upgraded to Ocaml 4.03.  Then I installed Core, which I believe is a library containing all of Jane Street's contributions to the Ocaml language.  That screwed up my Utop installation, so I tried to reinstall Utop.  No success with that.  There were many error messages, but the primary failure had to do with a dependency called "lwt".  I did a Google search and discovered that some other Ocaml users have had problems with this dependency as well.  I'm not really sure how to fix it.  I can still use Ocaml's default top-level, which is okay, but Utop is really fantastic!  Utop is way better than Ocaml's default top-level.  Any suggestions?  Much appreciated.
Best,
Douglas Lewit
P.S.  Could someone provide some feedback on the following code?  It works well for getting every nth member of a list, but isn't there an easier way to do this?  I just thought it was a lot of work to accomplish a more or less simple task.  Thanks.
let everyNth ls n =      let rec everynth lst m =                 match lst with                 |[ ] -> [ ]                |head :: tail -> if m mod n = 0 then head :: everynth tail (m + 1)                                       else everynth tail (m + 1) in                 everynth ls 1 ;;
An interesting side note here.  This recursive function can be implemented in Ruby, but of course the syntax is a tiny bit different.  ( For example, instead of match lst with [ ] or head :: tail you would do something like if lst == [ ] then [ ] else head, *tail = lst ......... etc, etc.  But what's really interesting is that with Ruby the inner function must be declared as a lambda expression.  If it's a regular function defined using the "def" keyword then the inner function cannot "see" the variable n.  It's interesting to me how Ruby and Ocaml not only have different syntax but also somewhat different rules regarding the scope of variables within functions and nested functions.  Ruby of course is mostly object-oriented, but its creator was a very avid LISP programmer and for that reason decided to endow Ruby with certain important functional features.  So even though Ruby is mostly object-oriented the language has some powerful functional features that remind me a lot of Ocaml, LISP, Haskell, Erlang, etc, etc.  For example, Ruby does a pretty good job at recursion, currying, etc.  Okay, that's it for now.  Thanks!    

      

  #yiv2047684241 #yiv2047684241 -- #yiv2047684241ygrp-mkp {border:1px solid #d8d8d8;font-family:Arial;margin:10px 0;padding:0 10px;}#yiv2047684241 #yiv2047684241ygrp-mkp hr {border:1px solid #d8d8d8;}#yiv2047684241 #yiv2047684241ygrp-mkp #yiv2047684241hd {color:#628c2a;font-size:85%;font-weight:700;line-height:122%;margin:10px 0;}#yiv2047684241 #yiv2047684241ygrp-mkp #yiv2047684241ads {margin-bottom:10px;}#yiv2047684241 #yiv2047684241ygrp-mkp .yiv2047684241ad {padding:0 0;}#yiv2047684241 #yiv2047684241ygrp-mkp .yiv2047684241ad p {margin:0;}#yiv2047684241 #yiv2047684241ygrp-mkp .yiv2047684241ad a {color:#0000ff;text-decoration:none;}#yiv2047684241 #yiv2047684241ygrp-sponsor #yiv2047684241ygrp-lc {font-family:Arial;}#yiv2047684241 #yiv2047684241ygrp-sponsor #yiv2047684241ygrp-lc #yiv2047684241hd {margin:10px 0px;font-weight:700;font-size:78%;line-height:122%;}#yiv2047684241 #yiv2047684241ygrp-sponsor #yiv2047684241ygrp-lc .yiv2047684241ad {margin-bottom:10px;padding:0 0;}#yiv2047684241 #yiv2047684241actions {font-family:Verdana;font-size:11px;padding:10px 0;}#yiv2047684241 #yiv2047684241activity {background-color:#e0ecee;float:left;font-family:Verdana;font-size:10px;padding:10px;}#yiv2047684241 #yiv2047684241activity span {font-weight:700;}#yiv2047684241 #yiv2047684241activity span:first-child {text-transform:uppercase;}#yiv2047684241 #yiv2047684241activity span a {color:#5085b6;text-decoration:none;}#yiv2047684241 #yiv2047684241activity span span {color:#ff7900;}#yiv2047684241 #yiv2047684241activity span .yiv2047684241underline {text-decoration:underline;}#yiv2047684241 .yiv2047684241attach {clear:both;display:table;font-family:Arial;font-size:12px;padding:10px 0;width:400px;}#yiv2047684241 .yiv2047684241attach div a {text-decoration:none;}#yiv2047684241 .yiv2047684241attach img {border:none;padding-right:5px;}#yiv2047684241 .yiv2047684241attach label {display:block;margin-bottom:5px;}#yiv2047684241 .yiv2047684241attach label a {text-decoration:none;}#yiv2047684241 blockquote {margin:0 0 0 4px;}#yiv2047684241 .yiv2047684241bold {font-family:Arial;font-size:13px;font-weight:700;}#yiv2047684241 .yiv2047684241bold a {text-decoration:none;}#yiv2047684241 dd.yiv2047684241last p a {font-family:Verdana;font-weight:700;}#yiv2047684241 dd.yiv2047684241last p span {margin-right:10px;font-family:Verdana;font-weight:700;}#yiv2047684241 dd.yiv2047684241last p span.yiv2047684241yshortcuts {margin-right:0;}#yiv2047684241 div.yiv2047684241attach-table div div a {text-decoration:none;}#yiv2047684241 div.yiv2047684241attach-table {width:400px;}#yiv2047684241 div.yiv2047684241file-title a, #yiv2047684241 div.yiv2047684241file-title a:active, #yiv2047684241 div.yiv2047684241file-title a:hover, #yiv2047684241 div.yiv2047684241file-title a:visited {text-decoration:none;}#yiv2047684241 div.yiv2047684241photo-title a, #yiv2047684241 div.yiv2047684241photo-title a:active, #yiv2047684241 div.yiv2047684241photo-title a:hover, #yiv2047684241 div.yiv2047684241photo-title a:visited {text-decoration:none;}#yiv2047684241 div#yiv2047684241ygrp-mlmsg #yiv2047684241ygrp-msg p a span.yiv2047684241yshortcuts {font-family:Verdana;font-size:10px;font-weight:normal;}#yiv2047684241 .yiv2047684241green {color:#628c2a;}#yiv2047684241 .yiv2047684241MsoNormal {margin:0 0 0 0;}#yiv2047684241 o {font-size:0;}#yiv2047684241 #yiv2047684241photos div {float:left;width:72px;}#yiv2047684241 #yiv2047684241photos div div {border:1px solid #666666;min-height:62px;overflow:hidden;width:62px;}#yiv2047684241 #yiv2047684241photos div label {color:#666666;font-size:10px;overflow:hidden;text-align:center;white-space:nowrap;width:64px;}#yiv2047684241 #yiv2047684241reco-category {font-size:77%;}#yiv2047684241 #yiv2047684241reco-desc {font-size:77%;}#yiv2047684241 .yiv2047684241replbq {margin:4px;}#yiv2047684241 #yiv2047684241ygrp-actbar div a:first-child {margin-right:2px;padding-right:5px;}#yiv2047684241 #yiv2047684241ygrp-mlmsg {font-size:13px;font-family:Arial, helvetica, clean, sans-serif;}#yiv2047684241 #yiv2047684241ygrp-mlmsg table {font-size:inherit;font:100%;}#yiv2047684241 #yiv2047684241ygrp-mlmsg select, #yiv2047684241 input, #yiv2047684241 textarea {font:99% Arial, Helvetica, clean, sans-serif;}#yiv2047684241 #yiv2047684241ygrp-mlmsg pre, #yiv2047684241 code {font:115% monospace;}#yiv2047684241 #yiv2047684241ygrp-mlmsg * {line-height:1.22em;}#yiv2047684241 #yiv2047684241ygrp-mlmsg #yiv2047684241logo {padding-bottom:10px;}#yiv2047684241 #yiv2047684241ygrp-msg p a {font-family:Verdana;}#yiv2047684241 #yiv2047684241ygrp-msg p#yiv2047684241attach-count span {color:#1E66AE;font-weight:700;}#yiv2047684241 #yiv2047684241ygrp-reco #yiv2047684241reco-head {color:#ff7900;font-weight:700;}#yiv2047684241 #yiv2047684241ygrp-reco {margin-bottom:20px;padding:0px;}#yiv2047684241 #yiv2047684241ygrp-sponsor #yiv2047684241ov li a {font-size:130%;text-decoration:none;}#yiv2047684241 #yiv2047684241ygrp-sponsor #yiv2047684241ov li {font-size:77%;list-style-type:square;padding:6px 0;}#yiv2047684241 #yiv2047684241ygrp-sponsor #yiv2047684241ov ul {margin:0;padding:0 0 0 8px;}#yiv2047684241 #yiv2047684241ygrp-text {font-family:Georgia;}#yiv2047684241 #yiv2047684241ygrp-text p {margin:0 0 1em 0;}#yiv2047684241 #yiv2047684241ygrp-text tt {font-size:120%;}#yiv2047684241 #yiv2047684241ygrp-vital ul li:last-child {border-right:none !important;}#yiv2047684241