Implement dictionary support for apply+for

fixes #7561