[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: OT - trivial programming language



Kai Grossjohann wrote:
> To wit, consider this piece of code, based on tab width = 4:

    Ok, let's use alternating t and T to represent the tab characters.

> for(;;) {
> TTTTif (a == b) {
> TTTTttttsome_long_function_name(a,
> TTTTttttTTTTttttTTTTttttTTTTttttb);
> TTTT}
> }

> I used spaces only in this message, please pretend that my style of
> mixing tabs and spaces was used.  Changing tab display width to 8
> will then produce this:

    Well, of course it would, You used nothing but tabs to achieve the
alignment you wanted.  There's no mixing of spaces and tabs.  A better example
actually mixes tabs and spaces.  T and t for alternating tabs.  S for spaces.

TW = 4

for(;;) {
TTTTif (a == b) {
TTTTttttsome_long_function(a,
TTTTttttTTTTttttTTTTttttSSSb);
TTTT}
}

TW = 8

for(;;) {
TTTTTTTTif (a == b) {
TTTTTTTTttttttttsome_long_function(a,
TTTTTTTTttttttttTTTTTTTTttttttttTTTTTTTTttttttttSSSb);
TTTTTTTT}
}

    Whoops, a and b no longer line up!

TW=2

for(;;) {
TTif (a == b) {
TTttsome_long_function(a,
TTttTTttTTttSSSb);
TT}
}

    Whoops, a and b no longer line up!

    Maybe I'm misunderstanding something in your proposal.  How, exactly, did
your magiv work?  :P

-- 
         Steve C. Lamb         | I'm your priest, I'm your shrink, I'm your
       PGP Key: 8B6E99C5       | main connection to the switchboard of souls.
-------------------------------+---------------------------------------------

Attachment: signature.asc
Description: OpenPGP digital signature


Reply to: