ID:143257
 

So since I started out in DM a couple weeks ago I couldn't quit figure out what the problem was with a lot of my codes as they should have worked the way they were layed out. I kept running into issues where if I typed something out myself, If I tried to cut and paste all of a sudden kapoof, indent errors up the wazzoo with no discernible reason.
Finally I figured it out I think, before a section of code the computer identifies spaces as different from tabs. so space space space vs 1 tab are different even if they look the same, and often times DM can't seem to handle that difference.
My questions would be 1: What the heck is the purpose of DM reading spaces as different from tabs (when theyre in proportion with the same end visual layout.)?
2: Why can't DM be programmed not to have that be the case?

anyhow invisible indent errors blow imo.

mike
idk but you can view tabs in DM.

options > show tabs
I've never had this problem.
The only time I get indentation errors after pasting code is when I left a space or something on accident on the line around or after the thing I'm pasting. Or when I actually indent incorrectly.
I don't even see how you could have this problem without actually indenting incorrectly.
Unless your compiler caches your tabs and spaces and uses that data the next time you attempt to compile, which would be really weird/ridiculous (so it probably doesn't happen).
In response to Keeth
I didn't realize there was that option in DM, but i have very often had problems where if I write somethingout myself the same way as before it works just fine, but if I cut and paste something that I got from like a demo or something, the snippet invariable gives me all kinds of grief when I begin editing it to customize it to whatever I'm using it for. THe last one this was happening on was a character creation snip
something of the switch(input("...") in list("...","...")) variety, it would work until I added a line somewhere like to create more options or even just to put another src << "..." text line. even though the new line did nothing to the old there would suddenly be 8 indent errors on everything below the new line that lined up just along where everything else had been. I don't get why it does this either but when youre learning DM and have as much trouble figuring out what youre doing wrong as I do these phantoms are an incredible headache.

mike
No. Just no. Tabs!=spaces. Don't indent with spaces, indent with tabs. Why doesn't it handle them the same? Because they're different, that's why.

If you want to see whether you've got tabs or spaces, hit 'ctrl-t'.

They're not phantom errors, they're really there.
In response to Jp
Jp wrote:
No. Just no. Tabs!=spaces. Don't indent with spaces, indent with tabs. Why doesn't it handle them the same? Because they're different, that's why.

If you want to see whether you've got tabs or spaces, hit 'ctrl-t'.

They're not phantom errors, they're really there.

Now that we've agreed that they are really errors, what is the purpose of DM not compiling them as the same thing?, is there some advantage for the language doing this?

Mike
In response to Kichimichi
Yes, there is an advantage. They're not the same thing. You shouldn't treat them the same, because they're not the same.

Also, there's probably situations that could create ambiguity if they were treated the same.

It should never come up, because you should never be indenting with spaces. It just shouldn't happen.
In response to Jp
meh, okie dokie, im over it now anyway
tx for the responses anyhow
mike