Copying and in-place methods [was: Why is array truth tied to .ptr?]

Leandro Lucarella llucax at gmail.com
Thu Dec 13 07:47:55 PST 2007


Robert DaSilva, el 12 de diciembre a las 21:23 me escribiste:
> Leandro Lucarella wrote:
> > Robert DaSilva, el 11 de diciembre a las 21:31 me escribiste:
> >>> Ok, good catch, maybe that syntax is not right but you missed the big
> >>> picture (a compiler generated default implementation for a copying
> >>> function that can be overrideable).
> >>>
> >>> If you now write t.sort.dup(), you are exactly doing that: duplicating t
> >>> and then sorting it (in-place I guess). If the implementor has a more
> >>> eficient way to use the copy while sorting, you miss that, or you have to
> >>> change the syntax (to t.dupsort() for example).
> >>>
> >> I'm just saying that t.sort.dup() can *only* mean sort t then duplicate
> >> what sort returns (an error as sort returns void); unless sort is a
> >> struck that overloads opCall, but it's not.
> > 
> > I was talking about a new feature proposal. I know it doesn't work now.
> > 
> 

I don't like to repeat myself, but you force me :)

> I'm say it could *NEVER* work because that already has a well defined
> behaver

> >>> Ok, good catch, maybe that syntax is not right but you missed the big
> >>> picture (a compiler generated default implementation for a copying
> >>> function that can be overrideable).

> and a sub-function can only be called by it's direct parent
> function, it own sub-function or sibling sub functions and their
> sub-functions, because it *needs* a context pointer to it's parent
> functions' stack.

>From my first e-mail:
"I know we have a problem to access to dup() nested function because it
needs a stack frame, but ..."

Are you even reading my e-mails? =)

-- 
Leandro Lucarella (luca) | Blog colectivo: http://www.mazziblog.com.ar/blog/
----------------------------------------------------------------------------
GPG Key: 5F5A8D05 (F8CD F9A7 BF00 5431 4145  104C 949E BFB6 5F5A 8D05)
----------------------------------------------------------------------------
aFR [afr at my.farts.cause.nuclear.reaction.org] has quit IRC (Ping timeout)



More information about the Digitalmars-d mailing list