[Issue 4272] x.typeof syntax

2019-10-23 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=4272

RazvanN  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||razvan.nitu1...@gmail.com
 Resolution|--- |WONTFIX

--- Comment #8 from RazvanN  ---
Closing this as there is not sufficient evidence that this will improve
anything and special casing for symbols is not the way to go.

--


[Issue 4272] x.typeof syntax

2015-06-09 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=4272

Andrei Alexandrescu  changed:

   What|Removed |Added

Version|future  |D2

--


[Issue 4272] x.typeof syntax

2015-06-02 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=4272

dennis.m.ritc...@mail.ru changed:

   What|Removed |Added

 CC||dennis.m.ritc...@mail.ru

--


[Issue 4272] x.typeof syntax

2012-10-07 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4272



--- Comment #7 from Maxim Fomin  2012-10-07 01:08:41 PDT 
---
(In reply to comment #6)
> (In reply to comment #5)
> > The problem is that UFCS was made to work with functions and typeof is not a
> > function. Accepting identifier.typeof would result in questions about which
> > identifiers are valid for this and what else works besides typeof with them.
> 
> This is not to do with UFCS. There are already many built in properties like
> x.sizeof, x.init:
> http://dlang.org/property.html
> 
> typeof fits nicely as a built in property, and helps cut down on nested
> brackets.

Typeof is not a property either. And it differs from all those properties
which, given a type or expression, provide fundamental information about their
types like size, default value, name, alignment. Typeof works in opposite
direction - given some expression it gives its type. 

BTW, identifier is a primary expression (http://dlang.org/expression.html), so,
making idenfier.typeof possible and expression.typeof not (as mentioned above),
raises some questions. 

However, if typeof is made a property too, it would be logical and consistent.

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


[Issue 4272] x.typeof syntax

2012-10-06 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4272



--- Comment #6 from Nick Treleaven  2012-10-06 
10:28:49 PDT ---
(In reply to comment #5)
> The problem is that UFCS was made to work with functions and typeof is not a
> function. Accepting identifier.typeof would result in questions about which
> identifiers are valid for this and what else works besides typeof with them.

This is not to do with UFCS. There are already many built in properties like
x.sizeof, x.init:
http://dlang.org/property.html

typeof fits nicely as a built in property, and helps cut down on nested
brackets.

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


[Issue 4272] x.typeof syntax

2012-10-06 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4272


Maxim Fomin  changed:

   What|Removed |Added

 CC||ma...@maxim-fomin.ru


--- Comment #5 from Maxim Fomin  2012-10-06 06:41:10 PDT 
---
(In reply to comment #4)
> (In reply to comment #3)
> > typeof isn't a property or a function, unlike sizeof. It's like an
> > is-expression, and I think that treating it like a property would be a 
> > mistake.
> 
> I think (x + y).typeof should not be allowed, use the existing syntax instead.
> 
> However, x.typeof is a useful shorthand that helps cut down on nested brackets
> in is expressions and elsewhere. So I would allow both typeof(expression) and
> identifier.typeof to be used, but *not* expression.typeof.
> 
> The type of an instance is a natural property of the instance IMO.

The problem is that UFCS was made to work with functions and typeof is not a
function. Accepting identifier.typeof would result in questions about which
identifiers are valid for this and what else works besides typeof with them.

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


[Issue 4272] x.typeof syntax

2012-10-06 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4272


Nick Treleaven  changed:

   What|Removed |Added

 CC||ntrel-pub...@yahoo.co.uk


--- Comment #4 from Nick Treleaven  2012-10-06 
06:22:10 PDT ---
(In reply to comment #3)
> typeof isn't a property or a function, unlike sizeof. It's like an
> is-expression, and I think that treating it like a property would be a 
> mistake.

I think (x + y).typeof should not be allowed, use the existing syntax instead.

However, x.typeof is a useful shorthand that helps cut down on nested brackets
in is expressions and elsewhere. So I would allow both typeof(expression) and
identifier.typeof to be used, but *not* expression.typeof.

The type of an instance is a natural property of the instance IMO.

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


[Issue 4272] x.typeof syntax

2012-09-14 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4272


Jonathan M Davis  changed:

   What|Removed |Added

 CC||jmdavisp...@gmx.com


--- Comment #3 from Jonathan M Davis  2012-09-14 14:20:26 
PDT ---
typeof isn't a property or a function, unlike sizeof. It's like an
is-expression, and I think that treating it like a property would be a mistake.

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


[Issue 4272] x.typeof syntax

2012-09-14 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4272


monarchdo...@gmail.com changed:

   What|Removed |Added

 CC||monarchdo...@gmail.com


--- Comment #2 from monarchdo...@gmail.com 2012-09-14 11:17:24 PDT ---
*** Issue 8661 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 4272] x.typeof syntax

2010-06-13 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4272


Trass3r  changed:

   What|Removed |Added

 CC||mrmoc...@gmx.de


--- Comment #1 from Trass3r  2010-06-13 17:49:40 PDT ---
Then typeid should probably also be .typeid instead of typeid()

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