-
Notifications
You must be signed in to change notification settings - Fork 9
val ... and rec ...
should parse
#345
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
Comments
val ... and rec ...
should be parse.val ... and rec ...
should parse
Yes, you are right that SML/NJ does not exactly follow the syntax of the Definition with regard to the rec modifier keyword. But there is general agreement that the Definition's grammar for value declarations, and rec in particular, is a bad design. In my MsML informal proposal, I suggest using only fun for recursive function declarations, and perhaps, if we ever introduce non-function recursive value declarations, we could use valrec as the keyword for those. |
I agree that some programs that the Definition permits, such as In addition, if there isn't one already, I think we should maintain a list of SML/NJ's intentional deviations from the Definition, which could stop people from raising similar issues in the future. |
On Feb 10, 2025, at 11:48 AM, Byron Zhong ***@***.***> wrote:
I agree that some programs that the Definition permits, such as val rec rec rec rec ... and this, are nonsensical, but there may be benefits in allowing a Definition-compliant SML program to parse even by simply parsing and ignoring the rec keyword after and. If this is not planned, feel free to close this issue "as not planned."
In addition, if there isn't one already, I think we should maintain a list of SML/NJ's intentional deviations from the Definition, which could stop people from raising similar issues in the future.
It is OK with me if the parser is modified to accept the Definition’s grammar, such as it is.
There is some relevant documentation about SML/NJ deviations from the Definition on the SML/NJ web page at URL https://www.smlnj.org/doc/features.html, but this documentation does not mention parsing deviations and is probably incomplete and out of date. It should be revised to address parsing differences if the SML/NJ grammar is not "corrected".
|
Version
110.99.7.1 (Latest)
Operating System
OS Version
No response
Processor
System Component
Core system
Severity
Minor
Description
should be accepted by the parser. The definition (p. 78) defines the syntax for valbind as follows:
This permits
rec
afterand
, but I believe the dynamic semantics is the same with or without the secondrec
.Transcript
Expected Behavior
No response
Steps to Reproduce
Additional Information
No response
Email address
byronzhong@cs.uchicago.edu
The text was updated successfully, but these errors were encountered: