A function can be defined with the following matching criteria
- Word constraint
- Type constraint
- Value constraint
| (A number := 12) | |
| (A bit of text := "Here there is some text") | |
| (println (join (A bit of text) " and the number " (A number))) | |
| (Sum of things := ((A number) + 5)) | |
| (i, j := (tuple of 12 and 16)) | |
| (My List := (range from 1 to 5)) | |
| (lambda (x) (x * 2) | |
| ; => implicit function of x -> x * 2 | |
| (map (My List) by (lambda (x) (x * 2))) | |
| ; => [2 4 6 8 10] | |
| (map (My List) by (* 2)) | |
| ; => [2 4 6 8 10] | |
| ; Examples for 1. | |
| (pattern (range from (a : Int) to (b : Int)) | |
| (the range := (empty list)) | |
| (for (i) from a to b by (+ 1) do | |
| (append (i) to (the range)) | |
| ) | |
| ) | |