<!DOCTYPE html>
<html>
<head>
<title></title>
<style type="text/css">p.MsoNormal,p.MsoNoSpacing{margin:0}</style>
</head>
<body><div>Hi Joeren,<br></div>
<div><br></div>
<div>My guess: allowing entirely arbitrary expression within binary constructor<br></div>
<div>syntax could lead to ambiguities with respect to `/` and `-` and `:` tokens<br></div>
<div>which have special meaning in this context? Therefore only select expression<br></div>
<div>forms are permitted, which are free of ambiguities, one of them being `( E )`<br></div>
<div>which in turn opens access to arbitrary expressions if one is a bit more explicit.<br></div>
<div><br></div>
<div>So this will work:<br></div>
<div><br></div>
<div>    4> << (case foo of foo -> 1; bar -> 2 end bor case foo of foo -> 8; bar -> 16 end) >>.<br></div>
<div>    <<"\t">><br></div>
<div><br></div>
<div>The file `stdlib-3.4.4/src/erl_parse.yrl` has the mechanics of it (search for `binary`,<br></div>
<div>`bin_elements`, `bin_element`) though not the underlying reasoning.<br></div>
<div><br></div>
<div>HTH,<br></div>
<div>    -- Jachym</div>
<div><br></div>
<div>On Fri, Jan 18, 2019, at 15:04, Jeroen Koops wrote:<br></div>
<blockquote type="cite"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>Hi List!<br></div>
<div><br></div>
<div>If this expressions is legal:<br></div>
<div><br></div>
<div><p style="margin: 0px; font-stretch: normal; line-height: normal;"><span class="font" style="font-family:Menlo"><span class="size" style="font-size:11px"><span style="font-variant-ligatures:no-common-ligatures;">case A of foo -> 1; bar -> 2 end bor case A of foo -> 8; bar -> 16 end.</span></span></span><br></p><p style="margin: 0px; font-stretch: normal; line-height: normal;"><span class="font" style="font-family:Menlo"><span class="size" style="font-size:11px"><span style="font-variant-ligatures:no-common-ligatures;"></span></span></span><br></p><p style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font-stretch:normal;line-height:normal;"><span style="font-variant-ligatures:no-common-ligatures;"><span class="font" style="font-family:arial, " helvetica", " sans-serif"">... and this expression is legal:</span></span><br></p><p style="margin: 0px; font-stretch: normal; line-height: normal;"><span class="font" style="font-family:Menlo"><span class="size" style="font-size:11px"><span style="font-variant-ligatures:no-common-ligatures;"></span></span></span><br></p><p style="margin: 0px; font-stretch: normal; line-height: normal;"><span class="font" style="font-family:Menlo"><span class="size" style="font-size:11px"><span style="font-variant-ligatures:no-common-ligatures;"></span></span></span><br></p><p style="margin: 0px; font-stretch: normal; line-height: normal;"><span class="font" style="font-family:Menlo"><span class="size" style="font-size:11px"><span style="font-variant-ligatures:no-common-ligatures;"><< case A of foo -> 1; bar -> 2 end >>. </span></span></span><br></p><p style="margin: 0px; font-stretch: normal; line-height: normal;"><span class="font" style="font-family:Menlo"><span class="size" style="font-size:11px"><span style="font-variant-ligatures:no-common-ligatures;"></span></span></span><br></p><p style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font-stretch:normal;line-height:normal;"><span style="font-variant-ligatures:no-common-ligatures;"><span class="font" style="font-family:arial, " helvetica", " sans-serif"">... then why is this expression illegal:</span></span><br></p><p style="margin: 0px; font-stretch: normal; line-height: normal;"><span class="font" style="font-family:Menlo"><span class="size" style="font-size:11px"><span style="font-variant-ligatures:no-common-ligatures;"></span></span></span><br></p><p style="margin: 0px; font-stretch: normal; line-height: normal;"><span class="font" style="font-family:Menlo"><span class="size" style="font-size:11px"><span style="font-variant-ligatures:no-common-ligatures;"></span></span></span><br></p><p style="margin: 0px; font-stretch: normal; line-height: normal;"><span class="font" style="font-family:Menlo"><span class="size" style="font-size:11px"><span style="font-variant-ligatures:no-common-ligatures;"><< case A of foo -> 1; bar -> 2 end bor case A of foo -> 8; bar -> 16 end >>.</span></span></span><br></p><p style="margin: 0px; font-stretch: normal; line-height: normal;"><span class="font" style="font-family:Menlo"><span class="size" style="font-size:11px"><span style="font-variant-ligatures:no-common-ligatures;"></span></span></span><br></p><p style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font-stretch:normal;line-height:normal;"><span style="font-variant-ligatures:no-common-ligatures;"><span class="font" style="font-family:arial, " helvetica", " sans-serif"">(shell responds with "</span><span class="font" style="font-family:monospace, " monospace"">* 1: syntax error before: 'bor'</span><span class="font" style="font-family:arial, " helvetica", " sans-serif"">")</span></span><br></p><p style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font-stretch:normal;line-height:normal;"><span style="font-variant-ligatures:no-common-ligatures;"><span class="font" style="font-family:arial, " helvetica", " sans-serif""></span></span><br></p><p style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font-stretch:normal;line-height:normal;"><span style="font-variant-ligatures:no-common-ligatures;"><span class="font" style="font-family:arial, " helvetica", " sans-serif"">Thanks,</span></span><br></p><div><br></div>
<div>-- <br></div>
<div dir="ltr"><div>Jeroen Koops<br></div>
<div><br></div>
<div>M: <a href="mailto:koops.j@gmail.com">koops.j@gmail.com</a><br></div>
<div>T: +31-6-55590300<br></div>
</div>
</div>
</div>
</div>
</div>
</div>
<div><u>_______________________________________________</u><br></div>
<div>erlang-questions mailing list<br></div>
<div><a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br></div>
<div><a href="http://erlang.org/mailman/listinfo/erlang-questions">http://erlang.org/mailman/listinfo/erlang-questions</a><br></div>
</blockquote><div><br></div>
</body>
</html>