adambard / adambard/learnxinyminutes-docs
Collection Instanciation Error : OCaml
- Lingua principale
- Markdown
- Stelle
- 12.3k
- Fork
- 3.7k
- Merge medio
- 13h 10m
- PR unite (30g)
- 6
Descrizione
I noticed an error in the `Records/A collection of values with named fields` chapter when instantiating `cow` variable:
```ocaml
type animal =
{
name: string;
color: string;
legs: int;
}
;;
let cow =
{ name: "cow";
color: "black and white";
legs: 4;
}
;;
val cow : animal
cow.name ;;
- : string = "cow"
```
This should be replaced by
```ocaml
type animal =
{
name: string;
color: string;
legs: int;
}
;;
let cow =
{ name = "cow";
color = "black and white";
legs = 4;
}
;;
(*
val cow : animal
cow.name ;;
- : string = "cow"
*)
```
Guida per i contributori
Apri la guida per i contributori
Valutazione
Questa issue non è ancora stata valutata.