Structured interactive programming