<div dir="ltr">I like Scott's suggestion.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On 28 November 2016 at 20:23, Scott Owens <span dir="ltr"><<a href="mailto:S.A.Owens@kent.ac.uk" target="_blank">S.A.Owens@kent.ac.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Or we could have the parser map 0w3 to something like “int_to_word 3” and leave it in the programmers control, and have the basis start with a default.<br>
<span class="HOEnZb"><font color="#888888"><br>
Scott<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
> On 2016/11/28, at 07:36, Ramana Kumar <<a href="mailto:Ramana.Kumar@cl.cam.ac.uk">Ramana.Kumar@cl.cam.ac.uk</a>> wrote:<br>
><br>
> I doubt we want to go down that path...<br>
><br>
> Here's a (somewhat random) suggestion: word literals (0w3 etc.) are mapped to Word64.word, and to get bytes via parser you need to use Word8.fromInt.<br>
><br>
> On 28 November 2016 at 15:35, <<a href="mailto:Michael.Norrish@data61.csiro.au">Michael.Norrish@data61.csiro.<wbr>au</a>> wrote:<br>
> Presumably SML allows type inference to figure out the width in the same way that numeric operations get overload-resolved:<br>
><br>
><br>
><br>
> (* Poly/ML *)<br>
><br>
> > Word8.+(0w3, 0w4);<br>
><br>
> val it = 0wx7: Word8.word<br>
><br>
> > Word64.+(0w3, 0w4);<br>
><br>
> val it = 0wx7: Word64.word<br>
><br>
><br>
><br>
> Michael<br>
><br>
><br>
><br>
> From: Ramana Kumar <<a href="mailto:Ramana.Kumar@cl.cam.ac.uk">Ramana.Kumar@cl.cam.ac.uk</a>><br>
> Date: Monday, 28 November 2016 at 11:46<br>
> To: "Norrish, Michael (Data61, Canberra City)" <<a href="mailto:Michael.Norrish@data61.csiro.au">Michael.Norrish@data61.csiro.<wbr>au</a>><br>
> Cc: "<a href="mailto:developers@cakeml.org">developers@cakeml.org</a>" <<a href="mailto:developers@cakeml.org">developers@cakeml.org</a>><br>
> Subject: Re: [CakeML-Dev] targeting word literal constructors in AST<br>
><br>
><br>
><br>
> SML does not distinguish syntactically. I guess we might have to invent some syntax...?<br>
><br>
><br>
><br>
> On 28 November 2016 at 11:03, <<a href="mailto:Michael.Norrish@data61.csiro.au">Michael.Norrish@data61.csiro.<wbr>au</a>> wrote:<br>
><br>
> There are both Word8 and Word64 constructors for word literals in the AST type. How are the parser or lexer meant to figure out which any piece of syntax corresponds to?<br>
><br>
> Michael<br>
><br>
> ______________________________<wbr>_________________<br>
> Developers mailing list<br>
> <a href="mailto:Developers@cakeml.org">Developers@cakeml.org</a><br>
> <a href="https://lists.cakeml.org/listinfo/developers" rel="noreferrer" target="_blank">https://lists.cakeml.org/<wbr>listinfo/developers</a><br>
><br>
><br>
><br>
><br>
> ______________________________<wbr>_________________<br>
> Developers mailing list<br>
> <a href="mailto:Developers@cakeml.org">Developers@cakeml.org</a><br>
> <a href="https://lists.cakeml.org/listinfo/developers" rel="noreferrer" target="_blank">https://lists.cakeml.org/<wbr>listinfo/developers</a><br>
><br>
><br>
> ______________________________<wbr>_________________<br>
> Developers mailing list<br>
> <a href="mailto:Developers@cakeml.org">Developers@cakeml.org</a><br>
> <a href="https://lists.cakeml.org/listinfo/developers" rel="noreferrer" target="_blank">https://lists.cakeml.org/<wbr>listinfo/developers</a><br>
<br>
</div></div></blockquote></div><br></div>