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

increase some syntactic flexibility for method label names and record label names #7267

Closed
vicuna opened this issue May 28, 2016 · 4 comments

Comments

@vicuna
Copy link

vicuna commented May 28, 2016

Original bug ID: 7267
Reporter: @bobzhang
Status: acknowledged (set by @damiendoligez on 2016-09-27T14:12:28Z)
Resolution: open
Priority: normal
Severity: feature
Target version: later
Category: lexing and parsing
Related to: #7296
Monitored by: @yallop

Bug description

The use case is that when compile OCaml to JS backend via bucklescript(I think it applies to js_of_ocaml too), some JS objects are not expressible due to some superficial issues (not a valid syntax)

for example in method name, you can not start with capital letter

object method Capital_is_not_legal_name : xx end

Another part is that in JS, hypen operator (-) is also used a lot.

It would be nice that in OCaml, we introduce a special token like common lisp does(http://www.lispworks.com/documentation/lw70/CLHS/Body/02_cd.htm)

so you can have |Content-Type| as a valid method name

@vicuna
Copy link
Author

vicuna commented May 28, 2016

Comment author: @bobzhang

note a walk around is having mandated encoding rules, those are quite ad-hoc and its syntax is ugly

@vicuna
Copy link
Author

vicuna commented May 31, 2016

Comment author: @bobzhang

To avoid breaking backward compatibility, I would suggest using (|Content-Type|) which is still much better than hard-code encoding like _Content'Type

@vicuna
Copy link
Author

vicuna commented Feb 18, 2017

Comment author: @xavierleroy

I see no support for your proposal. If you're serious about it, you'll have to lobby caml-devel convincingly.

@github-actions
Copy link

github-actions bot commented May 9, 2020

This issue has been open one year with no activity. Consequently, it is being marked with the "stale" label. What this means is that the issue will be automatically closed in 30 days unless more comments are added or the "stale" label is removed. Comments that provide new information on the issue are especially welcome: is it still reproducible? did it appear in other contexts? how critical is it? etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant