-
Notifications
You must be signed in to change notification settings - Fork 0
/
notes.pl
69 lines (49 loc) · 1.26 KB
/
notes.pl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
Ruby generator as iterator:
def meth(fargs)
...
yield A_z
end
obj.meth(args) { | F_z |
...
}
Python generator as iterator:
def meth(fargs):
...
yield A_z
for F_z in itergen(obj.meth(args)):
...
Name arguments:
####### Forward: (ret1, ret2,...)func(arg1,arg2,...):
def (list)split(pattern, string):
while ...
...
list.push(item:chunk)
...
return
def (list)sort(list)
while ...
list.push(item)list.remove(index)
def munge(string):
(list)split(pattern:":", string)
(list)sort(list)
print(list)
#...or munge could be...
def munge(string):
print(list)sort(list)split(pattern:":", string)
####### Reverse: (arg1,arg2,...)func(ret1, ret2,...):
def (pattern, string)split(list):
while ...
...
(item:chunk)list.push
...
return
def (list)sort(list)
while ...
(index)list.remove(item)list.push
def (string)munge:
(pattern:":", string)split(list)
(list)sort(list)
(list)print
#...or munge could be...
def munge(string):
(pattern:":", string)split(list)sort(list)print