-
Notifications
You must be signed in to change notification settings - Fork 159
Update Lesson 1.5 README. #4816
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
Essentially, by importing module `A` into module `B`, we include all sentences | ||
in module `A` into module `B`. Note that K distinguishes between importing a | ||
module and simply including its sentences in another module directly. We | ||
will discuss these differences in Lesson [XYZ](). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you happen to know in which lesson is this discussed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is differences, but I actually wouldn't expect them to meaningfully affect the behavior of the module that would be doing the import except in fringe cases. I don't believe we currently have any lessons diving into that type of detail
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But then maybe it doesn't make sense mentioning this at all at this moment. I can just remove the sentences after "Note that K distinguishes". OK?
As you may have noticed, each module in a definition can express a **distinct** | ||
set of syntax. When parsing the sentences in a module, we use the syntax | ||
**of that module**, enriched with the basic syntax of K. For example, the | ||
following definition is a parser error (`lesson-05-e.k`): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This parser error mentioned here refers to K's own parser used at compile time, right? The outer syntax parser, which is different than the inner syntax parser generated after a successful kompile
execution, right?
Do you think i should make this more explicit in the tutorial or is it understandable as it is right now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you feel you need to confirm, it probably could be clearer. Both outer parsing of modules and inner parsing of sentences happen when the definition is compiled, though. We generally refer to parsing that happens at runtime as program parsing and it uses a pretty different code path than the one used to parse rules, which is what is being discussed here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, then i might leave this as it is. I'll make another pass over the lesson to make sure nothing is ambiguous.
No description provided.