ocaml
OCaml version 4.08.1
# let variable_name = 5;;
val variable_name : int = 5
# variable_name;;
- : int = 5
# variable_name+1;;
- : int = 6
# let first_input = 4;;
val first_input : int = 4
# let second_input = 6;;
val second_input : int = 6
# first_input * second_input;;
- : int = 24
# let first_input = 5;;
val first_input : int = 5
# let product = first_input * second_input;;
val product : int = 30
# let first_input = 4;;
val first_input : int = 4
# product;;
- : int = 30
# let b = true;;
val b : bool = true
# b;;
- : bool = true
주의**
재할당하려면
let second_input = 6;;처럼 해주어야 한다.
'Computer Science > 프로그래밍언어' 카테고리의 다른 글
OCaml Tutorial | Introduction to Lists (0) | 2022.03.08 |
---|---|
OCaml Tutorial | Introduction to Pattern Matching (0) | 2022.03.08 |
OCaml Tutorial | Introduction to Functions (0) | 2022.03.08 |
OCaml Tutorial | Conditional Statements (0) | 2022.03.08 |
OCaml Tutorial | Primitives and Expressions (0) | 2022.03.08 |