Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > String: "anti" string oprator

Reply
Thread Tools

String: "anti" string oprator

 
 
Rui Maciel
Guest
Posts: n/a
 
      01-29-2011
Marcin Grzegorczyk wrote:

> As a matter of nitpick, it doesn't have to be an interpreted language.
> D is an example of a compiled language which allows this sort of
> 'de-tokenization' of string constants, as well as compile-time string
> operations like concatenation and substringing.
>
> But, of course, none of that is available in standard C.


While we are in the process of picking nits, I believe that, in this
context, Seebs' reference to "compile time" was made regarding the
preprocessing stage. Considering this, it is not possible to look at the
contents of a variable which is defined through a grammar which your
parser (in this case the C preprocessor) either doesn't recognize as such
or simply ignores.

To put it in other words, in CPP terms a variable declaration/definition
in C is not a variable declaration at all. It is simply noise which
should be ignored. As a consequence, it doesn't exist and therefore it's
contents cannot be accessed.


Rui Maciel
 
Reply With Quote
 
 
 
 
James Kuyper
Guest
Posts: n/a
 
      01-29-2011
On 01/29/2011 12:59 PM, Marcin Grzegorczyk wrote:
> Seebs wrote:

....
>> On some systems there's ways to look up symbols that were already defined
>> by names, but there's no way to do this at compile time. Try an
>> intepreted language.

>
> As a matter of nitpick, it doesn't have to be an interpreted language. D
> is an example of a compiled language which allows this sort of
> 'de-tokenization' of string constants, as well as compile-time string
> operations like concatenation and substringing.


The OP's example was not trying to detokenize a string constant, it was
trying to make use of a variable declared as a pointer to char.

--
James Kuyper
 
Reply With Quote
 
 
 
 
Marcin Grzegorczyk
Guest
Posts: n/a
 
      01-31-2011
James Kuyper wrote:
> The OP's example was not trying to detokenize a string constant, it was
> trying to make use of a variable declared as a pointer to char.


Yes, but the OP also talked about “"anti" string”, presumably meaning a
"destringization" operator ("de-tokenization" was a wrong word to use on
my part, sorry about that). And his second example did not involve any
variables.
--
Marcin Grzegorczyk
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
'System.String[]' from its string representation 'String[] Array' =?Utf-8?B?UmFqZXNoIHNvbmk=?= ASP .Net 0 05-04-2006 04:29 PM
Is "String s = "abc";" equal to "String s = new String("abc");"? Bruce Sam Java 15 11-19-2004 06:03 PM
String[] files = {"a.doc, b.doc"}; VERSUS String[] files = new String[] {"a.doc, b.doc"}; Matt Java 3 09-17-2004 10:28 PM
String.replaceAll(String regex, String replacement) question Mladen Adamovic Java 3 12-05-2003 04:20 PM
Re: String.replaceAll(String regex, String replacement) question Mladen Adamovic Java 0 12-04-2003 04:40 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57