Member functions are always recursive; no keyword is required rec:
member this.mux xs ys =
(and even if there is a keyword rec, it will go to this, just like private- member rec this.mux ...)
, , .. this.mux mux:
member this.mux xs ys =
match xs with
| [] -> ys
| x::xt -> x :: this.mux ys xt
- ,
( )
let - . :
let f x = x+5
let f x = x-2
let a = f 5
( ) , . :
let sendEmail email subject body =
let email = canonicalize email
...
, , , - , (: "" email, , ).
email email. "".
, email email. , email : , email email , , .
" " - - " email ? " " ?". . , . :
let notifyUsers sendEmail log =
let sendEmail name =
log ("Notifying " + name)
sendEmail (name + "@contoso.com")
sendEmail "John"
sendEmail "Mark"
sendEmail "Matthew"
sendEmail "Luke"
"" sendEmail , sendEmail. "" sendEmail (.. let rec sendEmail name = ...), : . , .
- : , .
- .
, : ... , - .
, Haskell, , . , .