Skip to content

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

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

ibastys
Copy link
Contributor

@ibastys ibastys commented May 14, 2025

No description provided.

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]().
Copy link
Contributor Author

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?

Copy link
Collaborator

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

Copy link
Contributor Author

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`):
Copy link
Contributor Author

@ibastys ibastys May 26, 2025

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?

Copy link
Collaborator

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.

Copy link
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants