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

Program braces in phi-calculus expression #2754

Closed
maxonfjvipon opened this issue Dec 28, 2023 · 7 comments · Fixed by #2871
Closed

Program braces in phi-calculus expression #2754

maxonfjvipon opened this issue Dec 28, 2023 · 7 comments · Fixed by #2871
Labels
Milestone

Comments

@maxonfjvipon
Copy link
Member

maxonfjvipon commented Dec 28, 2023

This is a canonical phi-calculus EBNF:
photo_2023-12-28 17 38 08

Here we assume that program is a special alpha binding where attribute is Φ.
In order not to write such top level alpha binding explicitly in every expression we decided to replace it with { } brackets.
Current Phi.g4 has bindings rule between { } brackets which seems wrong (because object is not always bindings).

If we replace current rule program: '{' bindings '}' with program: '{' object '}' (to be more canonical) then we get not really pretty phi expression, for example: {[x -> y]}.

I suggest to get rid of { } brackets and write top level alpha binding with Φ explicitly.
@yegor256 WDYT?

@yegor256
Copy link
Member

yegor256 commented Dec 29, 2023

@maxonfjvipon how about program: '{' ( bindings | object ) '}' instead?

@maxonfjvipon
Copy link
Member Author

maxonfjvipon commented Dec 29, 2023

@yegor256 I'm just trying to figure out what we're trying to replace with { } brackets.
In case: program: Φ -> formation => program: Φ -> [ bindings ] we replace Φ -> []
In case: program: Φ -> dispatch or program: Φ -> application we replace something else, because dispatch or application may contain no low level bindings at all.

I think we should decide what exactly syntax (or semantic) rule we replace with { } brackets.

UPD: Or we should change program rule with something like this:

program: Φ -> formation

@yegor256
Copy link
Member

@maxonfjvipon what's wrong with program: Φ -> application? Something like this is valid: { $.int(42) }. It's similar to: Φ -> $.int(42). Dataization of Φ is the execution of a program. Thus, this program will fail, since there is no int in Φ, but syntactically it's correct.

@maxonfjvipon
Copy link
Member Author

@yegor256 here Φ -> $.int(42) => { $.int(42) } brackets { } are replacing Φ ->
But here Φ -> [ x -> Φ.org.eolang.int ] => { x -> Φ.org.eolang.int } brackets { } are replacing Φ -> [].
I think it may confuse some devs who works with our interpretation of phi-calculus expression.

@yegor256
Copy link
Member

@maxonfjvipon I agree. Let's make it this way: {[ x -> Φ.int(42) ]}, if they mean Φ -> [ x -> Φ.int(42) ]

@maxonfjvipon
Copy link
Member Author

@yegor256 so we establish that brackets { } are replacing top level alpha binding Φ -> .

@yegor256
Copy link
Member

@maxonfjvipon yes

@maxonfjvipon maxonfjvipon added this to the Routine milestone Feb 2, 2024
maxonfjvipon added a commit to maxonfjvipon/eo that referenced this issue Feb 7, 2024
maxonfjvipon added a commit to maxonfjvipon/eo that referenced this issue Feb 7, 2024
maxonfjvipon added a commit to maxonfjvipon/eo that referenced this issue Feb 7, 2024
maxonfjvipon added a commit to maxonfjvipon/eo that referenced this issue Feb 7, 2024
deemp added a commit to objectionary/normalizer that referenced this issue Feb 20, 2024
deemp added a commit to objectionary/normalizer that referenced this issue Feb 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants