Re: Default argument values

2010-05-20 Thread Walter Bright
bearophile wrote: Walter Bright: I don't see how it could be called a dirty hack. Because it's untidy, in the source code it looks like the information of the default value is located in the function definition, while in truth it is stored elsewhere. This can be more efficient, but it is not

Re: Default argument values

2010-05-20 Thread Leandro Lucarella
bearophile, el 20 de mayo a las 16:56 me escribiste: > This page talks about default function argument values in C#4: > http://www.lostechies.com/blogs/jimmy_bogard/archive/2010/05/18/caveats-of-c-4-0-optional-parameters.aspx > > > Near the end it says: > > >If we change the value of the optiona

Re: Default argument values

2010-05-20 Thread bearophile
Walter Bright: > I don't see how it could be called a dirty hack. Because it's untidy, in the source code it looks like the information of the default value is located in the function definition, while in truth it is stored elsewhere. This can be more efficient, but it is not tidy, this abstrac

Re: Default argument values

2010-05-20 Thread Walter Bright
bearophile wrote: D too copies the default value at the calling point. Looking at this from the eyes of a Python programmer this looks like a dirty hack. I don't see how it could be called a dirty hack. This can be a cause of problems in D dlls too, I am not sure. If you're designing a D dl

Re: Default argument values

2010-05-20 Thread Nick Sabalausky
"div0" wrote in message news:ht49le$jg...@digitalmars.com... > > Yeah, I've gone off default arguments, there is rarely a defensibly good > default argument, and you can achieve exactly the same functionality > with overloads. > I often use default args as a shortcut for overloads (where applica

Re: Poll: Primary D version

2010-05-20 Thread Simen kjaeraas
Nick Sabalausky wrote: I've looked into this a little. I was able to download a chart of the IPs, and the number of votes per IP. Unfortunately, there doesn't seem to be any way to tell anything about the actual votes from a particular IP, which I suppose is good for privacy, but it prevent

Re: Default argument values

2010-05-20 Thread bearophile
Brad Roberts: > But that technique can't be done short of runtime optmizing, which > c-family languages (such as D) don't do. See the future -O7 optimizatione level of LLVM/LDC I have just explained: http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D.announce&article_id=184

Re: Default argument values

2010-05-20 Thread Brad Roberts
On Thu, 20 May 2010, bearophile wrote: > Brad Roberts: > > >Converting these to helpers functions will result in a tiny little function > >that will be inlined, so, right back to the same basic problem.< > > I am not sure, but in Scala they can be virtual functions, so the HotSpot > inlines/de

Re: Default argument values

2010-05-20 Thread bearophile
> The nullable is done compactly, with an extra uint argument > that encodes what arguments are actually given or what ones > are not given and need to be initialized inside the function. In ShedSkin things are more complex, the uint has to be a bitmask, because arguments are named and can be sp

Re: Default argument values

2010-05-20 Thread bearophile
Adam Ruppe: > void func(Whatever* options = null) { > if(options is null) > options = Whatever(default blah blah); > } > > (substitute null for any invalid amount for the parameter. I recently > did some timezone functions that used int.min as the default offset, > meaning load it fr

Re: Poll: Primary D version

2010-05-20 Thread Adam Ruppe
As a thought, when/if you decide to write your own polling system, I think it should log the website referrer as well as the voter's ip and choice. It'd be interesting to see stats about skewing from a certain site, like if everyone who followed a link on "d-sucks-ass.org" voted "none and never wi

Re: Poll: Primary D version

2010-05-20 Thread Nick Sabalausky
"Nick Sabalausky" wrote in message news:ht3uj4$30f...@digitalmars.com... > "div0" wrote in message > news:ht3tfa$2sm...@digitalmars.com... >> >> I'm surprised so many people who don't use D bother to read this news >> group and voted on the poll. Surely they must have better things to do. >> >

Re: Default argument values

2010-05-20 Thread div0
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Adam Ruppe wrote: > On 5/20/10, bearophile wrote: >> A default argument may be an arbitrary expression. > > What I do in code where I want this kind of behaviour is something like this: > > void func(Whatever* options = null) { > if(options is n

Re: Default argument values

2010-05-20 Thread Adam Ruppe
On 5/20/10, bearophile wrote: > A default argument may be an arbitrary expression. What I do in code where I want this kind of behaviour is something like this: void func(Whatever* options = null) { if(options is null) options = Whatever(default blah blah); } (substitute null for a

Re: Default argument values

2010-05-20 Thread Brad Roberts
Most inlining is going to cause exactly the same class of problems, which nearly every shipping application is going to do. Converting these to helpers functions will result in a tiny little function that will be inlined, so, right back to the same basic problem. Later, Brad On Thu, 20 May 20

Re: Default argument values

2010-05-20 Thread Nick Sabalausky
"bearophile" wrote in message news:ht47l8$gf...@digitalmars.com... > This page talks about default function argument values in C#4: > http://www.lostechies.com/blogs/jimmy_bogard/archive/2010/05/18/caveats-of-c-4-0-optional-parameters.aspx > > > Near the end it says: > >>If we change the value of

Default argument values

2010-05-20 Thread bearophile
This page talks about default function argument values in C#4: http://www.lostechies.com/blogs/jimmy_bogard/archive/2010/05/18/caveats-of-c-4-0-optional-parameters.aspx Near the end it says: >If we change the value of the optional argument from 0 to 1, we have to >recompile all calling code for

Re: Poll: Primary D version

2010-05-20 Thread Nick Sabalausky
"div0" wrote in message news:ht3tfa$2sm...@digitalmars.com... > > I'm surprised so many people who don't use D bother to read this news > group and voted on the poll. Surely they must have better things to do. > I have a few guesses for that phonomenon: - There are a lot of people who are keepi

Re: Poll: Primary D version

2010-05-20 Thread Nick Sabalausky
"BCS" wrote in message news:a6268ff13eaa8ccc5f8db8fc...@news.digitalmars.com... > Hello Nick, > >> I'm interested in trying to gauge the current state of D version >> usage, so I've set up a poll: >> >> http://micropoll.com/t/KEFfsZBH5F >> >> I apologize for using MicroPoll (and all its >> mandit

Re: Poll: Primary D version

2010-05-20 Thread div0
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Bane wrote: > OMG! I can't even spell OMG right! > >> OBG! I'm minority! (still stuck on 1.030) rofl. you tool. (i mean that in a good way) I'm surprised so many people who don't use D bother to read this news group and voted on the poll. Surely the

Re: Misc questions:- licensing, VC++ IDE compatible, GPGPU, LTCG, QT, SDL

2010-05-20 Thread Walter Bright
retard wrote: It's a rookie mistake to believe that languages have some kind of differences performance wise. Well, they do. It's also true that these performance differences can be swamped by the quality of the implementation, and the ability of the programmer. But that doesn't mean there ar

Re: Poll: Primary D version

2010-05-20 Thread Bane
OMG! I can't even spell OMG right! > OBG! I'm minority! (still stuck on 1.030) > > Nick Sabalausky Wrote: > > > I'm interested in trying to gauge the current state of D version usage, so > > I've set up a poll: > > > > http://micropoll.com/t/KEFfsZBH5F > > > > I apologize for using MicroPoll

Re: Poll: Primary D version

2010-05-20 Thread Bane
OBG! I'm minority! (still stuck on 1.030) Nick Sabalausky Wrote: > I'm interested in trying to gauge the current state of D version usage, so > I've set up a poll: > > http://micropoll.com/t/KEFfsZBH5F > > I apologize for using MicroPoll (and all its manditory-JavaScript-ness). I > personally

Re: Poll: Primary D version

2010-05-20 Thread Leandro Lucarella
Nick Sabalausky, el 20 de mayo a las 02:52 me escribiste: > I'm interested in trying to gauge the current state of D version usage, so > I've set up a poll: > > http://micropoll.com/t/KEFfsZBH5F > > I apologize for using MicroPoll (and all its manditory-JavaScript-ness). I > personally hate Mic

Re: Poll: Primary D version

2010-05-20 Thread BCS
Hello Nick, I'm interested in trying to gauge the current state of D version usage, so I've set up a poll: http://micropoll.com/t/KEFfsZBH5F I apologize for using MicroPoll (and all its manditory-JavaScript-ness). I personally hate MicroPoll but everything else I've seen is even worse and I do