September 05, 2008 [Issue 2337] New: Can't set .length property in CTF. | ||||
---|---|---|---|---|
| ||||
http://d.puremagic.com/issues/show_bug.cgi?id=2337 Summary: Can't set .length property in CTF. Product: D Version: 1.035 Platform: PC OS/Version: Linux Status: NEW Severity: enhancement Priority: P2 Component: DMD AssignedTo: bugzilla@digitalmars.com ReportedBy: aziz.kerim@gmail.com The page for functions says that some "properties can be executed at compile time", and it lists .length as one of those properties. Unfortunately it can only be accessed by reading it, but assigning a value to it is not possible. For example: char[] ctf() { // Create a table: char[][] table = []; // table.length = 250; // No simple enlargement. // Use ugly workaround: for (uint i; i < 250; i++) table ~= []; char[] code = ""; // Create code from table. return code; } pragma(msg, ctf()); I think this shouldn't be too difficult to implement. -- |
June 10, 2011 [Issue 2337] Can't set .length property in CTF. | ||||
---|---|---|---|---|
| ||||
Posted in reply to d-bugmail | http://d.puremagic.com/issues/show_bug.cgi?id=2337 yebblies <yebblies@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED CC| |yebblies@gmail.com Resolution| |FIXED --- Comment #1 from yebblies <yebblies@gmail.com> 2011-06-10 04:39:59 PDT --- This works in dmd1.068 (and dmd2.053). -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
Copyright © 1999-2021 by the D Language Foundation