www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - UFCS vs auto-completion support

reply Jay Norwood <jayn prismnet.com> writes:
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
parent reply cym13 <cpicard openmailbox.org> writes:
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
parent Jay Norwood <jayn prismnet.com> writes:
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