You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In exercise "Windowing System", sub exercise 7, user is asked to create a Window and adjust its properties by using methods.
As Swift disallows expressions at the top level except for in the main file, the user cannot simply adjust the window properties at top level. The apparent solution is to use a closure that is immediately executed. While I was familiar with this concept from JS, it was not immediately obvious to me as a solution here. The possibility to immediately execute a closure is mentioned in passing in the Syllabus for "Closures" but it is not practiced in the corresponding learning exercise ("Double-Null0111: Closures Are Forever"). I think it is not immediately obvious for especially beginning Users that the sub-exercise in "Windowing System" can be resolved this way.
I would propose that this way of applying closures is explicitly practiced as such in "Double-Null0111: Closures Are Forever" and/or the Syllabus is adapted to make this application (the usages of closures to enable top-level execution code) explicit.
The text was updated successfully, but these errors were encountered:
In exercise "Windowing System", sub exercise 7, user is asked to create a Window and adjust its properties by using methods.
As Swift disallows expressions at the top level except for in the main file, the user cannot simply adjust the window properties at top level. The apparent solution is to use a closure that is immediately executed. While I was familiar with this concept from JS, it was not immediately obvious to me as a solution here. The possibility to immediately execute a closure is mentioned in passing in the Syllabus for "Closures" but it is not practiced in the corresponding learning exercise ("Double-Null0111: Closures Are Forever"). I think it is not immediately obvious for especially beginning Users that the sub-exercise in "Windowing System" can be resolved this way.
I would propose that this way of applying closures is explicitly practiced as such in "Double-Null0111: Closures Are Forever" and/or the Syllabus is adapted to make this application (the usages of closures to enable top-level execution code) explicit.
The text was updated successfully, but these errors were encountered: