Created
April 27, 2018 11:25
-
-
Save mmis1000/951107b88f77eee3128ab7659ed1b23c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var a; | |
var max = 10; | |
console.log('start') | |
for (a = 0; a < max; a++) { | |
console.log(a) | |
} | |
console.log('exit') | |
// | |
const recurr = (fn => fn( | |
(f => f(f)) | |
(self => | |
x => | |
fn(self(self))(x) | |
) | |
)) | |
recurr( | |
main=> | |
actions=> | |
branch=> | |
x=> | |
max=> | |
actions[branch](main)(actions)(x)(max) | |
) | |
({ | |
0: | |
main=> | |
actions=> | |
x=> | |
max=>( | |
console.log('start'), | |
main(actions)(1)(0)(max) | |
), | |
1: | |
main=> | |
actions=> | |
x=> | |
max=>( | |
x < max ? | |
main(actions)(2)(x)(max): | |
main(actions)(4)(x)(max) | |
), | |
2: | |
main=> | |
actions=> | |
x=> | |
max=>( | |
console.log(x), | |
main(actions)(3)(x)(max) | |
), | |
3: | |
main=> | |
actions=> | |
x=> | |
max=>( | |
main(actions)(1)(x + 1)(max) | |
), | |
4: | |
main=> | |
actions=> | |
x=> | |
max=>( | |
console.log('exit') | |
), | |
}) | |
(0) | |
(null) | |
(10) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment