Jump to page: 1 2
Thread overview
String Basics
Jun 24, 2006
Heinz
Jun 24, 2006
Frank Benoit
Jun 24, 2006
Yossarian
Jun 24, 2006
David Medlock
Jun 24, 2006
Heinz
Jun 25, 2006
Andrei Khropov
Jun 25, 2006
James Pelcis
Jun 26, 2006
Stewart Gordon
Jul 22, 2006
Kent Boogaart
Jul 23, 2006
Mike Parker
Jul 23, 2006
Stewart Gordon
June 24, 2006
Hi, it's a kind of silly question: How can i use a string as a type? for example i want to pass a parameter as a string but the compiler says string is not defined, which module dhould i import to work with strings?

thx.


June 24, 2006
In D there is no "string". Instead there is char[] (, dchar[] or wchar[]).

There are some utility functions in std.string, but for making use of char[] you need nothing to be imported.
June 24, 2006
Heinz napsal(a):
> Hi, it's a kind of silly question: How can i use a string as a type? for example
> i want to pass a parameter as a string but the compiler says string is not
> defined, which module dhould i import to work with strings?
> 
> thx.
> 
> 
try to write somewhere in declaration part:
alias char[] string;
or use char[] as string:)
June 24, 2006
Yossarian wrote:

> Heinz napsal(a):
> 
>> Hi, it's a kind of silly question: How can i use a string as a type? for example
>> i want to pass a parameter as a string but the compiler says string is not
>> defined, which module dhould i import to work with strings?
>>
>> thx.
>>
>>
> try to write somewhere in declaration part:
> alias char[] string;
or get Walter to put this in phobos!

:D

-DavidM
June 24, 2006
In article <e7imaq$2jql$1@digitaldaemon.com>, Heinz says...
>
>Hi, it's a kind of silly question: How can i use a string as a type? for example i want to pass a parameter as a string but the compiler says string is not defined, which module dhould i import to work with strings?
>
>thx.
>
>

Thanks guys for your answers. I know it is a basic stuff, i used to work with char[] in lower level languages but now i was used to the string type in managed languages.

I'll use an alias for now but hope Walter to add a string type in phobos.


June 25, 2006
"Heinz" <Heinz_member@pathlink.com> wrote in message news:e7jj7v$sdo$1@digitaldaemon.com...

> Thanks guys for your answers. I know it is a basic stuff, i used to work
> with
> char[] in lower level languages but now i was used to the string type in
> managed
> languages.

D is "managed" ;)  That's just MS's fancy term for "Garbage Collected."

> I'll use an alias for now but hope Walter to add a string type in phobos.

You'd be surprised, but char[] handles just about any kind of string handling.  I've never felt like I was lacking an explicit string type in D.


June 25, 2006
"Jarrett Billingsley" <kb3ctd2@yahoo.com> wrote in message news:e7kplh$2h7u$1@digitaldaemon.com...

> That's just MS's fancy term for "Garbage Collected."

Though it might mean more.  I've only ever heard it in the context of being "garbage collected."


June 25, 2006
Jarrett Billingsley wrote:

> D is "managed" ;)  That's just MS's fancy term for "Garbage Collected."

Managed means virtual machine. http://en.wikipedia.org/wiki/Managed_code
The usual / native code is now (belittlingly) known as Unmanaged code...

So, D is "unmanaged". At least until D# :-)

--anders
June 25, 2006
Anders F Björklund wrote:

> So, D is "unmanaged". At least until D# :-)

Well, what about D++ then? <g>
June 25, 2006
Andrei Khropov wrote:
> Anders F Björklund wrote:
> 
>> So, D is "unmanaged". At least until D# :-)
> 
> Well, what about D++ then? <g> 

That's already taken.

http://www.pagemac.com/dpp/
« First   ‹ Prev
1 2