June 11, 2002 Re: Simple question | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter | "Walter" <walter@digitalmars.com> wrote in message news:ae0vvr$18iq$1@digitaldaemon.com... > "OddesE" <OddesE_XYZ@hotmail.com> wrote in message news:ae0enc$nhq$1@digitaldaemon.com... > > "Matthew Wilson" <mwilson@nextgengaming.com> wrote in message news:adm69r$1pt3$1@digitaldaemon.com... > > > simply: > > > > > > - unique says there is no aliasing elsewhere (in the walkable tree of arguments in "this" function call) of the ptr so marked. > > > > > > - ref incorporates unique, and states that the ptr so marked cannot be > > NULL > > > (or rather that it will not be NULL - it's still possible to pass NULL > in > > > C/C++ of course) > > > > > > As I said, this is a simple explanation, but captures the most > interesting > > > features. If anyone wants to provide a fullsome explanation, be my guest > > ... > > > > > > > > > > > > "Walter" <walter@digitalmars.com> wrote in message news:adlhnj$166m$1@digitaldaemon.com... > > > > > > > > "OddesE" <OddesE_XYZ@hotmail.com> wrote in message news:acqivc$a3j$1@digitaldaemon.com... > > > > > Walter is there still any need for IDL in D, > > > > > or are all constructs supported by IDL also > > > > > supported by D? What do you do with the > > > > > unique and ref keywords for instance? > > > > > > > > I don't remember what those keywords do. > > > > > > > > > > > > > > > > > > Basically they aid COM in the decision for > > marshaling code to use. Let's say you pass > > a circular linked list. Since you cannot > > pass pointers across boundaries you will > > have to copy the block of memory each > > pointer is pointing at. However you might > > get in an infinite loop when passing a > > circular linked list, so you have to check > > each pointer to see if you already passed it > > before. Using unique tells the IDL compiler > > that every pointer will be unique, so the > > extra checking code is not needed, making > > the marshaling faster. > > > > > > -- > > Stijn > > OddesE_XYZ@hotmail.com > > http://OddesE.cjb.net > > _________________________________________________ > > Remove _XYZ from my address when replying by mail > > > > > > > > > Thanks for the illumination. D doesn't have something directly comparable. And that makes perfect sense, COM is proprietary, D isn't. But just don't write off IDL yet... :) -- Stijn OddesE_XYZ@hotmail.com http://OddesE.cjb.net _________________________________________________ Remove _XYZ from my address when replying by mail |
Copyright © 1999-2021 by the D Language Foundation