www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 6559] New: [CTFE-ish] Inconsistent array formatting at runtime vs compiletime

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6559

           Summary: [CTFE-ish] Inconsistent array formatting at runtime vs
                    compiletime
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Severity: minor
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: cbkbbejeap mailinator.com



11:30:41 PDT ---
 type testArrayOut.d
import std.stdio; immutable arr = [ 1 , 2 , 3 ]; void main() { pragma(msg, arr); writeln(arr); }
 dmd testArrayOut.d
[1,2,3]
 testArrayOut
[1, 2, 3] The formatting should be the same at both runtime and compile-time. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Aug 26 2011
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6559


Don <clugdbug yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |clugdbug yahoo.com.au




 type testArrayOut.d
import std.stdio; immutable arr = [ 1 , 2 , 3 ]; void main() { pragma(msg, arr); writeln(arr); }
 dmd testArrayOut.d
[1,2,3]
 testArrayOut
[1, 2, 3] The formatting should be the same at both runtime and compile-time.
You're assuming that pragma(msg) and writeln use the same format, but I'm not sure why. AFAIK there is nothing in the spec that should give that impression. They are completely unrelated features. pragma(msg) uses the same format that is used for error messages. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Aug 29 2011
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6559


yebblies <yebblies gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|CTFE                        |diagnostic
                 CC|                            |yebblies gmail.com
           Platform|Other                       |All
            Summary|[CTFE-ish] Inconsistent     |Compiler message expression
                   |array formatting at runtime |formatting does not match
                   |vs compiletime              |phobos
         OS/Version|Windows                     |All
           Severity|minor                       |enhancement



I agree with Don.  This is asking for dmd's value formatting to match what
phobos currently does.  The fact it doesn't is not a bug.  Does not involve
CTFE.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 27 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6559


Andrej Mitrovic <andrej.mitrovich gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |andrej.mitrovich gmail.com
         Resolution|                            |FIXED



17:55:28 PST ---
Incidentally it seems to be fixed:

D:\dev\code\d_code>rdmd test.d
[1, 2, 3]  -- CT
DMD v2.061 DEBUG
[1, 2, 3]  -- RT

It really is invalid to ask CT pragma to match Phobos formatters.

Note however that the new format in 2.061 works at compile-time, therefore you
can have a 100% match if you use it in a pragma:

import std.stdio;
import std.string;
immutable arr = [ 1 , 2 , 3 ];
void main()
{
    pragma(msg, format("%s", arr));
}

In 2.060 you can use xformat instead.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Dec 27 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6559


Walter Bright <bugzilla digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|FIXED                       |WORKSFORME



21:10:29 PST ---
"seems to be fixed" should be resolves as "WORKSFORME".

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Dec 27 2012
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6559





 Incidentally it seems to be fixed:
 
 D:\dev\code\d_code>rdmd test.d
 [1, 2, 3]  -- CT
 DMD v2.061 DEBUG
 [1, 2, 3]  -- RT
 
 It really is invalid to ask CT pragma to match Phobos formatters.
As a side note, this change is introduced by fixing issue 2273. https://github.com/D-Programming-Language/dmd/commit/04891ca1e554d46be873ebe607ddeb614d934e57 An array literal formatting in CT uses argsToCBuffer in expression.c, and it is also used for ddoc formatting. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Dec 27 2012