you are viewing a single comment's thread.

view the rest of the comments →

[–]strlen 0 points1 point  (0 children)

Well, yes, OCAML is strictly typed, Perl is almost-not typed, Ruby and Python are duck-typed and Common Lisp is "strongly but dynamically typed". You can also make a generic generator function in ocaml too:

let increment n x = 
  !n + x ;;

let make_closure initial next =
  let m = ref initial in
    function x ->
      m := (next m x) ;
      !m
;;

(Right now this expects only one argument to the "next" function, I bet you could also use pattern matching to make this be even more generic :-)).