Language tutorial "Writing a Template" is confusing sometimes #234

Open
opened 2025-12-30 01:22:33 +01:00 by adam · 1 comment
Owner

Originally created by @gtirloni on GitHub (Oct 27, 2024).

This whole section talks about pklTutorialPart3.pkl which had not been defined up to that point. Additionally, it's talking about types and classes and then shows an example of amending that has no classes (TutorialPart.pkl and pklTutorialPart3.pkl).

It goes on to say:

This now behaves exactly like our pklTutorialPart3: TutorialPart = (pklTutorialPart1) {…​ before. pklTutorialPart3 is now defined as the value we get by amending tutorialPart and giving it a name and a part

Ok, it behaves exactly like that so then what's the point of using a class (I know the point, I don't understand why the tutorial is going down this path).

Originally created by @gtirloni on GitHub (Oct 27, 2024). [This](https://github.com/apple/pkl/blob/release/0.26/docs/modules/language-tutorial/pages/03_writing_a_template.adoc?plain=1#L170-L247) whole section talks about `pklTutorialPart3.pkl` which had not been defined up to that point. Additionally, it's talking about types and classes and then shows an example of amending that has no classes (`TutorialPart.pkl` and `pklTutorialPart3.pkl`). It goes on to [say](https://github.com/apple/pkl/blob/release/0.26/docs/modules/language-tutorial/pages/03_writing_a_template.adoc?plain=1#L246-L247): ``` This now behaves exactly like our pklTutorialPart3: TutorialPart = (pklTutorialPart1) {…​ before. pklTutorialPart3 is now defined as the value we get by amending tutorialPart and giving it a name and a part ``` Ok, it behaves exactly like that so then what's the point of using a class (I know the point, I don't understand why the tutorial is going down this path).
Author
Owner

@bioball commented on GitHub (Nov 1, 2024):

Thanks for the feedback! We'll look to improve the tutorial. But, also, feel free to submit a pull request with changes that you think would be more helpful.

@bioball commented on GitHub (Nov 1, 2024): Thanks for the feedback! We'll look to improve the tutorial. But, also, feel free to submit a pull request with changes that you think would be more helpful.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/pkl#234