파이썬의 방언이고 인터프리터는 고로 구현됐다네
예시만으로는 파이썬이랑 뭐가 다른지 모르겠네
Run the interpreter:
$ cat coins.sky
coins = {
'dime': 10,
'nickel': 5,
'penny': 1,
'quarter': 25,
}
print('By name:\t' + ', '.join(sorted(coins.keys())))
print('By value:\t' + ', '.join(sorted(coins.keys(), cmp=lambda x, y: coins[x] - coins[y])))
$ ./skylark -lambda coins.sky
By name: dime, nickel, penny, quarter
By value: penny, nickel, dime, quarter
Interact with the read-eval-print loop (REPL):
$ ./skylark
>>> def fibonacci(n):
... res = range(n)
... for i in res[2:]:
... res[i] = res[i-2] + res[i-1]
... return res
...
>>> fibonacci(10)
[0, 1, 1, 2, 3, 5, 8, 13, 21, 34]
댓글 0