Ocaml equivalent for Lisp's let*?
문제
I'd rather use let ... and ... and ... in
than nested let
's when possible, but the normal let syntax doesn't allow this for expressions that depend on each other.
Not allowed:
let encrypt password =
let seed = int 16
and keys = xlat seed (length password)
and plaintext = map code (explode password) in
map2 logxor plaintext keys
Does OCaml have an equivalent to Lisp's let*
, which does allow this?
해결책
Nested let
's don't need nested indentation, so that's good enough.
제휴하지 않습니다 StackOverflow