473,569 Members | 2,698 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Weird problem - commenting out doesn't work...

Normally, one can put any bull as long as comments are on, as in:

// import yava.biteme.yo_ mamma;

but when i tried to do

//String s = "\u305\u304 8";

the stupid computer tells me to shut up by claiming that it's an
illegal unicode escape. Now, i've bought it, so i'll tell it what is
and what isn't a legal escape.

How come the compiler looks at the comments at all?

Also - i tried to combine "\u305" with an int (taken from a for-loop
that goes from 0 to 9). The same problem there. No, seņor! Enter all
four digits after "\u" or i'll bollock up the compilation for you!

What is this?!
--

Kindly
Konrad
---------------------------------------------------
May all spammers die an agonizing death; have no burial places;
their souls be chased by demons in Gehenna from one room to
another for all eternity and more.

Sleep - thing used by ineffective people
as a substitute for coffee

Ambition - a poor excuse for not having
enough sense to be lazy
---------------------------------------------------


Jul 17 '05 #1
7 3034
Konrad Den Ende wrote:
Normally, one can put any bull as long as comments are on, as in:

// import yava.biteme.yo_ mamma;

but when i tried to do

//String s = "\u305\u304 8";

the stupid computer tells me to shut up by claiming that it's an
illegal unicode escape. Now, i've bought it, so i'll tell it what is
and what isn't a legal escape.

How come the compiler looks at the comments at all?
It evaluates the \u stuff right at the start ("at the lexical level"),
before it tries to do any parsing at all, even before it tries to see what
is comments and what is code. That's not what you expect, but it's what
the language specification says it should do.
Also - i tried to combine "\u305" with an int (taken from a for-loop
that goes from 0 to 9). The same problem there. No, seņor! Enter all
four digits after "\u" or i'll bollock up the compilation for you!


You're trying to define a "string constant", so you can hardly expect it to
take a different value each time you go around the loop.

--
Chris Gray ch***@kiffer.eu net.be

Jul 17 '05 #2
>> Also - i tried to combine "\u305" with an int (taken from a for-loop
that goes from 0 to 9). The same problem there. No, seņor! Enter all
four digits after "\u" or i'll bollock up the compilation for you!


It evaluates the \u stuff right at the start ("at the lexical level"),
before it tries to do any parsing at all, even before it tries to see what
is comments and what is code. That's not what you expect, but it's what
the language specification says it should do.


Got it. It's kind of annoying since i expected it to behave differently
but, as you pointed out, if it's supposed to be that way, one has to
adjust to it and use it.

It's a surprising thing at the very first glance, though.
Thank you.

--

Kindly
Konrad
---------------------------------------------------
May all spammers die an agonizing death; have no burial places;
their souls be chased by demons in Gehenna from one room to
another for all eternity and more.

Sleep - thing used by ineffective people
as a substitute for coffee

Ambition - a poor excuse for not having
enough sense to be lazy
---------------------------------------------------


Jul 17 '05 #3
nos

"chris" <ch***@kiffer.e unet.be> wrote in message
news:bu******** **@reader10.wxs .nl...
Konrad Den Ende wrote:
Normally, one can put any bull as long as comments are on, as in:

// import yava.biteme.yo_ mamma;

but when i tried to do

//String s = "\u305\u304 8";

the stupid computer tells me to shut up by claiming that it's an
illegal unicode escape. Now, i've bought it, so i'll tell it what is
and what isn't a legal escape.

How come the compiler looks at the comments at all?
It evaluates the \u stuff right at the start ("at the lexical level"),
before it tries to do any parsing at all, even before it tries to see what
is comments and what is code. That's not what you expect, but it's what
the language specification says it should do.
Also - i tried to combine "\u305" with an int (taken from a for-loop
that goes from 0 to 9). The same problem there. No, seņor! Enter all
four digits after "\u" or i'll bollock up the compilation for you!


You're trying to define a "string constant", so you can hardly expect it

to take a different value each time you go around the loop.

--
Chris Gray ch***@kiffer.eu net.be

Do you know the url where i can look at this part of the language spec?
TNX
Jul 17 '05 #4
nos wrote:

"chris" <ch***@kiffer.e unet.be> wrote in message
news:bu******** **@reader10.wxs .nl...
Konrad Den Ende wrote:
> Normally, one can put any bull as long as comments are on, as in:
>
> // import yava.biteme.yo_ mamma;
>
> but when i tried to do
>
> //String s = "\u305\u304 8";
>
> the stupid computer tells me to shut up by claiming that it's an
> illegal unicode escape. Now, i've bought it, so i'll tell it what is
> and what isn't a legal escape.
>
> How come the compiler looks at the comments at all?


It evaluates the \u stuff right at the start ("at the lexical level"),
before it tries to do any parsing at all, even before it tries to see
what is comments and what is code. That's not what you expect, but it's
what the language specification says it should do.
> Also - i tried to combine "\u305" with an int (taken from a for-loop
> that goes from 0 to 9). The same problem there. No, seņor! Enter all
> four digits after "\u" or i'll bollock up the compilation for you!


You're trying to define a "string constant", so you can hardly expect it

to
take a different value each time you go around the loop.

--
Chris Gray ch***@kiffer.eu net.be

Do you know the url where i can look at this part of the language spec?
TNX


http://java.sun.com/docs/books/jls/s...doc.html#48198

See also the preceding chapter, which makes it clear that lexical
processing precedes syntactical processing.

You can write a Java program with Chinese variable names and Arabic
comments, and then losslessly translate it into US-ASCII and back again by
using the \unnnn escapes. If you look at it that way, it starts to make
sense.

--
Chris Gray ch***@kiffer.eu net.be
/k/ Embedded Java Solutions

Jul 17 '05 #5
"nos" <no*@nospam.com > wrote:
"chris" <ch***@kiffer.e unet.be> wrote in message

[snip]
It evaluates the \u stuff right at the start ("at the lexical level"),
before it tries to do any parsing at all, even before it tries to see what
is comments and what is code. That's not what you expect, but it's what
the language specification says it should do. [snip]

Do you know the url where i can look at this part of the language spec?


http://java.sun.com/docs/books/jls/s...xical.doc.html
Jul 17 '05 #6
Way too many of these have entered into Java on all fronts. A once elegant
language has become a bug breeding ground.
"Konrad Den Ende" <ch************ @bigfoot.com> wrote in message
news:bu******** **@news.gu.se.. .
Also - i tried to combine "\u305" with an int (taken from a for-loop
that goes from 0 to 9). The same problem there. No, seņor! Enter all
four digits after "\u" or i'll bollock up the compilation for you!


It evaluates the \u stuff right at the start ("at the lexical level"),
before it tries to do any parsing at all, even before it tries to see what is comments and what is code. That's not what you expect, but it's what
the language specification says it should do.


Got it. It's kind of annoying since i expected it to behave differently
but, as you pointed out, if it's supposed to be that way, one has to
adjust to it and use it.

It's a surprising thing at the very first glance, though.
Thank you.

--

Kindly
Konrad
---------------------------------------------------
May all spammers die an agonizing death; have no burial places;
their souls be chased by demons in Gehenna from one room to
another for all eternity and more.

Sleep - thing used by ineffective people
as a substitute for coffee

Ambition - a poor excuse for not having
enough sense to be lazy
---------------------------------------------------

Jul 17 '05 #7
Way too many of these have entered into Java on all fronts. A once elegant
language has become a bug breeding ground.
"Konrad Den Ende" <ch************ @bigfoot.com> wrote in message
news:bu******** **@news.gu.se.. .
Also - i tried to combine "\u305" with an int (taken from a for-loop
that goes from 0 to 9). The same problem there. No, seņor! Enter all
four digits after "\u" or i'll bollock up the compilation for you!


It evaluates the \u stuff right at the start ("at the lexical level"),
before it tries to do any parsing at all, even before it tries to see what is comments and what is code. That's not what you expect, but it's what
the language specification says it should do.


Got it. It's kind of annoying since i expected it to behave differently
but, as you pointed out, if it's supposed to be that way, one has to
adjust to it and use it.

It's a surprising thing at the very first glance, though.
Thank you.

--

Kindly
Konrad
---------------------------------------------------
May all spammers die an agonizing death; have no burial places;
their souls be chased by demons in Gehenna from one room to
another for all eternity and more.

Sleep - thing used by ineffective people
as a substitute for coffee

Ambition - a poor excuse for not having
enough sense to be lazy
---------------------------------------------------

Jul 17 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

19
1501
by: qazmlp | last post by:
I hope comp.lang.c will not find the following question as a complete off-topic. I would like to remove ie.comment out the 'cout' statements during compilation(actually preprocessing) time. The statements like this: cout<<"something\n" ; should be made as
11
13666
by: Les Paul | last post by:
I'm trying to design an HTML page that can edit itself. In essence, it's just like a Wiki page, but my own very simple version. It's a page full of plain old HTML content, and then at the bottom, there's an "Edit" link. So the page itself looks something like this: <HTML><HEAD><TITLE>blah</TITLE></HEAD><BODY> <!-- TEXT STARTS HERE --> ...
5
1385
by: Peter Oliphant | last post by:
I'm drawing graphics using the Graphics object one can grab in a Form's Paint event. But I'm getting a weird thing happening... These graphic shapes flicker (even if unchanged). UNLESS- I created a timer and had the timer update a Label on the form with timer interval set to 10. Now all the shapes I draw in the Paint event of the form draw...
11
1546
by: lofty00 | last post by:
I found what looks like a definite bug in IE. If you load the page below in Firefox, the alert comes up as you would expect. If you run it in IE6 (with sp2), the alert doesn't come up. commenting out the line that starts 'div.class' makes it work. This is very weird, as far as I can see - the code is not run, and it's not generating a syntax...
6
1271
by: julian_m | last post by:
I cant think in any reason why this code fails... Commented line shuldn't be completely ignored by the parser? <?php // ?whatever ehco 'bla bla';
12
2393
by: syn1kk | last post by:
1: float (*data); 2: data = malloc(31 * sizeof(data)); 3: data = VARIABLE; Question 1: The variable data is a float pointer? Question 2: When the is used. Does that mean it is an array of float pointers? What does it mean? Question 3: Or does it mean that there are 16384 floats allocated with
1
1243
by: Wijaya Edward | last post by:
Hi all, I have the following code: import sys import re ham_count = 0 spam_count = 0
18
1977
by: atv | last post by:
at least to me it is. I can't figure out for the life what it is i'm doing wrong here. i have a function called assign_coordinate. usually, i pass a malloced pointer to it, then individual pointers are malloced within that function. No problem here. Now i have a situation in this software, where i need to assign new coordinates to all...
2
1453
by: ruthiefy | last post by:
Hi, I am new to ASP.NET and I started working with 2005. I opened a new project and in the Default.aspx Web Form I clicked the "Design" button in the bottom of the screen so I can edit the layout. For some reason, the "Design" button doesn't work and I can't access the screen layout !!! Besides: the Enter, Backspace and Delete buttons...
9
1721
by: mrstevegross | last post by:
I ran into a weird behavior with lexical scope in Python. I'm hoping someone on this forum can explain it to me. Here's the situation: I have an Outer class. In the Outer class, I define a nested class 'Inner' with a simple constructor. Outer's constructor creates an instance of Inner. The code looks like this: ========= class Outer:...
0
7612
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7924
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8122
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7970
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5219
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3653
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3640
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1213
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
937
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.