<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html; charset=ISO-8859-1"
 http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
This is definitely a compiler issue.&nbsp; I had tried instantiating
CustomFloat from within the same module, and that works fine. I also
just tried compiling it into a library and using it and it works fine.&nbsp;
The only time it doesn't work is if you do <b>exactly</b> what you
suggest, i.e. pass both files to the compiler at the same time.&nbsp; This
should be fixed, but it shouldn't affect CustomFloat's usability inside
Phobos.<br>
<br>
On 6/10/2010 2:52 AM, Lars Tandle Kyllingstad wrote:
<blockquote cite="mid:1276152759.1751.10.camel@neutrino" type="cite">
  <pre wrap="">These are the steps to reproduce:  First, create a file "test.d":

        import customfloat;
        alias CustomFloat!16 float16;
        
Then compile it together with customfloat.d like this:

        dmd -c test customfloat
        
        customfloat.d(430): Error: template instance ToBinary!(real)
        does not match template declaration ToBinary(F) if
        (is(CustomFloat!(F.sizeof * 8)))
        customfloat.d(430): Error: ToBinary!(real) is used as a type
        ...

However, I'm starting to suspect it may be a compiler issue, because if
I change the order of the input files, I get a different message:

        dmd -c customfloat test
        
        customfloat.d(357): Error: template instance opUnary!("+") does
        not match template declaration opUnary(string op) if
        ((__traits(compiles,mixin(op ~ "(get!real)"))) || op == "++" ||
        op == "--")

I'm using DMD 2.046 on Linux.

-Lars



On Wed, 2010-06-09 at 22:29 -0400, David Simcha wrote:
  </pre>
  <blockquote type="cite">
    <pre wrap="">I can't reproduce this at all.  At any rate, I'm going to check this in 
because there were no other issues, I want to get it in for 2.047, and 
it's a HUGE improvement over what was there before even if it's not 
perfect.  If you can give some hints on how to reproduce this, please 
let me know.

On 6/8/2010 4:04 AM, Lars Tandle Kyllingstad wrote:
    </pre>
    <blockquote type="cite">
      <pre wrap="">On Sat, 2010-06-05 at 10:42 -0400, David Simcha wrote:
   
      </pre>
      <blockquote type="cite">
        <pre wrap="">Robert Jacques (who I know offline and, in fact, was the person who
introduced me to D) has massively improved/debugged CustomFloat and
asked me to post it for review and commit it to Phobos.  See the
attached file.  If everyone's happy with it, I'll replace the current
impl in std.numeric and check it in.
     
        </pre>
      </blockquote>
      <pre wrap="">It's awesome that someone's working on this -- I've seen people
complaining about the state of CustomFloat several times.  (I think the
last time was when we discussed the possibility of using an 80-bit
CustomFloat in Masahiro's msgpack library, to wrap 80-bit reals on
systems that don't support them.)

That said, I'm having some problems with it.  Looking at the code and
documentation, the following should be correct usage:

         alias CustomFloat!16 float16;

However, compiling it with DMD 2.046, I get the errors

         customfloat.d(430): Error: template instance ToBinary!(real)
         does not match template declaration ToBinary(F) if
         (is(CustomFloat!(F.sizeof * 8)))
         customfloat.d(430): Error: ToBinary!(real) is used as a type
         ...

-Lars

_______________________________________________
phobos mailing list
<a class="moz-txt-link-abbreviated" href="mailto:phobos@puremagic.com">phobos@puremagic.com</a>
<a class="moz-txt-link-freetext" href="http://lists.puremagic.com/mailman/listinfo/phobos">http://lists.puremagic.com/mailman/listinfo/phobos</a>

   
      </pre>
    </blockquote>
    <pre wrap="">
_______________________________________________
phobos mailing list
<a class="moz-txt-link-abbreviated" href="mailto:phobos@puremagic.com">phobos@puremagic.com</a>
<a class="moz-txt-link-freetext" href="http://lists.puremagic.com/mailman/listinfo/phobos">http://lists.puremagic.com/mailman/listinfo/phobos</a>
    </pre>
  </blockquote>
  <pre wrap="">

_______________________________________________
phobos mailing list
<a class="moz-txt-link-abbreviated" href="mailto:phobos@puremagic.com">phobos@puremagic.com</a>
<a class="moz-txt-link-freetext" href="http://lists.puremagic.com/mailman/listinfo/phobos">http://lists.puremagic.com/mailman/listinfo/phobos</a>

  </pre>
</blockquote>
<br>
</body>
</html>