Content deleted Content added
No edit summary |
No edit summary |
||
Line 14:
'''join "", map { -d $_ && ! -d "./$_" } map { chr( $_ ) . ':' } ord( 'A' ) .. ord( 'Z' )'''
The inner '''map''' returns the set '''"A" .. "Z"'''; the middle '''map''' converts this to the set '''"A:" .. "Z:"'''; and the outer map applies the logical conjunct to each member of the colon-embellished set, the results of those 26 logical evaluations being concatenated by the '''join'''. The resultant expression will be blank if and only if none of the 26 drives tested for was found to exist; otherwise, it will be a valid number belonging to the set { 1, 11, 111, ..., 11111111111111111111111111 }.
which actually applies the preceding logical test to the complete set '''A:''' through '''Z:''' of possible drives. Each test that succeeds returns a "1" while each that fails returns the empty string. Thus, if one or more of the drives exists, the return value will be a nonzero number, albeit possibly as large as 11111111111111111111111111.
|