My understanding is that you can indent with any number of spaces or tabs, as long as each line is indented the same as above, or, if a new block is required, indented more, or if a block is ended, indented the same as the previous block.
@Cerberus The online Perl regex docs are really quite extensive, and that isn't even talking about the guts, just the user-level stuff. Plus the Camel's regex chapter is more than 100 pages long, which is followed by a 40-page Unicode chapter that is tightly coupled in many places to regexes.
In computer science and information theory, a Huffman code is a particular type of optimal prefix code that is commonly used for lossless data compression. The process of finding and/or using such a code proceeds by means of Huffman coding, an algorithm developed by David A. Huffman while he was a Ph.D. student at MIT, and published in the 1952 paper "A Method for the Construction of Minimum-Redundancy Codes".
The output from Huffman's algorithm can be viewed as a variable-length code table for encoding a source symbol (such as a character in a file). The algorithm derives this table from t...
Because you type assignment a bazinga times more often than you do equality tests.
So it makes sense for the more common operation to be shorter.
> The latter method is preferred by many due to its greater clarity, and because it supports an expression syntax nearly identical to that in many other languages.
@tchrist granted you can still do that in case-insensitive languages, but when I write a module that calls your constant_symbols and the compiler allows it.....
> The IMPLICIT NONE statement is used to inhibit a very old feature of Fortran that by default treats all variables that start with the letters i, j, k, l, m and n as integers and all other variables as real arguments. Implicit None should always be used. It prevents potential confusion in variable types, and makes detection of typographic errors easier.
At any rate, I don't get how having to declare variables would solve the problem of inadvertently using the same variable name for two things that should be different. You have a problem either way, don't you?
In the case where a function variable got turned to a global, that wouldn't happen because the variable declaration in the function would create a new variable that obscures the first one. In the second case you'd get an error at compile time (or run time) about an undeclared variable
@Cerberus In some languages it would be a compiler error. In most languages it just means that in the function you can't see the global x because there is a local x.
The if block is free to use variables of whatever name it pleases, and cannot be broken if somebody later adds another variable of the same name above or below it.
So if variable declaration is required, p() must declare a new name called x. Later, when someone modifies the global scope to add an x, it doesn't hurt p() because p() already defines its own x. p() can't see the global x but that's fine.
@Cerberus No, if a person adds a new variable "x" to a global scope, they should logically expect that nobody uses it, and anyone they want to use it needs to be modified.
@Cerberus No. I mean, if I take one of your scripts, and add a variable called cat, why should I expect that any function in your script uses that variable?
But I also see a disadvantage: it requires much more coding, doesn't ?
If you forget to declare the function, or if you delete the declaration by accident, or if the code that is supposed to declare it isn't executed for some reason, you have a problem.
But the declaration might be in a function at the top of the script, and I might call it in another function at the bottom. And I have marked the variable as global in both scripts because I will want to use it later again.
Typescript does not give a compiler error for the following code:
var b = a + 10; // Why no compilation error here
var a = 10;
alert(b.toString());
I would expect the first line to be an error as I have not declared or initialized var a till this time.
If I remove the second line I get the ...
> Function1() { I hereby declare global variable x } Function2() { I hereby call upon global variable x} I execute thee, function 2() I multiply thee by three, o global variable x