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

Erlang bit syntax #5346

Closed
ghost opened this issue Mar 12, 2013 · 8 comments
Closed

Erlang bit syntax #5346

ghost opened this issue Mar 12, 2013 · 8 comments
Labels
A-syntaxext Area: Syntax extensions C-enhancement Category: An issue proposing an enhancement or a PR with one.

Comments

@ghost
Copy link

ghost commented Mar 12, 2013

For a systems language it would be nice to imitate Erlang's bit syntax used to construct and pattern match binaries/bitstrings.

http://www.erlang.org/doc/programming_examples/bit_syntax.html
http://www.erlang.org/doc/reference_manual/expressions.html#id78511
http://www.erlang.org/doc/reference_manual/expressions.html#id79906
http://www.erlang.org/doc/reference_manual/data_types.html#id65994

@pcwalton
Copy link
Contributor

I feel as though this should probably be a syntax extension.

@jeltz
Copy link

jeltz commented May 30, 2013

One of the strengths of the Erlang bit syntax is that they can be used for pattern matching to implement a parser. Would this work with a syntax extension?

@thestinger
Copy link
Contributor

This is still unimplemented.

@alexcrichton
Copy link
Member

We have binary literals, and I agree that this should be a syntax extension. We also have loadable syntax extensions now, and I'm not sure that this should be included in the standard library by default, so closing.

@ghost
Copy link
Author

ghost commented Oct 5, 2014

@alexcrichton given the other crates in rust.git, this doesn't seem out of place to me. Should we move this to an RFC ticket?

@alexcrichton
Copy link
Member

One was actually created recently as well!

rust-lang/rfcs#346

@ghost
Copy link
Author

ghost commented Oct 6, 2014

Okay, thanks.

bors added a commit to rust-lang-ci/rust that referenced this issue May 2, 2020
…nsch

Deprecate REPLACE_CONSTS lint

Closes rust-lang#5346
changelog: Deprecate `replace_consts` lint
@masonforest
Copy link

Here's a first pass of a language extension I wrote that allows you to pattern match binaries/bitstrings modeled after Erlang's byte matching functionality: https://crates.io/crates/match_bytes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-syntaxext Area: Syntax extensions C-enhancement Category: An issue proposing an enhancement or a PR with one.
Projects
None yet
Development

No branches or pull requests

5 participants