June 04, 2006
Walter Bright wrote:
> The web site has changed; it now uses style sheets for layout rather than tables and embedded formatting. I essentially learned how to do this from the many examples posted here of possible new layouts for the documentation pages. Thanks to all!
> 
> I don't think the style sheet currently used is as good as the ones you came up with - at this point I was just interested in getting the layout into the style sheet. Now, we can just work on improving the style sheet.
> 
> http://www.digitalmars.com/d/changelog.html


That's great to see the sc.ini location is now configurable. How about fixing one other little problem that causes similar issues? The location  of intrinsic.d is apparently "fixed" by the compiler as std.intrinsic ~ it's the only module (other than object.d) that cannot be relocated.

The above causes notable grief for alternate library implementations. It would really be of considerable help if you were to lift this restriction from the compiler.

Thanks;
June 05, 2006
# AssertExpression's can now take an optional informational string as the second parameter. Static assert's can, too.

Hooray!

# Added Expression.NewExpression so inner classes can be initialized more conveniently.

I've never used inner classes, but looks cool.

# Added operator overloading of InExpression.

:O  You rock.  ^_^

Once again, many thanks for the hard work!

	-- Daniel

-- 
Unlike Knuth, I have neither proven or tried the above; it may not even make sense.

v2sw5+8Yhw5ln4+5pr6OFPma8u6+7Lw4Tm6+7l6+7D i28a2Xs3MSr2e4/6+7t4TNSMb6HTOp5en5g6RAHCP  http://hackerkey.com/
June 05, 2006
Walter Bright wrote:
> The web site has changed; it now uses style sheets for layout rather than tables and embedded formatting. I essentially learned how to do this from the many examples posted here of possible new layouts for the documentation pages. Thanks to all!
> 
> I don't think the style sheet currently used is as good as the ones you came up with - at this point I was just interested in getting the layout into the style sheet. Now, we can just work on improving the style sheet.
> 
> http://www.digitalmars.com/d/changelog.html

Nice!

> AssertExpression's can now take an optional informational string as
> the second parameter. Static assert's can, too.

Finally!!! <g>
June 05, 2006
Walter Bright wrote:
> I don't think the style sheet currently used is as good as the ones you came up with - at this point I was just interested in getting the layout into the style sheet. Now, we can just work on improving the style sheet.

Yay, it's much better now :) Works fine, tested with opera 9, firefox 1.5 and konqueror 3.5.
June 05, 2006
Walter Bright wrote:
> The web site has changed; it now uses style sheets for layout rather than tables and embedded formatting. I essentially learned how to do this from the many examples posted here of possible new layouts for the documentation pages. Thanks to all!
> 
> I don't think the style sheet currently used is as good as the ones you came up with - at this point I was just interested in getting the layout into the style sheet. Now, we can just work on improving the style sheet.
> 
> http://www.digitalmars.com/d/changelog.html

Here's a suggestion for the website in general, make a 'download' button next to the 'home', 'search', 'd', and 'comments' buttons at the top right corner of the page. The casual reader is not going to want to spend more than a few seconds trying to find the download link.

Also, at the top of the D compiler page where it says D for Win32 and D for linux, you should add a 'D for GCC' link and have that link to the GDC sourceforge page.

Otherwise, thanks for the bug fixes! :)

~ Clay
June 09, 2006
On Sun, 4 Jun 2006, Walter Bright wrote:

> The web site has changed; it now uses style sheets for layout rather than tables and embedded formatting. I essentially learned how to do this from the many examples posted here of possible new layouts for the documentation pages. Thanks to all!
> 
> I don't think the style sheet currently used is as good as the ones you came up with - at this point I was just interested in getting the layout into the style sheet. Now, we can just work on improving the style sheet.
> 
> http://www.digitalmars.com/d/changelog.html

> AssertExpression's can now take an optional informational string as the second parameter. Static assert's can, too.

Thanks for incorporating this.  Your implementation, not suprisingly, fixes a number of the open gaps in my first attempt.  There's one area that you didn't incorporate from what I'd one that I'd like you to consider folding in:

--- asserterror.d.orig  2006-06-09 01:18:27.000000000 -0700
+++ asserterror.d       2006-06-09 01:18:52.000000000 -0700
@@ -6,10 +6,13 @@

 class AssertError : Error
 {
-  private:
+  public:

     uint linnum;
     char[] filename;
+    char[] msg;
+
+  private:

     this(char[] filename, uint linnum)
     {
@@ -20,6 +21,7 @@
     {
        this.linnum = linnum;
        this.filename = filename;
+       this.msg = msg;

        char* buffer;
        size_t len;

--------------------

I'm not sure why the linnum and filename fields were private to begin with.  If they're going to be member variables they should be public so others can see them.  As they are, nothing can use them so they might as well not be member variables at all.

So, if they become public, the msg field ought to be exposed as well.

My unit tests for the feature try to compare msg to make sure it was passed through correctly.  For the moment, I've disabled those tests and the rest pass.

Thanks,
Brad
June 09, 2006
I'll take the private off, but a msg field would be redundant with the one in the base class.
June 09, 2006
On Fri, 9 Jun 2006, Walter Bright wrote:

> I'll take the private off, but a msg field would be redundant with the one in the base class.

Ok.. good point.  One interesting difference, though.  The base class' msg field will end up holding the entire message.  ie:

assert(false, "hi") -->
   AssertError Failure assert-test.d(40) hi

My intent was to capture just the "hi" part.  My choice of 'msg' in the diff I pasted was unfortunate.  I'd originally called it 'message'.
June 09, 2006
Brad Roberts wrote:
> On Fri, 9 Jun 2006, Walter Bright wrote:
> 
>> I'll take the private off, but a msg field would be redundant with the one in
>> the base class.
> 
> Ok.. good point.  One interesting difference, though.  The base class' msg field will end up holding the entire message.  ie:
> 
> assert(false, "hi") -->
>    AssertError Failure assert-test.d(40) hi
> 
> My intent was to capture just the "hi" part.  My choice of 'msg' in the diff I pasted was unfortunate.  I'd originally called it 'message'.

For what it's worth, I typically assign the msg field to the string passed on object construction, and if a more expressive message is required I'll override toString in the derived exception object.  This avoid the need for any allocations at the throw point (beyond the object itself, potentially), but still provides a means for more structured error messages to be displayed.  The actual error reporting structure I use in dmain2 is this:

  catch (Exception e)
  {
    while (e)
    {
      if (e.file)
        fprintf(stderr, "%.*s(%u): %.*s\n", e.file, e.line, e.msg);
      else
        fprintf(stderr, "%.*s\n", e.toString());
      e = e.next;
    }
    exit(EXIT_FAILURE);
  }

Typically, I think the full message is useful only if context information is not provided explicitly in the file and line members.


Sean
1 2
Next ›   Last »