ELF = Executable and Linkable Format
Relocatable file
| let fib_help f= match f with | |
| [|a;b|]->[|b;a+b|] | |
| |_->raise(Invalid_argument "f must be a int array");; | |
| let rec fib n = match n with | |
| 1->[|0;1|] | |
| |n->fib_help( fib(n-1) );; | |
| (* (0, 1) => (1, 1) => (1, 2) => (2, 3) => (3, 5) => ... *) |
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| import functools | |
| def dp(start=[]): | |
| def decor(func): | |
| func.dp = start.copy() | |
| @functools.wraps(func) | |
| def wrapper(*args, **kwargs): |
Coroutine (大陸翻做 "協程") 這個詞是由 Melvin Conway 在 1963 年所提出來的, 指的是提供多個 entry points 的 subroutine (子程式),讓 code 可以在執行到一些地方後暫停/繼續。