January 28, 2007
"Jarrett Billingsley" <kb3ctd2@yahoo.com> wrote in message news:epikg9$2lmu$1@digitaldaemon.com...
> "Lionello Lunesu" <lionello@lunesu.remove.com> wrote in message news:ephjmf$12sd$1@digitaldaemon.com...
>>
>>
>> Shouldn't string literals be forced "const"? Even D's limited const could do that. To create a mutable copy you'd be forced to used .dup.
>>
>> const char[] either = "asdfsadf";
>> char[] or = "asdfsd".dup;
>>
>
> That wouldn't help, because even if you pass a const char[] into a function that takes a char[], that function can still modify it.  The const goes away.

Perhaps, but at least assignments of string literals to variables would be clearly marked as const, and functions written with Copy On Write in mind would have no problems with const strings passed to them.

L.


January 28, 2007
Jarrett Billingsley wrote:
> "Lionello Lunesu" <lionello@lunesu.remove.com> wrote in message news:ephjmf$12sd$1@digitaldaemon.com...
>>
>> Shouldn't string literals be forced "const"? Even D's limited const could do that. To create a mutable copy you'd be forced to used .dup.
>>
>> const char[] either = "asdfsadf";
>> char[] or = "asdfsd".dup;
>>
> 
> That wouldn't help, because even if you pass a const char[] into a function that takes a char[], that function can still modify it.  The const goes away. 

I sincerely hope that passing a const T through an api asking for a T will be illegal once D starts to grow some const abilities.  If not, what's the point of the const declaration?  So, the above will definitely help.

Later,
Brad
January 29, 2007
Walter Bright wrote:
> Bob W wrote:
>>>> Sounds like you work under Windows... :o)
>> ..........
>>> Yep, looks like he does (mostly) :).
>>
>> He is a smart guy who probably does not feel like
>> beta testing operating systems. Or maybe he just
>> ran out of coffee too often while waiting for penguin's
>> favorite compiler and linker to finish their jobs ....   ;-)
>
> g++ is a slow compiler, and ld is a really slow linker, and I'm just
> more used to windows quirks than linux quirks.
>
> But the worst thing about linux development is gdb. gdb's user interface
> seems stuck in 1983 era thinking. I can't even get the thing to display
> the register contents. It won't pick up the program arguments from the
> command line. Either I'm stupid, all this is missing from the
> documentation, or gdb really is terrible.
>
> I do all my debugging on windows. Even horrible old windbg is a decade
> ahead of gdb.

True, but now there's zero: www.zero-bugs.com.

> I do like gcov, though.

And gprof too.


Andrei
January 29, 2007
Jarrett Billingsley wrote:
> "Lionello Lunesu" <lionello@lunesu.remove.com> wrote in message news:ephjmf$12sd$1@digitaldaemon.com...
>>
>> Shouldn't string literals be forced "const"? Even D's limited const could do that. To create a mutable copy you'd be forced to used .dup.
>>
>> const char[] either = "asdfsadf";
>> char[] or = "asdfsd".dup;
>>
> 
> That wouldn't help, because even if you pass a const char[] into a function that takes a char[], that function can still modify it.  The const goes away. 

This was kind of "forced by design" because const was a storage class not allowed in function arguments. D will do the right thing as soon as it gets full-fledged const.

Andrei
January 29, 2007
Walter Bright escribió:
> Thomas Kuehne wrote:
>> Walter Bright schrieb am 2007-01-28:
>> [...]
>>> But the worst thing about linux development is gdb. gdb's user interface seems stuck in 1983 era thinking.
>>
>> Have you tried "insight" or "ddd"? 
> 
> No, I've never heard of them. Insight isn't on my machine. ddd is, and looks interesting. I'll try it.

DDD has an ugly interface, but it's one of the best debuggers I know, because it unique (AFAIK) feature to show the memory structures graphically.

-- 
Leandro Lucarella
Integratech S.A.
4571-5252
January 29, 2007
Walter Bright escribió:
>> The built-in help to gdb isn't bad either.. though sometimes hard to find stuff in.
> 
> I missed the 'info registers' command because gdb doesn't list 'info' when you type 'help' on its command prompt. Thanks for the tip.

BTW, ddd has a registers window, you have threads, backtrace and assembly windows too. GDB it's a great powerful debugger, *commandline* debugger, if you want a GUI debugger, DDD is a great GDB frontend. You can try better-looking KDE's Kdevelop fronten, kdbg (another standalone KDE GDB frontend), insight, and if you like console based there are other fronends too, like cgdb, which even has source displaying with syntax highlight for example, among others.

-- 
Leandro Lucarella
Integratech S.A.
4571-5252
February 01, 2007
Andrei Alexandrescu (See Website For Email) wrote:
> True, but now there's zero: www.zero-bugs.com.

But it's not open source :(

Luís
1 2 3 4
Next ›   Last »