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

Replacing name of a functor turns it into a symbol #1

Closed
rexim opened this issue Mar 26, 2022 · 2 comments
Closed

Replacing name of a functor turns it into a symbol #1

rexim opened this issue Mar 26, 2022 · 2 comments

Comments

@rexim
Copy link
Member

rexim commented Mar 26, 2022

noq> shape f(a, b, c)
shaping f(a, b, c)
> apply rule f = g
 => g
> done
noq>
@rexim
Copy link
Member Author

rexim commented Mar 26, 2022

Oh, it's actually by design. f is recognized as a variable that matches the whole expression. This is confusing nonetheless.

@rexim
Copy link
Member Author

rexim commented Mar 27, 2022

We can resolve the confusion by introducing a special kind of expressions "variable" and use it for binding the sub-expressions instead of symbols. And match the symbols literally.

The variables can be denoted by capitalizing first character of the name. Similar to how Prolog does it.

@rexim rexim closed this as completed in 5c5fc44 Mar 27, 2022
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

No branches or pull requests

1 participant