File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed
Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change 1919# (import std.Macros)
2020# (-> "f0" f1) # equivalent to (f1 "f0")
2121# (-> "f0" f1 f2 f3) # equivalent to (f3 (f2 (f1 "f0")))
22- # (-> "f0" f1 (apply _ f2) (apply _ f3)) # equivalent to (apply (apply (f1 "f0") f2) f3)
22+ # (-> "f0" f1 (foo _ f2) (bar _ f3)) # equivalent to (bar (foo (f1 "f0") f2) f3)
2323# =end
2424# @author https://github.com/SuperFola
2525(macro -> (arg fn1 ...fns) {
Original file line number Diff line number Diff line change 77 (+ data "-f2")))
88(let f3 (fun (data)
99 (+ data "-f3")))
10- (let apply (fun (data f)
10+ (let foo (fun (data f)
1111 (f data)))
1212
1313(let test_func (fun (a b c) (* a b c)))
1919 (test:case "->" {
2020 (test:eq (-> "f0" f1) "f0-f1")
2121 (test:eq (-> "f0" f1 f2 f3) "f0-f1-f2-f3")
22- (test:eq (-> "f0" f1 (apply _ f2) (apply _ f3)) "f0-f1-f2-f3") })
22+ (test:eq (-> "f0" f1 (foo _ f2) (foo _ f3)) "f0-f1-f2-f3") })
2323
2424 (test:case "partial & partial2" {
2525 (test:eq (test_func1 2 3) 6)
You can’t perform that action at this time.
0 commit comments