digitalmars.D.learn - UFCS vs auto-completion support
- Jay Norwood (9/9) Jan 09 2016 I'm reading Jack Stouffer's documentation:
- cym13 (11/20) Jan 09 2016 I may be very naive but how is the second form more complicated
- Jay Norwood (15/17) Jan 09 2016 Pretending these were regular function implementations ...
I'm reading Jack Stouffer's documentation: http://jackstouffer.com/blog/nd_slice.html considering the UFCS example below and how it would impact auto-completion support. auto slice = sliced(iota(1000), 5, 5, 40); auto slice = 1000.iota.sliced(5, 5, 40); Seems like auto-complete support for the second form would be complicated. Do any of the auto-completion implementations even attempt to support that second form?
Jan 09 2016
On Saturday, 9 January 2016 at 15:50:33 UTC, Jay Norwood wrote:I'm reading Jack Stouffer's documentation: http://jackstouffer.com/blog/nd_slice.html considering the UFCS example below and how it would impact auto-completion support. auto slice = sliced(iota(1000), 5, 5, 40); auto slice = 1000.iota.sliced(5, 5, 40); Seems like auto-complete support for the second form would be complicated. Do any of the auto-completion implementations even attempt to support that second form?I may be very naive but how is the second form more complicated than the first? To me when typing "sliceā¦" the autocomplete engine has to choose from all structures, classes, basic types, functions and keywords accessible from the top namespace but also all types and functions defined in the local namespace. In the ".slice" case it only has to choose from struct/classe methods if it's called on a defined type and all functions in top namespace. It seems way easier to me although you first have to identify the return type of the previous element to be accurate.
Jan 09 2016
On Saturday, 9 January 2016 at 16:00:51 UTC, cym13 wrote:I may be very naive but how is the second form more complicated than the first?Pretending these were regular function implementations ... 1000. 1000.iota. 1000.iota.sliced( iota( sliced( sliced(iota( I wouldn't be surprised if auto-completion provided correct possible parameter type lists for the last three, but obviously the first two would provide no help, and I'd be pleasantly surprised if the third form provided the parameter type list without the first parameter. anyway ... I'll just try some simple cases in VisualD and eclipse DDT and see what they come up with.
Jan 09 2016