On 2011-05-30 19:53, Nick Sabalausky wrote:
> "Ary Manzana" wrote in message
> news:is1hsa$p53$1...@digitalmars.com...
>
> > On 5/31/11 7:58 AM, Nick Sabalausky wrote:
> >> "bearophile" wrote in message
> >> news:is1dj6$ihb$1...@digitalmars.com...
> >>
> >>> Jesse Phillips:
> The purpose i
"Ary Manzana" wrote in message
news:is1hsa$p53$1...@digitalmars.com...
> On 5/31/11 7:58 AM, Nick Sabalausky wrote:
>> "bearophile" wrote in message
>> news:is1dj6$ihb$1...@digitalmars.com...
>>> Jesse Phillips:
>>>
The purpose is commenting out code, but note that there is also
versio
On 2011-05-30 18:52, Ary Manzana wrote:
> On 5/31/11 7:58 AM, Nick Sabalausky wrote:
> > "bearophile" wrote in message
> > news:is1dj6$ihb$1...@digitalmars.com...
> >
> >> Jesse Phillips:
> >>> The purpose is commenting out code, but note that there is also
> >>> version(none) { } which is never
Jonathan M Davis:
> What _is_ a bad idea is leaving in sections of commented out code when you
> check in code.<
Right, that's what I meant. Commenting out parts is fine while you are fixing
or writing code.
Bye,
bearophile
On 5/31/11 7:58 AM, Nick Sabalausky wrote:
"bearophile" wrote in message
news:is1dj6$ihb$1...@digitalmars.com...
Jesse Phillips:
The purpose is commenting out code, but note that there is also
version(none) { } which is never compiled in.
version(none) {} is probably the official way to com
On 2011-05-30 17:43, bearophile wrote:
> Jesse Phillips:
> > The purpose is commenting out code, but note that there is also
> > version(none) { } which is never compiled in.
>
> version(none) {} is probably the official way to comment out code.
> And if you use a versioning system to keep your co
"bearophile" wrote in message
news:is1dj6$ihb$1...@digitalmars.com...
> Jesse Phillips:
>
>> The purpose is commenting out code, but note that there is also
>> version(none) { } which is never compiled in.
>
> version(none) {} is probably the official way to comment out code.
> And if you use a
Jesse Phillips:
> The purpose is commenting out code, but note that there is also version(none)
> { } which is never compiled in.
version(none) {} is probably the official way to comment out code.
And if you use a versioning system to keep your code, then commenting out code
is not a so wise th
%u Wrote:
> what is the purpose of nested comments ?
The purpose is commenting out code, but note that there is also version(none) {
} which is never compiled in.
Stewart Gordon:
> Only if purity rules are relaxed. AIUI, one of the restrictions at the
> moment is that in
> a pure function only immutable data can be accessed. As long as this
> restriction remains
> in place, adding the restriction of purity to asserts would erode their
> usefulness.
On 5/31/11 1:34 AM, Stewart Gordon wrote:
On 29/05/2011 14:03, bearophile wrote:
Stewart Gordon:
There are places where the spec fails to make a clear distinction
between illegal code and
incorrect code that the compiler may reject if it's smart enough.
In D there are pure functions, so I th
On 2011-05-30 16:34, Stewart Gordon wrote:
> On 29/05/2011 14:03, bearophile wrote:
> > Stewart Gordon:
> >> There are places where the spec fails to make a clear distinction
> >> between illegal code and incorrect code that the compiler may reject if
> >> it's smart enough.
> >
> > In D there are
On 29/05/2011 14:03, bearophile wrote:
Stewart Gordon:
There are places where the spec fails to make a clear distinction between
illegal code and
incorrect code that the compiler may reject if it's smart enough.
In D there are pure functions, so I think it's not too much hard for it to tell
I understand it
thanks
> commenting out code?? example please
/+
/* this is code: */
int more_code; // more code
code(more_code+even_more_code(1321));
+/
commenting out code?? example please
> Timon Gehr:
>
>> The answer is yes, theoretically it could. (It would either have to have
>> some very
>> advanced code analysis caps, or would just have to treat enforce specially.)
>
> Id's not so advanced stuff.
>
> Bye,
> bearophile
You are saying that analyzing a function for thrown except
On 2011-05-30 15:03, Brad Roberts wrote:
> On 5/30/2011 2:55 PM, Jonathan M Davis wrote:
> > I'd be very surprised to see the compiler ever optimize code based on
> > assert or enforce statement. It's unlikely to do so based on assert
> > simply because the assertion is going to be compiled out. I
On 5/30/2011 2:55 PM, Jonathan M Davis wrote:
> I'd be very surprised to see the compiler ever optimize code based on assert
> or enforce statement. It's unlikely to do so based on assert simply because
> the assertion is going to be compiled out. I think that there's a high chance
> that optim
Timon Gehr:
> The answer is yes, theoretically it could. (It would either have to have some
> very
> advanced code analysis caps, or would just have to treat enforce specially.)
Id's not so advanced stuff.
Bye,
bearophile
On 2011-05-30 14:39, Timon Gehr wrote:
> Jonathan M Davis wrote:
> > On 2011-05-30 12:49, simendsjo wrote:
> >> I'm having some problems trying to get the best of both worlds here.
> >>
> >> void f(Class c) {
> >>
> >>assert(c != null);
> >>// use c
> >>
> >> }
> >>
> >> In this example
On 2011-05-30 14:21, Adam D. Ruppe wrote:
> I use them when commenting out code or when writing documentation
> examples. (which may have comments nested inside the doc comment)
>
> Commenting out code is the purpose in general though.
Yeah, it's really annoying to comment out code with /* */ whe
On 2011-05-30 14:17, Sean Eskapp wrote:
> I'm trying to compile a very simple file, main.d:
>
> void main()
> {
> }
>
> Under Windows 7, 64-bit, with out-of-the-box DMD v2.053 installation. I get
> this, however:
>
> C:\Users\Me\devl\test>dmd -m64 main.d
> Internal error: msc.c 268
There is no
Jonathan M Davis wrote:
> On 2011-05-30 12:49, simendsjo wrote:
>> I'm having some problems trying to get the best of both worlds here.
>>
>> void f(Class c) {
>>assert(c != null);
>>// use c
>> }
>>
>> In this example, we tell the compiler that c is never able to be null.
>> The compiler c
On 5/30/11 11:17 PM, Sean Eskapp wrote:
I'm trying to compile a very simple file, main.d:
void main()
{
}
Under Windows 7, 64-bit, with out-of-the-box DMD v2.053 installation. I get
this, however:
C:\Users\Me\devl\test>dmd -m64 main.d
Internal error: msc.c 268
x86_64 isn't supported on Windo
I use them when commenting out code or when writing documentation
examples. (which may have comments nested inside the doc comment)
Commenting out code is the purpose in general though.
what is the purpose of nested comments ?
I'm trying to compile a very simple file, main.d:
void main()
{
}
Under Windows 7, 64-bit, with out-of-the-box DMD v2.053 installation. I get
this, however:
C:\Users\Me\devl\test>dmd -m64 main.d
Internal error: msc.c 268
On 2011-05-30 12:49, simendsjo wrote:
> I'm having some problems trying to get the best of both worlds here.
>
> void f(Class c) {
>assert(c != null);
>// use c
> }
>
> In this example, we tell the compiler that c is never able to be null.
> The compiler can use assertions like this for o
simendsjo:
> void f(Class c) {
>assert(c != null);
>// use c
> }
>
> In this example, we tell the compiler that c is never able to be null.
> The compiler can use assertions like this for optimizations (not sure if
> dmd does this though).
I think currently DMD is not using this inform
On 2011-05-30 08:54, choi heejo wrote:
> Greeting.
>
> I tried to compile this code with DMD 2.053:
>
> @property bool isZero(float value)
> {
> return value < float.epsilon;
> }
>
> void main()
> {
> 0.1f.isZero;
> readln();
> }
>
> But the compiler said,
>
> no property 'isZero' for type 'f
On 2011-05-30 06:42, Johann MacDonagh wrote:
> I'm wondering if there's a cleaner way to do this:
>
> class Test(T = uint)
> {
> this(string s)
> {
> }
> }
>
> void main(string[] argv)
> {
> auto a = new Test!()("test");
> }
>
> I'd *like* to be able to do this:
>
> auto a =
I'm having some problems trying to get the best of both worlds here.
void f(Class c) {
assert(c != null);
// use c
}
In this example, we tell the compiler that c is never able to be null.
The compiler can use assertions like this for optimizations (not sure if
dmd does this though).
But
On 5/30/11 5:54 PM, choi heejo wrote:
Greeting.
I tried to compile this code with DMD 2.053:
@property bool isZero(float value)
{
return value < float.epsilon;
}
void main()
{
0.1f.isZero;
readln();
}
But the compiler said,
no property 'isZero' for type 'float'.
I cannot understand this err
Greeting.
I tried to compile this code with DMD 2.053:
@property bool isZero(float value)
{
return value < float.epsilon;
}
void main()
{
0.1f.isZero;
readln();
}
But the compiler said,
no property 'isZero' for type 'float'.
I cannot understand this error.
On 30.05.2011 19:14, Jeff Slutter wrote:
On 5/30/2011 10:57 AM, Dmitry Olshansky wrote:
It was me who brought it Unilink out of infernal abyss :) See also:
http://www.digitalmars.com/d/archives/digitalmars/D/announce/Alternative_linker_win32_64_20086.html
Seriously I still suggest to try it o
On 5/30/2011 10:57 AM, Dmitry Olshansky wrote:
> It was me who brought it Unilink out of infernal abyss :) See also:
> http://www.digitalmars.com/d/archives/digitalmars/D/announce/Alternative_linker_win32_64_20086.html
>
>
> Seriously I still suggest to try it out, and at any rate author showed
On 5/30/2011 10:12 AM, Jacob Carlborg wrote:
If you want to use the default parameter I think you have to do this:
auto a = new Test!()("test");
Yeah, that's the best I could come up with too :( I suppose users can
alias it if necessary. Thanks!
On 30.05.2011 16:57, Trass3r wrote:
Am 30.05.2011, 04:09 Uhr, schrieb Jeff Slutter :
One of the things that's important to us is being able to link against
some existing C/C++ static libraries (built with VS 2008, so PE COFF
format).
Good luck with that. DLLs are no problem but static librarie
On 2011-05-30 15:42, Johann MacDonagh wrote:
I'm wondering if there's a cleaner way to do this:
class Test(T = uint)
{
this(string s)
{
}
}
void main(string[] argv)
{
auto a = new Test!()("test");
}
I'd *like* to be able to do this:
auto a = new Test("test");
and:
auto a = new Test!double("
I'm wondering if there's a cleaner way to do this:
class Test(T = uint)
{
this(string s)
{
}
}
void main(string[] argv)
{
auto a = new Test!()("test");
}
I'd *like* to be able to do this:
auto a = new Test("test");
and:
auto a = new Test!double("test");
The only possibility
Am 30.05.2011, 04:09 Uhr, schrieb Jeff Slutter :
One of the things that's important to us is being able to link against
some existing C/C++ static libraries (built with VS 2008, so PE COFF
format).
Good luck with that. DLLs are no problem but static libraries are another
story.
objconv has ne
42 matches
Mail list logo