Nothing Special   »   [go: up one dir, main page]

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

get rid of the deprecated string.set function in OCaml backend #139

Closed
wants to merge 1 commit into from
Closed

get rid of the deprecated string.set function in OCaml backend #139

wants to merge 1 commit into from

Conversation

ghost
Copy link
@ghost ghost commented May 7, 2015

@ghost ghost changed the title get rid of the deprecated string.set function in OCaml backend and re… get rid of the deprecated string.set function in OCaml backend May 7, 2015
@gdetrez
Copy link
Contributor
gdetrez commented Jun 22, 2015

Thanks for the pull request (and sorry for the delay).
I just tried this and I get an error when running make, can you take a look?

❯❯❯ bnfc --ocaml -m Calc.cf

8 rules accepted

writing new file ./AbsCalc.ml
writing new file ./LexCalc.mll
writing new file ./ParCalc.mly
writing new file ./SkelCalc.ml
writing new file ./PrintCalc.ml
writing new file ./ShowCalc.ml
writing new file ./TestCalc.ml
writing new file ./BNFC_Util.ml
writing new file ./Makefile
❯❯❯ make
ocamlyacc ParCalc.mly
ocamllex LexCalc.mll
19 states, 558 transitions, table size 2346 bytes
ocamlc -o TestCalc BNFC_Util.ml AbsCalc.ml SkelCalc.ml ShowCalc.ml PrintCalc.ml ParCalc.mli ParCalc.ml LexCalc.ml TestCalc.ml
File "PrintCalc.ml", line 24, characters 4-13:
Error: Unbound module Bytes
make: *** [all] Error 2

@ghost
Copy link
Author
ghost commented Jun 22, 2015

Can you check your OCaml version? Mine:

$ ocaml -version
The OCaml toplevel, version 4.02.1

@gdetrez
Copy link
Contributor
gdetrez commented Jun 22, 2015

I see, apparently the Bytes package is new in 4.02. (My version is 4.00.1)

Since this breaks compatibility with older versions of ocaml maybe there should be a command line switch to enable/disable it (maybe something like --safe-string/--no-safe-string).

I took a quick look at the ocaml versions available in different distributions and it seems that fedora just added 4.02 in the latest release while debian doesn't even have it in testing, so it's probably a bit early to make it the default.

As far as I understood, the string module is not really deprecated but should only be used for immutable strings. An other solution would be to only use immutable string, that way we should still be backward compatible while avoiding deprecated function, isn't it?

@ghost
Copy link
Author
ghost commented Jun 22, 2015

Yep, let me try to work on a solution that only use immutable strings then. Let's keep this PR open, I will reuse it for my new changes.

@gdetrez
Copy link
Contributor
gdetrez commented Jun 22, 2015

Cool, thanks!

@gdetrez
Copy link
Contributor
gdetrez commented Aug 22, 2016

@dorafmon: any progresses? are you still working on this or planning to?

@gdetrez
Copy link
Contributor
gdetrez commented Nov 25, 2016

This is fixed by 0f38dac but using Buffer instead of Bytes which seems more backward compatible.

@gdetrez gdetrez closed this Nov 25, 2016
@andreasabel andreasabel added this to the 2.8.2 milestone Nov 4, 2018
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 this pull request may close these issues.

3 participants