Freek Wiedijk
freek@cs.ru.nl
make wiedijk
./prog
gcc -E prog.c | indent | sed '1,/5.*prog/d'
C11 features definitely help this entry to be as concise as it is.
The judges would like to think that they had almost understood how this entry works.
If you win a bet by demonstrating this entry, please let us know.
w
word datatypew(*)(w,w*)
works just as well-std=c99 -Wall -Wextra -pedantic
Y
the readable implementation of Y
is on lines 29-30:
W_f = \x.f(xx) Y = \f.W_f W_f
a mixture of strict and lazy evaluation, with a _
force function
(John Tromp notes that if Turing’s fixed-point combinator
(\xy.y\z.xxyz)(\xy.y\z.xxyz)
had been used,
all applications could have been strict)
Y
to implement factorial on native int
s© Copyright 1984-2015,
Leo Broukhis, Simon Cooper, Landon Curt Noll
- All rights reserved |