My favorites | Sign in
Project Logo
                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
def append(head=None,tail=None,result=None):
h = head is not None
t = tail is not None
r = result is not None

if h and t and not r:
result = head+tail

elif h and r and not t:
assert result[:len(head)] == head
tail = result[len(head):]

elif t and r and not h:
if not tail:
head = result
else:
assert result[-len(tail):] == tail
head = result[:-len(tail)]

elif h and t and r:
assert head+tail == result
Show details Hide details

Change log

r5 by markluffel on Jul 30, 2008   Diff
removing returns to make it more
predicate-like
Go to: 
Project members, sign in to write a code review

Older revisions

r4 by markluffel on Jul 30, 2008   Diff
example of a function where
exit_content might possible make some
bit of sense
All revisions of this file

File info

Size: 533 bytes, 21 lines
Hosted by Google Code