[Issue 8008] static array literal syntax request: auto x=[1,2,3]S;

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri May 31 10:18:22 PDT 2013


http://d.puremagic.com/issues/show_bug.cgi?id=8008


Shriramana Sharma <samjnaa at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |samjnaa at gmail.com


--- Comment #3 from Shriramana Sharma <samjnaa at gmail.com> 2013-05-31 10:18:19 PDT ---
(In reply to comment #2)
> Thanks for the reply, I wish this could receive more attention...
> If you're worried about esthetics, how about using a distinct symbol instead of
> a letter to make it pop out:
> For example:
> auto x=[1,2,3]@; 
> fun([1,2,3]@);

I also don't like [,,,]S syntax. But i.o. @ I think we can re-use the $ which
is suggested for specifying in the type as in bug 481. 

But even then, such a special syntax would only be needed if it is necessary
for specifying in a literal that a fixed-size array is intended. In assignment
or other expressions it would not be required but only in direct function
arguments. 

And even then, why wouldn't a function that expects a fixedsize array not
accept a dynamic one of appropriate size? If it doesn't accept, then probably
that is what should be fixed and no new syntax for such fixed-size array
literals is needed.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list