Skip to content
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

Add explanation of the scope of the variables for minimal MeTTa #738

Merged
merged 7 commits into from
Jul 23, 2024

Conversation

vsbogd
Copy link
Collaborator

@vsbogd vsbogd commented Jul 10, 2024

No description provided.

luketpeterson
luketpeterson previously approved these changes Jul 11, 2024
docs/minimal-metta.md Outdated Show resolved Hide resolved
docs/minimal-metta.md Outdated Show resolved Hide resolved

When variable is passed as an argument to the function call and matched by a
value then the value is assigned to the variable. If variable passed as an
actual argument is matched by a formal argument variable then it is referenced
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like the terms "formal argument" and "actual argument" need to be defined. The example helps but I found this part a little bit confusing.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is a quite common terminology (for example see Wikipedia article). Is using word "argument" for the passed arguments and word "parameter" for the function input variables clears the thing? For example:

When a variable is passed as an argument to a function call and matched by a
value used in a function definition then the value is assigned to the variable.
If variable passed as an argument is matched by a function's parameter variable
then parameter variable references the variable passed as an argument. In this
case the variable passed as an argument can receive a value outsides of its
scope.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah ok. Thanks. I had never encountered that phrasing before.

Copy link
Collaborator Author

@vsbogd vsbogd Jul 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well it is not only terminology and I started using it intentionally to make readers clearly see that both sides are arguments but different kinds of arguments. Because to me words "parameter" and "argument" are ambiguous. I am not sure if it is easy to read this. If it is hard and there is more familiar words then I would use them.

docs/minimal-metta.md Outdated Show resolved Hide resolved
docs/minimal-metta.md Outdated Show resolved Hide resolved
docs/minimal-metta.md Outdated Show resolved Hide resolved
docs/minimal-metta.md Outdated Show resolved Hide resolved
@vsbogd
Copy link
Collaborator Author

vsbogd commented Jul 11, 2024

Luke thank you very much for the edits!

@luketpeterson luketpeterson self-requested a review July 11, 2024 23:40
@vsbogd vsbogd merged commit 572d3af into trueagi-io:main Jul 23, 2024
2 checks passed
@vsbogd vsbogd deleted the add-var-scope-doc branch September 16, 2024 10:15
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