[Issue 3415] broken JSON output
http://d.puremagic.com/issues/show_bug.cgi?id=3415 Rainer Schuetze r.sagita...@gmx.de changed: What|Removed |Added Keywords||patch CC||r.sagita...@gmx.de --- Comment #2 from Rainer Schuetze r.sagita...@gmx.de 2010-04-14 00:04:47 PDT --- This happens for declarations in an AttribDeclaration, where the code for adding commas is missing. Here's the patch: Index: json.c === --- json.c(revision 432) +++ json.c(working copy) @@ -214,11 +214,17 @@ if (d) { +size_t offset = buf-offset; for (unsigned i = 0; i d-dim; i++) { Dsymbol *s = (Dsymbol *)d-data[i]; +if (offset != buf-offset) +{ buf-writestring(,\n); +offset = buf-offset; +} //printf(AttribDeclaration::toJsonBuffer %s\n, s-toChars()); s-toJsonBuffer(buf); } +JsonRemoveComma(buf); } } -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 4089] crash when creating JSON output for incomplete struct
http://d.puremagic.com/issues/show_bug.cgi?id=4089 --- Comment #1 from Rainer Schuetze r.sagita...@gmx.de 2010-04-14 00:44:11 PDT --- sorry, the patch produced wrong brackets. Here's a better version: Index: json.c === --- json.c(revision 432) +++ json.c(working copy) @@ -307,19 +307,23 @@ } } -JsonString(buf, Pmembers); -buf-writestring( : [\n); -size_t offset = buf-offset; -for (int i = 0; i members-dim; i++) -{ Dsymbol *s = (Dsymbol *)members-data[i]; -if (offset != buf-offset) -{ buf-writestring(,\n); -offset = buf-offset; +if(members) +{ +JsonString(buf, Pmembers); +buf-writestring( : [\n); +size_t offset = buf-offset; +for (int i = 0; i members-dim; i++) +{ Dsymbol *s = (Dsymbol *)members-data[i]; +if (offset != buf-offset) +{ buf-writestring(,\n); +offset = buf-offset; +} +s-toJsonBuffer(buf); } -s-toJsonBuffer(buf); +JsonRemoveComma(buf); +buf-writestring(]\n); } JsonRemoveComma(buf); -buf-writestring(]\n); buf-writestring(}\n); } -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 3934] Some untidy attributes
http://d.puremagic.com/issues/show_bug.cgi?id=3934 --- Comment #1 from bearophile_h...@eml.cc 2010-04-14 07:35:46 PDT --- A person in the IRC channel suggests that this too can be bad (this program compiles and runs with dmd 2.043): extern struct foo; void main() {} -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 2244] implementing a function with an alias is impossible
http://d.puremagic.com/issues/show_bug.cgi?id=2244 Fawzi Mohamed fa...@gmx.ch changed: What|Removed |Added Status|NEW |RESOLVED CC||fa...@gmx.ch Resolution||DUPLICATE --- Comment #1 from Fawzi Mohamed fa...@gmx.ch 2010-04-14 07:49:12 PDT --- duplicate of #2683, that has a better discussion (even if it is newer) *** This issue has been marked as a duplicate of issue 2683 *** -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 2683] Cannot implement interface methods by alias
http://d.puremagic.com/issues/show_bug.cgi?id=2683 Fawzi Mohamed fa...@gmx.ch changed: What|Removed |Added CC||elit...@gmx.de --- Comment #3 from Fawzi Mohamed fa...@gmx.ch 2010-04-14 07:49:13 PDT --- *** Issue 2244 has been marked as a duplicate of this issue. *** -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 2437] ICE(tocsym.c, !needThis()) - default struct argument
http://d.puremagic.com/issues/show_bug.cgi?id=2437 Don clugd...@yahoo.com.au changed: What|Removed |Added Keywords||patch --- Comment #6 from Don clugd...@yahoo.com.au 2010-04-14 07:52:15 PDT --- The code I've previously posted is definitely incorrect. The problem here is that the compiler's thinks that the struct is a field of the parent; and this happens because the scope is wrong. I'm really not sure where to fix this. One possibility is to add it to CommaExp::semantic, creating a new scope whenever there's a declaration which isn't in module scope. But I think the correct solution is to change the scope for evaluating the default arguments, in mtype.c around line 4766; /* Create a scope for evaluating the default arguments for the parameters */ Scope *argsc = sc-push(); argsc-stc = 0; // don't inherit storage class argsc-protection = PROTpublic; +/* Compiler-generated comma expressions (such as struct constructors) + * can include a variable declaration. This declaration needs to go somewhere. + * If we're inside a function, it can become a local variable of that function; + * but if not (for example, if it is a function default parameter), it needs + * its own scope. + */ +if (!argsc-func) // not a nested function + argsc-parent = (Dsymbol*)sc-module; But I don't know if it's OK to set the parent in this way. The cast is needed only because mtype.c doesn't have the real definition of Module. The patch to bug 2935 is required in addition to this one. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 4077] Bugs caused by bitwise operator precedence
http://d.puremagic.com/issues/show_bug.cgi?id=4077 --- Comment #8 from Sobirari Muhomori dfj1es...@sneakemail.com 2010-04-14 10:28:27 PDT --- An academic example of use is to NOT short-circuit evaluation of operands. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 2544] implicit const casting rules allow violations of const-safety
http://d.puremagic.com/issues/show_bug.cgi?id=2544 --- Comment #9 from Sobirari Muhomori dfj1es...@sneakemail.com 2010-04-14 10:36:19 PDT --- (In reply to comment #5) Although it is technically a subset of bug 2095 To be precise, it's theoretically a subset of 2095, but technically they are different :) -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 3971] Syntax semantics for array assigns
http://d.puremagic.com/issues/show_bug.cgi?id=3971 --- Comment #2 from Sobirari Muhomori dfj1es...@sneakemail.com 2010-04-14 11:07:25 PDT --- What static, dynamic, a and b mean? And those diagrams? -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 3832] ^^0.5 with no imports
http://d.puremagic.com/issues/show_bug.cgi?id=3832 --- Comment #1 from bearophile_h...@eml.cc 2010-04-14 13:43:14 PDT --- With dmd 2.043 that program generates the error messages: test.d(2): Error: must import std.math to use ^^ operator test.d(2): Error: undefined identifier module test.std test.d(2): Error: no property 'math' for type 'void' Error: no property 'sqrt' for type 'int' test.d(2): Error: function expected before (), not __error of type int That can be improved a little (and they are too many). Don has noted that the implementation of X^^Y when Y is a floating point reqires several function of std.math, and it's not an used frequently operation in D code (on the other hand X^^0.5 is more common, and it just requires sqrt, that doesn't require much code). So it's possible to require the import std.math when a X^^FP is used. This is not nice, because it seems unnatural to require module imports to use a built-in operator, but it can be an acceptable compromise on a practical basis (if such compromise is adopted, the D documentation has to explain it.) -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 4091] New: Small docs page about dynamic array implementation
http://d.puremagic.com/issues/show_bug.cgi?id=4091 Summary: Small docs page about dynamic array implementation Product: D Version: future Platform: All OS/Version: All Status: NEW Severity: enhancement Priority: P2 Component: www.digitalmars.com AssignedTo: nob...@puremagic.com ReportedBy: bearophile_h...@eml.cc --- Comment #0 from bearophile_h...@eml.cc 2010-04-14 15:05:09 PDT --- I suggest to add a very short page to D docs on the digitalmars site (for example in the Articles section) that explains how dynamic arrays are implemented and exactly how this data structure works regarding item append (and maybe why this is the chosen design of arrays instead of other possible designs, and how it interacts with the current GC). The purpose of this short text is to help D programmers understand what dynamic arrays are and why they work this way in their programs. Often it's not necessary to know how an object manages its inner data, but: - Dynamic arrays are a basic data structure in D, they are among the most common data structure in D programs, so they are quite important. - From what I have seen so far it's quite not intuitive how the current dynamic arrays work and how they are implemented in the runtime. - Dynamic arrays, as objects in OOP, are an abstraction. But from what I have seen so far the current implementation of D dynamic arrays is an abstraction that leaks a lot (http://en.wikipedia.org/wiki/Leaky_abstraction ), to program efficiently with arrays you must predict how they behave, but I've seen that this is hard to do if you don't know how they are implemented. This HTML page can also contain one or two images with boxes pointers, to help the explanation. In case of need I can help in creating such images. D specs don't need to fully specify how dynamic array append is implemented, this detail can be left to front-end implementations. So this HTML page is not part of D specs, it's documentation to help D programmers that use the dmd front-end. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 2544] implicit const casting rules allow violations of const-safety
http://d.puremagic.com/issues/show_bug.cgi?id=2544 Stewart Gordon s...@iname.com changed: What|Removed |Added OS/Version|Linux |All --- Comment #10 from Stewart Gordon s...@iname.com 2010-04-14 17:46:53 PDT --- Since when has this issue been Linux-specific? -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---