-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Remove (.[]<-) #11345
Remove (.[]<-) #11345
Conversation
c2983b0
to
3f0e3e2
Compare
The only potential downside I see to this change is that it rules out the following valid OCaml 4 code:
I don't really want support this kind of abuse of notations, however. |
Do we want a specialized error message? It is quite exceptional that the removal of a deprecated function might result in a syntax error in user code. It might be help confused users to have a specific explanation rather than just a |
I agree that a specialized error message would be nice, at least in 5.0. It could be removed in later releases. |
I gave this a try, it looks like this:
|
The message doesn't say what the problem is. You should say it is illegal syntax. |
f80e6d2
to
3b85c09
Compare
OK, I tweaked the message:
|
3b85c09
to
44d1992
Compare
s.[i + 1] <- Char.chr (n lsr 16 lor 0xff); | ||
s.[i + 2] <- Char.chr (n lsr 8 lor 0xff); | ||
s.[i + 3] <- Char.chr (n lor 0xff); | ||
s.![i] <- Char.chr (n lsr 24); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I’m a bit surprised by this change. Where is the (.![]<-)
operator defined? I wasn’t able to locate it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test only checks that the source file can be parsed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah I see. Thanks!
I am not that fond of having history-focused user messages. When reading
a new user will have to search what was Even regular users might scratch their head about the information that I would propose to focus on the current situation:
Something like
but I am missing a good way to bring up |
Thanks, this feels much better. I amended the patch:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
f1a38a6
to
a35ad69
Compare
Thanks. I rebased on |
(I'm not suggesting to pretty-print the actual subterms of the user, that sounds like a dubious idea, but I think showing some concrete syntax can help.) |
Personally feels a bit overkill to me, but am not opposed. If no-one voices an objection, I'll amend accordingly. |
I think that for beginners there is a certain distance between "use the module Bytes" and (1) finding the Bytes documentation then (2) figuring out that Bytes.set is the right function and (3) how to use it. Seeing the concrete code can save a bit of time. |
I agree that we want to mention
? |
OK, I pushed a commit as suggested. |
What about
? |
Yes, your version seems clearer to me. |
Agreed. If you don't reply with the names that are in the context it is going to be confusing. |
OK, pushed a new version:
|
I'm okay with the proposed final version. |
(cherry picked from commit bb03e11)
Cherry-picked to 5.0: 67863ba |
This operator should have been removed when the function
String.set
was removed in #10867.Fixes #11342