that I have to evaluate the same expression twice ...
# getting-started
n
that I have to evaluate the same expression twice (and code it twice). concrete example: I want to create objects from files in subdirs of a given path, but only if the subdir name is from a "valid" list. in the
map
i have a
when(subdirname) { "foo" -> createFoo(subdirname); "bar" -> createBar(subdirname)
. any subdirs not "foo" or "bar" I want to ignore. So I would first have to filter on the names, and then still have the "when" in the map repeating the list of valid names