File tree Expand file tree Collapse file tree 2 files changed +24
-0
lines changed
tests/compiler/expressions.t Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -24,3 +24,11 @@ let run () =
24
24
f3 1 2 3 ;
25
25
f4 1 2 3 4 ;
26
26
Funs. apply_fun ()
27
+
28
+ let lambda () =
29
+ let f () = 1 in
30
+ let f' x = 1 + x in
31
+ let f'' x y = 1 + x + y in
32
+ let _ = f () in
33
+ let _ = f' 1 in
34
+ f'' 1 2
Original file line number Diff line number Diff line change 48
48
- export ([f2/ 2 ]).
49
49
- export ([f3/ 3 ]).
50
50
- export ([f4/ 4 ]).
51
+ - export ([lambda/ 0 ]).
51
52
- export ([run/ 0 ]).
52
53
53
54
- spec f (any ()) -> any ().
73
74
f4 (1 , 2 , 3 , 4 ),
74
75
apply__funs:apply_fun ().
75
76
77
+ - spec lambda () -> integer ().
78
+ lambda () ->
79
+ F = fun
80
+ () -> 1
81
+ end ,
82
+ F_prime = fun
83
+ (X) -> erlang:'+' (1 , X)
84
+ end ,
85
+ F_prime_prime = fun
86
+ (X, Y) -> erlang:'+' (erlang:'+' (1 , X), Y)
87
+ end ,
88
+ F (),
89
+ F_prime (1 ),
90
+ F_prime_prime (1 , 2 ).
91
+
76
92
77
93
$ caramelc compile binding_on_match.ml
78
94
File "binding_on_match.ml" , line 4 , characters 57 - 68 :
You can’t perform that action at this time.
0 commit comments