www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Re: Apparently unsigned types really are necessary

reply Era Scarecrow <rtcvb32 yahoo.com> writes:
 Points:
 1) that 2nd formatting still includes whitespace that would
 be illegal 
 (e.g. every place but between 'void' and 'print' and in the
 strings 
 litereals).
 2) The *point* is to turn code into an unreadable mash on a
 single line.
 3) The entire proposal is satire.

Ahh, i had the impression from the list that all whitespace tokens were referring to a single statement line, not as a whole. Guess the only way to make it so spaces (1 or more) were whitespace, would be if we still use a fixed 80character width screen for our editors, then leftover whitespace becomes formatting. But it seems sufficiently stupid to do that, filesize being the largest part. I know all of C appeared in it's formatting, to allow you to drop all whitespace (with minor exceptions) into a single line, which is why /**/ comments were used and c++'s // ones were added later. Although fun to do a whole lot on a single line, i don't know if i would want to. /*C code following the follow proposal; tested and works. Not bad for 165 characters of pure code.*/ isprime(int n){int cnt=2;if(n<2)return 0;for(;cnt<n;cnt++)if((n%cnt)==0)return 0;return 1;} main(){int cnt=2;for(;cnt<100;cnt++)if (isprime(cnt))printf("%d ", cnt);}
Jan 22 2012
parent reply "Marco Leise" <Marco.Leise gmx.de> writes:
Am 23.01.2012, 00:22 Uhr, schrieb Era Scarecrow <rtcvb32 yahoo.com>:

 Points:
 1) that 2nd formatting still includes whitespace that would
 be illegal
 (e.g. every place but between 'void' and 'print' and in the
 strings
 litereals).
 2) The *point* is to turn code into an unreadable mash on a
 single line.
 3) The entire proposal is satire.

Ahh, i had the impression from the list that all whitespace tokens were referring to a single statement line, not as a whole. Guess the only way to make it so spaces (1 or more) were whitespace, would be if we still use a fixed 80character width screen for our editors, then leftover whitespace becomes formatting. But it seems sufficiently stupid to do that, filesize being the largest part. I know all of C appeared in it's formatting, to allow you to drop all whitespace (with minor exceptions) into a single line, which is why /**/ comments were used and c++'s // ones were added later. Although fun to do a whole lot on a single line, i don't know if i would want to. /*C code following the follow proposal; tested and works. Not bad for 165 characters of pure code.*/ isprime(int n){int cnt=2;if(n<2)return 0;for(;cnt<n;cnt++)if((n%cnt)==0)return 0;return 1;} main(){int cnt=2;for(;cnt<100;cnt++)if (isprime(cnt))printf("%d ", cnt);}

Sorry, but you still have unnecessary spaces in 3 places ;)
Jan 23 2012
parent bcs <bcs example.com> writes:
On 01/23/2012 02:11 AM, Marco Leise wrote:
 Am 23.01.2012, 00:22 Uhr, schrieb Era Scarecrow <rtcvb32 yahoo.com>:

 Points:
 1) that 2nd formatting still includes whitespace that would
 be illegal
 (e.g. every place but between 'void' and 'print' and in the
 strings
 litereals).
 2) The *point* is to turn code into an unreadable mash on a
 single line.
 3) The entire proposal is satire.

Ahh, i had the impression from the list that all whitespace tokens were referring to a single statement line, not as a whole. Guess the only way to make it so spaces (1 or more) were whitespace, would be if we still use a fixed 80character width screen for our editors, then leftover whitespace becomes formatting. But it seems sufficiently stupid to do that, filesize being the largest part. I know all of C appeared in it's formatting, to allow you to drop all whitespace (with minor exceptions) into a single line, which is why /**/ comments were used and c++'s // ones were added later. Although fun to do a whole lot on a single line, i don't know if i would want to. /*C code following the follow proposal; tested and works. Not bad for 165 characters of pure code.*/ isprime(int n){int cnt=2;if(n<2)return 0;for(;cnt<n;cnt++)if((n%cnt)==0)return 0;return 1;} main(){int cnt=2;for(;cnt<100;cnt++)if (isprime(cnt))printf("%d ", cnt);}

Sorry, but you still have unnecessary spaces in 3 places ;)

4, the space between the leading comment and 'isprime' must be removed as well.
Jan 23 2012