Discussion:
SL integer literals
(too old to reply)
t***@engmail.uwaterloo.ca
2004-06-22 00:59:45 UTC
Permalink
Posts to the newsgroup recently seem to have implied that SL integer literals
cannot have any leading zeros. I don't see this anywhere in the SL
specification. It says that integer literals are specified by simply writing
the decimal value of the integer. It seems strange for our implementation to
be constrained to behaviour not required by the specification, and unfair to
the people who finished before the bonus when this requirement had not be
stated.

----------------------------------------
This mail sent through www.mywaterloo.ca
Nguyen Nguyen
2004-06-22 03:32:22 UTC
Permalink
One could argue that the statement "Literal integer values are specified
by writing, in decimal, the numeric value" implies the conventional way of
writing integers. By convention, you do not include leading zeros
because they're redundant.

That being said, the specification should probably spell this out
explicitly. Maybe next time, it will...

Nguyen
Post by t***@engmail.uwaterloo.ca
Posts to the newsgroup recently seem to have implied that SL integer literals
cannot have any leading zeros. I don't see this anywhere in the SL
specification. It says that integer literals are specified by simply writing
the decimal value of the integer. It seems strange for our implementation to
be constrained to behaviour not required by the specification, and unfair to
the people who finished before the bonus when this requirement had not be
stated.
----------------------------------------
This mail sent through www.mywaterloo.ca
Johnny Yip
2004-06-24 04:02:26 UTC
Permalink
Hi,

Given that an input such as "5do" should generate <int 5><DO> (previous
post), should 02 generate <int 0><int 2> instead of returning an error?

Thanks,
Johnny
Post by Nguyen Nguyen
One could argue that the statement "Literal integer values are specified
by writing, in decimal, the numeric value" implies the conventional way of
writing integers. By convention, you do not include leading zeros
because they're redundant.
That being said, the specification should probably spell this out
explicitly. Maybe next time, it will...
Nguyen
Post by t***@engmail.uwaterloo.ca
Posts to the newsgroup recently seem to have implied that SL integer literals
cannot have any leading zeros. I don't see this anywhere in the SL
specification. It says that integer literals are specified by simply writing
the decimal value of the integer. It seems strange for our implementation to
be constrained to behaviour not required by the specification, and unfair to
the people who finished before the bonus when this requirement had not be
stated.
----------------------------------------
This mail sent through www.mywaterloo.ca
Nguyen Nguyen
2004-06-24 04:13:17 UTC
Permalink
According to an early post by Troy, either <INT 0><INT 2> or an error is
acceptable.

Nguyen
Post by Johnny Yip
Hi,
Given that an input such as "5do" should generate <int 5><DO> (previous
post), should 02 generate <int 0><int 2> instead of returning an error?
Thanks,
Johnny
Post by Nguyen Nguyen
One could argue that the statement "Literal integer values are specified
by writing, in decimal, the numeric value" implies the conventional way of
writing integers. By convention, you do not include leading zeros
because they're redundant.
That being said, the specification should probably spell this out
explicitly. Maybe next time, it will...
Nguyen
Post by t***@engmail.uwaterloo.ca
Posts to the newsgroup recently seem to have implied that SL integer literals
cannot have any leading zeros. I don't see this anywhere in the SL
specification. It says that integer literals are specified by simply writing
the decimal value of the integer. It seems strange for our implementation to
be constrained to behaviour not required by the specification, and unfair to
the people who finished before the bonus when this requirement had not be
stated.
----------------------------------------
This mail sent through www.mywaterloo.ca
Loading...