fork(1) download
  1. type
  2. intfunctor = function(x: integer): integer;
  3.  
  4. function compose(f, g: intfunctor): intfunctor;
  5. function h(x: integer): integer;
  6. begin
  7. h := f(g(x))
  8. end;
  9. begin
  10. compose := intfunctor(@h)
  11. end;
  12.  
  13. function dbl(x: integer): integer;
  14. begin
  15. dbl := x * 2
  16. end;
  17.  
  18. function square(x: integer): integer;
  19. begin
  20. square := x * x
  21. end;
  22.  
  23. begin
  24. write(compose(@dbl, @square)(5))
  25. end.
Runtime error #stdin #stdout #stderr 0s 336KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
Runtime error 216 at $00000000004001F3
  $00000000004001F3