<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7653.38">
<TITLE>AW: [erlang-questions] Bit String Comprehension Question</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->

<P><FONT SIZE=2>sorry, however, for the noize dear david,<BR>
<BR>
you need to declare that's a bitstring,<BR>
binaries is default and therefore the expected type,<BR>
so this will work 4 u:<BR>
<BR>
<< <<Bin/bitstring>> || Bin <- [<<3:5>>] >>.<BR>
<BR>
it's well explained in the documentation ('programming-examples/constructing binaries and bitstrings')..<BR>
<BR>
Cheers,<BR>
<BR>
Christoph Grasl<BR>
Embedded Software Entwickler<BR>
<BR>
KEYTRONIX<BR>
Gesellschaft für industrielle Elektronik und Informationstechnologie mbH<BR>
<BR>
Ungargasse 64-66/1/109<BR>
A-1030 WIEN<BR>
<BR>
E-Mail: c.grasl@keytronix.com<BR>
Tel.: +43 (1) 718 06 60 - 323<BR>
Mobil: +43 (664) 8556456<BR>
WWW: <A HREF="http://www.keytronix.com">http://www.keytronix.com</A><BR>
<BR>
HG Wien FN 261131t<BR>
<BR>
Confidentiality Notice:<BR>
This message may contain privileged and confidential information. If you think, for any reason, that this message may have been addressed to you in error, you must not disseminate, copy or take any action in reliance on it, and we would ask you to notify us immediately by return email.<BR>
<BR>
<BR>
<BR>
-----Ursprüngliche Nachricht-----<BR>
Von: David Mercer [<A HREF="mailto:dmercer@gmail.com">mailto:dmercer@gmail.com</A>]<BR>
Gesendet: Di 09.09.2008 17:52<BR>
An: Grasl Christoph; erlang-questions@erlang.org<BR>
Betreff: RE: [erlang-questions] Bit String Comprehension Question<BR>
<BR>
My question, however, is regarding bit string comprehension, not list<BR>
comprehension.  Please advise.  Thank-you.<BR>
<BR>
> -----Original Message-----<BR>
> From: Grasl Christoph [<A HREF="mailto:C.Grasl@keytronix.com">mailto:C.Grasl@keytronix.com</A>]<BR>
> Sent: Tuesday, September 09, 2008 09:55<BR>
> To: dmercer@alum.mit.edu; erlang-questions@erlang.org<BR>
> Subject: AW: [erlang-questions] Bit String Comprehension Question<BR>
><BR>
> Dear, David<BR>
><BR>
> [Bin || Bin <- [<<3:5>>] ].<BR>
><BR>
> works fine..<BR>
><BR>
> the syntactical notation for a list comprehension needs to be in '[' & ]'<BR>
> whereas you have used the binary/bitstring syntax to 'bracket' your<BR>
> comprehension<BR>
> together with the '||', which is typically a list-comp.<BR>
> could be mistaken, but it looks like u'r mixing up to notations..<BR>
><BR>
> Cheers,<BR>
><BR>
> Christoph Grasl<BR>
> Embedded Software Entwickler<BR>
><BR>
> KEYTRONIX<BR>
> Gesellschaft für industrielle Elektronik und Informationstechnologie mbH<BR>
><BR>
> Ungargasse 64-66/1/109<BR>
> A-1030 WIEN<BR>
><BR>
> E-Mail: c.grasl@keytronix.com<BR>
> Tel.: +43 (1) 718 06 60 - 323<BR>
> Mobil: +43 (664) 8556456<BR>
> WWW: <A HREF="http://www.keytronix.com">http://www.keytronix.com</A><BR>
><BR>
> HG Wien FN 261131t<BR>
><BR>
> Confidentiality Notice:<BR>
> This message may contain privileged and confidential information. If you<BR>
> think, for any reason, that this message may have been addressed to you in<BR>
> error, you must not disseminate, copy or take any action in reliance on<BR>
> it, and we would ask you to notify us immediately by return email.<BR>
><BR>
><BR>
><BR>
> -----Ursprüngliche Nachricht-----<BR>
> Von: erlang-questions-bounces@erlang.org im Auftrag von David Mercer<BR>
> Gesendet: Di 09.09.2008 16:18<BR>
> An: 'erlang-questions'<BR>
> Betreff: [erlang-questions] Bit String Comprehension Question<BR>
><BR>
> Why does the bit-string comprehension #133 below work whereas #134 is a<BR>
> syntax error?<BR>
><BR>
><BR>
><BR>
> 133> << <<X:N>> || {X,N} <- [{3,5}] >>.<BR>
><BR>
><BR>
> <<3:5>><BR>
><BR>
> 134> << Bin || Bin <- [<<3:5>>] >>.<BR>
><BR>
> * 1: syntax error before: '||'<BR>
><BR>
><BR>
><BR>
> Please advise.  Thank-you.<BR>
><BR>
><BR>
><BR>
> David Mercer<BR>
><BR>
><BR>
><BR>
><BR>
><BR>
<BR>
<BR>
<BR>
</FONT>
</P>

</BODY>
</HTML>