<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<tt>Whoops! Sent this from my wife's account, should be from me of
course.<br>
<br>
Robert<br>
<br>
Elisabeth Virding wrote:</tt>
<blockquote cite="mid44C69E7D.9000507@telia.com" type="cite">
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<tt>Romain Lenglet wrote:</tt>
<blockquote
cite="mid200607131718.21051.rlenglet@users.forge.objectweb.org"
type="cite">
<pre wrap=""><tt>Claes Wikstrom wrote:
</tt></pre>
<blockquote type="cite">
<pre wrap=""><tt>Romain Lenglet wrote:
</tt></pre>
<blockquote type="cite">
<pre wrap=""><tt>Vance Shipley wrote:
</tt></pre>
<blockquote type="cite">
<pre wrap=""><tt>1> <<"123">>.
</tt></pre>
</blockquote>
<pre wrap=""><tt>This is syntactic sugar for <<$1, $2, $3>>.
</tt></pre>
<blockquote type="cite">
<pre wrap=""><tt><<"123">>
2> String = "123".
"123"
3> <<String>>.
** exited: {badarg,[{erl_eval,expr,3}]} **
</tt></pre>
</blockquote>
<pre wrap=""><tt>Use list_to_binary(String) instead.
</tt></pre>
</blockquote>
<pre wrap=""><tt>Hmmm
<<A:32, String/string, B/binary>>
would certainly be useful (easy to implement too)
</tt></pre>
</blockquote>
<pre wrap=""><!----><tt>
Or even better:
L = [1, 2, [<<"hello">>, 3] ],
<<A:32, L/iolist, B/binary>>
</tt></pre>
</blockquote>
<tt>I am assuming you mean that L is an iolist and the binary should
contain the bytes in it. I have two comments:<br>
<br>
1. I don't really see the point as you can use list_to_binary/1 instead.<br>
<br>
2. What would it mean in a pattern where you are matching a binary? Get
back a binary? Or a random iolist containing he same bytes. It would
violate a fundamental invariant which is that if use a pattern to build
an object you can use the same pattern to pull the object apart and get
back the same objects.<br>
<br>
The same question holds for String/string. Would using it in a match
return a list of the bytes?<br>
<br>
Robert<br>
</tt><br>
</blockquote>
</body>
</html>