Bit syntax

Came across this in the lambda weblog, where the poster said

The Erlang Bit Syntax extends pattern matching to (de)constructing
chunks of binary data, such as the bit-encoded headers in network
protocols and file formats. It’s an amazingly handy language
extension.

The linked description is here:
http://www.erlang.se/euc/00/bit_syntax.html

martin

Hello Martin,

Wednesday, December 11, 2002, 2:17:32 PM, you wrote:

Came across this in the lambda weblog, where the poster said

The Erlang Bit Syntax extends pattern matching to (de)constructing
chunks of binary data, such as the bit-encoded headers in network
protocols and file formats. It’s an amazingly handy language
extension.

sorry, but ruby don’t have pattern matching even for regular data
structures. it too FP-style :wink: it is not the same as regular
expression matching (as you think)

···


Best regards,
Bulat mailto:bulatz@integ.ru

Doh - okay, misread that. Yeah, pattern matching wouldn’t work in Ruby.

martin

···

Bulat Ziganshin bulatz@integ.ru wrote:

Hello Martin,

Wednesday, December 11, 2002, 2:17:32 PM, you wrote:

Came across this in the lambda weblog, where the poster said

The Erlang Bit Syntax extends pattern matching to (de)constructing
chunks of binary data, such as the bit-encoded headers in network
protocols and file formats. It’s an amazingly handy language
extension.

sorry, but ruby don’t have pattern matching even for regular data
structures. it too FP-style :wink: it is not the same as regular
expression matching (as you think)

“Bulat Ziganshin” bulatz@integ.ru writes:

Hello Martin,

Wednesday, December 11, 2002, 2:17:32 PM, you wrote:

Came across this in the lambda weblog, where the poster said

The Erlang Bit Syntax extends pattern matching to (de)constructing
chunks of binary data, such as the bit-encoded headers in network
protocols and file formats. It’s an amazingly handy language
extension.

sorry, but ruby don’t have pattern matching even for regular data
structures. it too FP-style :wink: it is not the same as regular
expression matching (as you think)

I failed to see the FP-ness of Erlang Bit Syntax’s pattern
matching. On the other hand, I see this as a handy feature as it
allows ruby to be easily used in doing bit manipulation.

However, I do not think that Ruby syntax needs to be changed to
accomodate this. It seems that all functionalities of Erlang Bit
Syntax can be done in pure-ruby, i.e., the functionalities for
bit-manipulating can all simply provided in a native ruby module.

YS.