Thread overview | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
June 24, 2006 String Basics | ||||
---|---|---|---|---|
| ||||
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 Re: String Basics | ||||
---|---|---|---|---|
| ||||
Posted in reply to Heinz | 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 Re: String Basics | ||||
---|---|---|---|---|
| ||||
Posted in reply to Heinz | 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 Re: String Basics | ||||
---|---|---|---|---|
| ||||
Posted in reply to Yossarian | 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 Re: String Basics | ||||
---|---|---|---|---|
| ||||
Posted in reply to Heinz | 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 Re: String Basics | ||||
---|---|---|---|---|
| ||||
Posted in reply to Heinz | "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 Re: String Basics | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jarrett Billingsley | "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 Re: String Basics | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jarrett Billingsley | 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 Re: String Basics | ||||
---|---|---|---|---|
| ||||
Posted in reply to Anders F Björklund |
Anders F Björklund wrote:
> So, D is "unmanaged". At least until D# :-)
Well, what about D++ then? <g>
|
June 25, 2006 Re: String Basics | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andrei Khropov | 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/ |
Copyright © 1999-2021 by the D Language Foundation