digitalmars.D.ide - Poll: show op* or not in autocompletion?
- Ary Borenszweig (4/4) Apr 13 2008 Hi,
- Bill Baxter (3/9) Apr 13 2008 Can it show them only after someone types ".op" ?
- Ary Borenszweig (7/18) Apr 13 2008 That's a good idea.
- Ary Borenszweig (6/28) Apr 13 2008 Another way might be to show the op* methods, and when you accept them,
-
Simen Kjaeraas
(10/34)
Apr 13 2008
On Sun, 13 Apr 2008 23:16:48 +0200, Ary Borenszweig
- Hendrik Renken (6/38) Apr 17 2008 i would! In fact this was my first thought when i read your post. i find...
- Ary Borenszweig (6/46) Apr 17 2008 That's another interesting option.
- Hendrik Renken (8/56) Apr 22 2008 i suppose so.
- Frits van Bommel (23/42) Apr 21 2008 A good reason (possibly the only one) to call opCmp explicitly is to
Hi, I'm improving Descent's autocompletion proposals, and I was wondering whether to show or hide methods such as opCmp, opEquals, opCall, etc. What do you think, should an IDE show these or not?
Apr 13 2008
Ary Borenszweig wrote:Hi, I'm improving Descent's autocompletion proposals, and I was wondering whether to show or hide methods such as opCmp, opEquals, opCall, etc. What do you think, should an IDE show these or not?Can it show them only after someone types ".op" ? --bb
Apr 13 2008
Bill Baxter escribió:Ary Borenszweig wrote:That's a good idea. What I'm looking for is some way to hide these methods, because you'd never want to write foo.opCmp(...) but you might just want to know which op* are defined for a given class. So your suggestion might be a solution. Thanks. :-)Hi, I'm improving Descent's autocompletion proposals, and I was wondering whether to show or hide methods such as opCmp, opEquals, opCall, etc. What do you think, should an IDE show these or not?Can it show them only after someone types ".op" ? --bb
Apr 13 2008
Ary Borenszweig escribió:Bill Baxter escribió:Another way might be to show the op* methods, and when you accept them, they turn into the corresponding symbol, like foo.opCmp(o) --> foo == o foo.opAdd(o) --> foo + o But I guess no one will find use in that.Ary Borenszweig wrote:That's a good idea. What I'm looking for is some way to hide these methods, because you'd never want to write foo.opCmp(...) but you might just want to know which op* are defined for a given class. So your suggestion might be a solution. Thanks. :-)Hi, I'm improving Descent's autocompletion proposals, and I was wondering whether to show or hide methods such as opCmp, opEquals, opCall, etc. What do you think, should an IDE show these or not?Can it show them only after someone types ".op" ? --bb
Apr 13 2008
On Sun, 13 Apr 2008 23:16:48 +0200, Ary Borenszweig <ary esperanto.org.a= r> = wrote:Ary Borenszweig escribi=F3:ng =Bill Baxter escribi=F3:Ary Borenszweig wrote:Hi, I'm improving Descent's autocompletion proposals, and I was wonderi=c.whether to show or hide methods such as opCmp, opEquals, opCall, et=d =That's a good idea. What I'm looking for is some way to hide these methods, because you'=What do you think, should an IDE show these or not?Can it show them only after someone types ".op" ? --bbnever want to write foo.opCmp(...) but you might just want to know which op* are defined for a given =, =class. So your suggestion might be a solution. Thanks. :-)Another way might be to show the op* methods, and when you accept them=they turn into the corresponding symbol, like foo.opCmp(o) --> foo =3D=3D o foo.opAdd(o) --> foo + o But I guess no one will find use in that.And why not both? Hide them at first, show them if you start writing ".op", and if you accept them, replace with correct symbol. -- Simen
Apr 13 2008
Ary Borenszweig wrote:Ary Borenszweig escribió:i would! In fact this was my first thought when i read your post. i find this intuitive. As i work often work with eclipse, why not improve the content assistant when you press again strg+space (or what ever), instead of the template proposals, show the .op* symbols.Bill Baxter escribió:Another way might be to show the op* methods, and when you accept them, they turn into the corresponding symbol, like foo.opCmp(o) --> foo == o foo.opAdd(o) --> foo + o But I guess no one will find use in that.Ary Borenszweig wrote:That's a good idea. What I'm looking for is some way to hide these methods, because you'd never want to write foo.opCmp(...) but you might just want to know which op* are defined for a given class. So your suggestion might be a solution. Thanks. :-)Hi, I'm improving Descent's autocompletion proposals, and I was wondering whether to show or hide methods such as opCmp, opEquals, opCall, etc. What do you think, should an IDE show these or not?Can it show them only after someone types ".op" ? --bb
Apr 17 2008
Hendrik Renken wrote:Ary Borenszweig wrote:That's another interesting option. I wonder how to replace opApply, though: foo.opApply(...) --> foreach(a; c) { } ?Ary Borenszweig escribió:i would! In fact this was my first thought when i read your post. i find this intuitive. As i work often work with eclipse, why not improve the content assistant when you press again strg+space (or what ever), instead of the template proposals, show the .op* symbols.Bill Baxter escribió:Another way might be to show the op* methods, and when you accept them, they turn into the corresponding symbol, like foo.opCmp(o) --> foo == o foo.opAdd(o) --> foo + o But I guess no one will find use in that.Ary Borenszweig wrote:That's a good idea. What I'm looking for is some way to hide these methods, because you'd never want to write foo.opCmp(...) but you might just want to know which op* are defined for a given class. So your suggestion might be a solution. Thanks. :-)Hi, I'm improving Descent's autocompletion proposals, and I was wondering whether to show or hide methods such as opCmp, opEquals, opCall, etc. What do you think, should an IDE show these or not?Can it show them only after someone types ".op" ? --bb
Apr 17 2008
Ary Borenszweig schrieb:Hendrik Renken wrote:i suppose so. i would make two entries in the list. one with the method: foo.opMul(...) --> foo.opMul( ) and one with the operator: foo * bar --> foo * bar maybe just show the code that will appear when the entry is selected. and the entries depend on the implemented methods...Ary Borenszweig wrote:That's another interesting option. I wonder how to replace opApply, though: foo.opApply(...) --> foreach(a; c) { ?Ary Borenszweig escribió:i would! In fact this was my first thought when i read your post. i find this intuitive. As i work often work with eclipse, why not improve the content assistant when you press again strg+space (or what ever), instead of the template proposals, show the .op* symbols.Bill Baxter escribió:Another way might be to show the op* methods, and when you accept them, they turn into the corresponding symbol, like foo.opCmp(o) --> foo == o foo.opAdd(o) --> foo + o But I guess no one will find use in that.Ary Borenszweig wrote:That's a good idea. What I'm looking for is some way to hide these methods, because you'd never want to write foo.opCmp(...) but you might just want to know which op* are defined for a given class. So your suggestion might be a solution. Thanks. :-)Hi, I'm improving Descent's autocompletion proposals, and I was wondering whether to show or hide methods such as opCmp, opEquals, opCall, etc. What do you think, should an IDE show these or not?Can it show them only after someone types ".op" ? --bb
Apr 22 2008
Ary Borenszweig wrote:Ary Borenszweig escribió:Indeed, calling them explicitly is rarely useful (but see below)Bill Baxter escribió:Can it show them only after someone types ".op" ?That's a good idea.A good reason (possibly the only one) to call opCmp explicitly is to implement an opCmp for a class/struct in terms of opCmp called on its members. The same goes for opApply by the way, the best use case I have for calling it explicitly is to implement opApply for a larger structure. For example, opApply for a binary tree could be implemented as "left.opApply(dg); dg(this.value); right.opApply(dg)" (and perhaps some null checks). This would prevent extra delegates being wrapped around "dg" as they would be by using "foreach(v; left) dg(v); dg(this.value); foreach(v; right) dg(v);".What I'm looking for is some way to hide these methods, because you'd never want to write foo.opCmp(...)That's a nice idea but it won't work for opCmp since it returns negative for less-than, zero for equal and positive for greater-than, while the comparison operators only return true or false. (And cast(bool)foo.opCmp(o) is the exact opposite of foo == o if opCmp and opEquals are implemented in a natural way) It could work for e.g. arithmetic operators though. But you'd need to be careful to make sure operator precedence doesn't screw things up. In other words: bar * foo.opAdd(baz) --> bar * (foo + baz) NOT: bar * foo.opAdd(baz) --> bar * foo + bazbut you might just want to know which op* are defined for a given class. So your suggestion might be a solution. Thanks. :-)Another way might be to show the op* methods, and when you accept them, they turn into the corresponding symbol, like foo.opCmp(o) --> foo == o foo.opAdd(o) --> foo + o But I guess no one will find use in that.
Apr 21 2008