2015-03-16 17 views
6

voglio calcolare binom in questo modo:Il tipo 'int' non supporta l'operatore '=='

let t = seq { 1..10 } |> Seq.takeWhile (fun e -> e % 2 == 0) 

ma il compilatore lamento

playground.fsx(27,59): error FS0001: The type 'int' does not support the operator '==' 

Che cosa sto facendo di sbagliato?

risposta

10

F # usa singola = per operatore di uguaglianza:

let t = seq { 1..10 } |> Seq.takeWhile (fun e -> e % 2 = 0) 
Problemi correlati