sleepless night & UFOs
- Posted by Jiri Babor <J.Babor at GNS.CRI.NZ> Apr 20, 1999
- 496 views
Sorry, Guys, I know I should not even be here, I am supposed to be chasing international driving licences or packing, but I hope somebody will help me get over a nasty mental block. I need a fast function to change an arbitrary element of a sequence: s = remap( s, { i1, i2, ...., iN }, newvalue) In other words: s[i1][i2]...[iN] = newvalue where s is a nested sequence of an arbitrary depth, and i1, ..., iN are indexes of the element to be assigned the newvalue. I think it is possible, in fact I think I once devised a recursive formula to do exactly that for a version of my menus, but I just cannot find it. So, please, I already had one sleepless night! [Side note to Robert] Since we already have a 'nan' (not-a-number) quantity, can we have a similar, possibly even more useful 'thing' for general objects? Something like 'null', or 'NULL' or 'Null' in some hated environments, or 'None' in Python. 'nao' would be ok with me, but my personal preference is for 'ufo' (undefined-f...-object). Just one other thing: Ralf, your 'each' construct is an excellent idea. I also think, given plenty of time, even Gabriel will eventually like it. (Sorry, Gabriel, *any* sign of conservatism brings out the worst in me!) jiri