Re: [SUCCESS] delegator

2012-03-04 Thread bioinfornatics
Le dimanche 04 mars 2012 à 19:22 +0100, bioinfornatics a écrit : > Le dimanche 04 mars 2012 à 02:50 +0100, bioinfornatics a écrit : > > dear, > > I have a little code who is able to delegate to an array see below code: > > https://gist.github.com/1969776 > > > > It should realy great to have same

Re: [SUCCESS] delegator

2012-03-04 Thread bioinfornatics
Le dimanche 04 mars 2012 à 02:50 +0100, bioinfornatics a écrit : > dear, > I have a little code who is able to delegate to an array see below code: > https://gist.github.com/1969776 > > It should realy great to have same into std.array and into std.range > (for reach different range ) > Need he

[SUCCESS] delegator

2012-03-03 Thread bioinfornatics
dear, I have a little code who is able to delegate to an array see below code: https://gist.github.com/1969776 It should realy great to have same into std.array and into std.range (for reach different range )

Re: Delegator

2012-03-03 Thread bioinfornatics
Le samedi 03 mars 2012 à 19:18 +0100, Jacob Carlborg a écrit : > On 2012-03-03 17:50, bioinfornatics wrote: > > Le samedi 03 mars 2012 à 17:42 +0100, bioinfornatics a écrit : > >> hi, > >> In ruby we can delegate some method. by example: > >> Ruby > >> class MineArray > >>include Forw

Re: Delegator

2012-03-03 Thread bioinfornatics
Le samedi 03 mars 2012 à 19:18 +0100, Jacob Carlborg a écrit : > On 2012-03-03 17:50, bioinfornatics wrote: > > Le samedi 03 mars 2012 à 17:42 +0100, bioinfornatics a écrit : > >> hi, > >> In ruby we can delegate some method. by example: > >> Ruby > >> class MineArray > >>include Forw

Re: Delegator

2012-03-03 Thread bioinfornatics
Le samedi 03 mars 2012 à 19:45 +0100, Adam D. Ruppe a écrit : > On Saturday, 3 March 2012 at 16:50:45 UTC, bioinfornatics wrote: > > can w do same in D ? > > alias this does that, although it does for all unknown > methods, not specific ones: > > struct A { > int[] data; > alias data this

Re: Delegator

2012-03-03 Thread Adam D. Ruppe
On Saturday, 3 March 2012 at 16:50:45 UTC, bioinfornatics wrote: can w do same in D ? alias this does that, although it does for all unknown methods, not specific ones: struct A { int[] data; alias data this; } A a; a[0] = 10; // this works like a.data[0] = 10; alias this also lets y

Re: Delegator

2012-03-03 Thread bioinfornatics
Le samedi 03 mars 2012 à 19:18 +0100, Jacob Carlborg a écrit : > On 2012-03-03 17:50, bioinfornatics wrote: > > Le samedi 03 mars 2012 à 17:42 +0100, bioinfornatics a écrit : > >> hi, > >> In ruby we can delegate some method. by example: > >> Ruby > >> class MineArray > >>include Forw

Re: Delegator

2012-03-03 Thread Jacob Carlborg
On 2012-03-03 17:50, bioinfornatics wrote: Le samedi 03 mars 2012 à 17:42 +0100, bioinfornatics a écrit : hi, In ruby we can delegate some method. by example: Ruby class MineArray include Forwardable def_delegators: @array, :[], :[]=, :each_with_index, :length def initialize(

Re: Delegator

2012-03-03 Thread bioinfornatics
Le samedi 03 mars 2012 à 17:42 +0100, bioinfornatics a écrit : > hi, > In ruby we can delegate some method. by example: > Ruby > class MineArray > include Forwardable > def_delegators: @array, :[], :[]=, :each_with_index, :length > > def initialize( array ) > @array = array >

Delegator

2012-03-03 Thread bioinfornatics
hi, In ruby we can delegate some method. by example: Ruby class MineArray include Forwardable def_delegators: @array, :[], :[]=, :each_with_index, :length def initialize( array ) @array = array end end - this code delegate opIndexAssign opIndex, length ... attrib