<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Erlang非业余研究 &#187; match</title>
	<atom:link href="http://blog.yufeng.info/archives/tag/match/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.yufeng.info</link>
	<description>Erlang系统深度探索和应用</description>
	<lastBuildDate>Tue, 17 Jan 2012 06:05:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>R14A实现了EEP31，添加了binary模块</title>
		<link>http://blog.yufeng.info/archives/574</link>
		<comments>http://blog.yufeng.info/archives/574#comments</comments>
		<pubDate>Fri, 21 May 2010 03:24:55 +0000</pubDate>
		<dc:creator>Yu Feng</dc:creator>
				<category><![CDATA[Erlang探索]]></category>
		<category><![CDATA[AC]]></category>
		<category><![CDATA[binary]]></category>
		<category><![CDATA[BM]]></category>
		<category><![CDATA[EEP31]]></category>
		<category><![CDATA[match]]></category>
		<category><![CDATA[R14A]]></category>

		<guid isPermaLink="false">http://blog.yufeng.info/?p=574</guid>
		<description><![CDATA[原创文章，转载请注明： 转载自Erlang非业余研究 本文链接地址: R14A实现了EEP31，添加了binary模块 Erlang的binary数据结构非常强大，而且偏向底层，在作网络程序的时候，很方便的能够和二进制协议对应起来。但是由于这个数据结构加入erlang语言的时间不是很长，相关的配套模块不是很多。 在binary的匹配，替换，修改就显的非常麻烦。 于是有了EEP31 。 R14A昨天已经实现了这个功能， 在stdlib下添加了个binary模块。 这个模块大部分功能是由BIF实现的， 同时充分考虑了CPU使用的公平性，源码大部分在erl_bif_binary.c下。 还添加了个gurad函数： binary_part进一步方便我们写匹配条件。 我们在源码里面发现了以下注释： /* * The native implementation functions for the module binary. * Searching is implemented using aither Boyer-More or Aho-Corasick * depending on number of searchstrings (BM if one, AC if more than one). * Native implementation is mostly for efficiency, [...]]]></description>
			<content:encoded><![CDATA[<div style="margin-top: 15px; font-style: italic">
<p><strong>原创文章，转载请注明：</strong> 转载自<a href="http://blog.yufeng.info/">Erlang非业余研究</a></p>
<p><strong>本文链接地址:</strong> <a href="http://blog.yufeng.info/archives/574">R14A实现了EEP31，添加了binary模块</a></p>
</div>
<p>Erlang的binary数据结构非常强大，而且偏向底层，在作网络程序的时候，很方便的能够和二进制协议对应起来。但是由于这个数据结构加入erlang语言的时间不是很长，相关的配套模块不是很多。 在binary的匹配，替换，修改就显的非常麻烦。 于是有了<a href="http://www.erlang.org/eeps/eep-0031.html">EEP31</a> 。 R14A昨天已经实现了这个功能， 在stdlib下添加了个binary模块。 这个模块大部分功能是由BIF实现的， 同时充分考虑了CPU使用的公平性，源码大部分在erl_bif_binary.c下。 还添加了个gurad函数： binary_part进一步方便我们写匹配条件。</p>
<p>我们在源码里面发现了以下注释：<br />
/*<br />
 * The native implementation functions for the module binary.<br />
 * Searching is implemented using aither Boyer-More or Aho-Corasick<br />
 * depending on number of searchstrings (BM if one, AC if more than one).<br />
 * Native implementation is mostly for efficiency, nothing<br />
 * (except binary:referenced_byte_size) really *needs* to be implemented<br />
 * in native code.<br />
 */</p>
<p>这个模块兼顾了效率和方便性，使用起来就大大简化了代码的复杂度，有福气了。</p>
<div style="margin-top: 0; margin-bottom: 15px; color: #888888; font-size: 80%; font-style: italic">
<p>Post Footer automatically generated by <a href="http://easwy.com/blog/wordpress/wp-posturl/" style="color: #8888FF; text-decoration: underline;">wp-posturl plugin</a> for wordpress.</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://blog.yufeng.info/archives/574/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

