Re: Core screwed up Utop.

"Kenneth Miller [email protected] [ocaml_beginners]" <[email protected]> Sat, 24 Sep 2016 23:17:08 +0000 (UTC)
Newsgroups gmane.comp.lang.ocaml.beginners
Message-ID <[email protected]>
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]" <[email protected]> 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!    #yiv3559631577 #yiv3559631577 -- #yiv3559631577ygrp-mkp {border:1px solid #d8d8d8;font-family:Arial;margin:10px 0;padding:0 10px;}#yiv3559631577 #yiv3559631577ygrp-mkp hr {border:1px solid #d8d8d8;}#yiv3559631577 #yiv3559631577ygrp-mkp #yiv3559631577hd {color:#628c2a;font-size:85%;font-weight:700;line-height:122%;margin:10px 0;}#yiv3559631577 #yiv3559631577ygrp-mkp #yiv3559631577ads {margin-bottom:10px;}#yiv3559631577 #yiv3559631577ygrp-mkp .yiv3559631577ad {padding:0 0;}#yiv3559631577 #yiv3559631577ygrp-mkp .yiv3559631577ad p {margin:0;}#yiv3559631577 #yiv3559631577ygrp-mkp .yiv3559631577ad a {color:#0000ff;text-decoration:none;}#yiv3559631577 #yiv3559631577ygrp-sponsor #yiv3559631577ygrp-lc {font-family:Arial;}#yiv3559631577 #yiv3559631577ygrp-sponsor #yiv3559631577ygrp-lc #yiv3559631577hd {margin:10px 0px;font-weight:700;font-size:78%;line-height:122%;}#yiv3559631577 #yiv3559631577ygrp-sponsor #yiv3559631577ygrp-lc .yiv3559631577ad {margin-bottom:10px;padding:0 0;}#yiv3559631577 #yiv3559631577actions {font-family:Verdana;font-size:11px;padding:10px 0;}#yiv3559631577 #yiv3559631577activity {background-color:#e0ecee;float:left;font-family:Verdana;font-size:10px;padding:10px;}#yiv3559631577 #yiv3559631577activity span {font-weight:700;}#yiv3559631577 #yiv3559631577activity span:first-child {text-transform:uppercase;}#yiv3559631577 #yiv3559631577activity span a {color:#5085b6;text-decoration:none;}#yiv3559631577 #yiv3559631577activity span span {color:#ff7900;}#yiv3559631577 #yiv3559631577activity span .yiv3559631577underline {text-decoration:underline;}#yiv3559631577 .yiv3559631577attach {clear:both;display:table;font-family:Arial;font-size:12px;padding:10px 0;width:400px;}#yiv3559631577 .yiv3559631577attach div a {text-decoration:none;}#yiv3559631577 .yiv3559631577attach img {border:none;padding-right:5px;}#yiv3559631577 .yiv3559631577attach label {display:block;margin-bottom:5px;}#yiv3559631577 .yiv3559631577attach label a {text-decoration:none;}#yiv3559631577 blockquote {margin:0 0 0 4px;}#yiv3559631577 .yiv3559631577bold {font-family:Arial;font-size:13px;font-weight:700;}#yiv3559631577 .yiv3559631577bold a {text-decoration:none;}#yiv3559631577 dd.yiv3559631577last p a {font-family:Verdana;font-weight:700;}#yiv3559631577 dd.yiv3559631577last p span {margin-right:10px;font-family:Verdana;font-weight:700;}#yiv3559631577 dd.yiv3559631577last p span.yiv3559631577yshortcuts {margin-right:0;}#yiv3559631577 div.yiv3559631577attach-table div div a {text-decoration:none;}#yiv3559631577 div.yiv3559631577attach-table {width:400px;}#yiv3559631577 div.yiv3559631577file-title a, #yiv3559631577 div.yiv3559631577file-title a:active, #yiv3559631577 div.yiv3559631577file-title a:hover, #yiv3559631577 div.yiv3559631577file-title a:visited {text-decoration:none;}#yiv3559631577 div.yiv3559631577photo-title a, #yiv3559631577 div.yiv3559631577photo-title a:active, #yiv3559631577 div.yiv3559631577photo-title a:hover, #yiv3559631577 div.yiv3559631577photo-title a:visited {text-decoration:none;}#yiv3559631577 div#yiv3559631577ygrp-mlmsg #yiv3559631577ygrp-msg p a span.yiv3559631577yshortcuts {font-family:Verdana;font-size:10px;font-weight:normal;}#yiv3559631577 .yiv3559631577green {color:#628c2a;}#yiv3559631577 .yiv3559631577MsoNormal {margin:0 0 0 0;}#yiv3559631577 o {font-size:0;}#yiv3559631577 #yiv3559631577photos div {float:left;width:72px;}#yiv3559631577 #yiv3559631577photos div div {border:1px solid #666666;min-height:62px;overflow:hidden;width:62px;}#yiv3559631577 #yiv3559631577photos div label {color:#666666;font-size:10px;overflow:hidden;text-align:center;white-space:nowrap;width:64px;}#yiv3559631577 #yiv3559631577reco-category {font-size:77%;}#yiv3559631577 #yiv3559631577reco-desc {font-size:77%;}#yiv3559631577 .yiv3559631577replbq {margin:4px;}#yiv3559631577 #yiv3559631577ygrp-actbar div a:first-child {margin-right:2px;padding-right:5px;}#yiv3559631577 #yiv3559631577ygrp-mlmsg {font-size:13px;font-family:Arial, helvetica, clean, sans-serif;}#yiv3559631577 #yiv3559631577ygrp-mlmsg table {font-size:inherit;font:100%;}#yiv3559631577 #yiv3559631577ygrp-mlmsg select, #yiv3559631577 input, #yiv3559631577 textarea {font:99% Arial, Helvetica, clean, sans-serif;}#yiv3559631577 #yiv3559631577ygrp-mlmsg pre, #yiv3559631577 code {font:115% monospace;}#yiv3559631577 #yiv3559631577ygrp-mlmsg * {line-height:1.22em;}#yiv3559631577 #yiv3559631577ygrp-mlmsg #yiv3559631577logo {padding-bottom:10px;}#yiv3559631577 #yiv3559631577ygrp-msg p a {font-family:Verdana;}#yiv3559631577 #yiv3559631577ygrp-msg p#yiv3559631577attach-count span {color:#1E66AE;font-weight:700;}#yiv3559631577 #yiv3559631577ygrp-reco #yiv3559631577reco-head {color:#ff7900;font-weight:700;}#yiv3559631577 #yiv3559631577ygrp-reco {margin-bottom:20px;padding:0px;}#yiv3559631577 #yiv3559631577ygrp-sponsor #yiv3559631577ov li a {font-size:130%;text-decoration:none;}#yiv3559631577 #yiv3559631577ygrp-sponsor #yiv3559631577ov li {font-size:77%;list-style-type:square;padding:6px 0;}#yiv3559631577 #yiv3559631577ygrp-sponsor #yiv3559631577ov ul {margin:0;padding:0 0 0 8px;}#yiv3559631577 #yiv3559631577ygrp-text {font-family:Georgia;}#yiv3559631577 #yiv3559631577ygrp-text p {margin:0 0 1em 0;}#yiv3559631577 #yiv3559631577ygrp-text tt {font-size:120%;}#yiv3559631577 #yiv3559631577ygrp-vital ul li:last-child {border-right:none !important;}#yiv3559631577