Having an in-agreement discussion with Tim about Ruby. I’ll write a full post later, but for now (to make sure I don’t make an ass of myself later, if anyone has a better answer), who can port this small Python function to Ruby?
def allprefixes(x): prefixes =  for i in range(len(x)+1): prefixes.append(x[0:i]) return prefixes
>>> allprefixes([1,2,3]) [, , [1, 2], [1, 2, 3]]
See the problem? Any non-hacky solutions? (I have mine, but it is hacky, and I’ll save it for the follow-up post.)
Edit: Arg, OK I just found out about Ruby’s … operator. That makes things significantly easier (having previously known only about the .. operator). Never mind then! But it is still a nasty default.