Python def function: How do you specify the end of the function?

In Python whitespace is significant. The function ends when the indentation becomes smaller (less). Note that one-line functions can be written without indentation, on one line: And, then there is the use of semi-colons, but this is not recommended: The three forms above show how the end of a function is defined syntactically. As for the semantics, in … Read more

How to fix syntax error, unexpected T_IF error in php?

PHP parser errors take some getting used to; if it complains about an unexpected ‘something’ at line X, look at line X-1 first. In this case it will not tell you that you forgot a semi-colon at the end of the previous line , instead it will complain about the if that comes next. You’ll … Read more

text highlight in markdown

As the markdown documentation states, it is fine to use HTML if you need a feature that is not part of Markdown. HTML5 supports Expand snippet Else you can use span as suggested by Rad Lexus

What does the `and` keyword mean in OCaml?

The and keyword is used either to avoid multiple let (first example, I never use it for this but why not) or for mutually recursive definitions of types, functions, modules… As you can see in your second example : debug calls debugl and vice versa. So the and is allowing that. [EDIT] It bothered me … Read more

Static Semantics meaning?

Semantics is about meaning. It includes: the static semantics, which is the part that can be ascertained at compile time, including data typing, whether all variables are declared, which declaration applies to which variable in the case of scoping, what their type is, whether functions and methods are called with correct calling sequences, whether assignments … Read more

Why are hexadecimal numbers prefixed with 0x?

Short story: The 0 tells the parser it’s dealing with a constant (and not an identifier/reserved word). Something is still needed to specify the number base: the x is an arbitrary choice. Long story: In the 60’s, the prevalent programming number systems were decimal and octal — mainframes had 12, 24 or 36 bits per byte, which is nicely divisible by 3 = … Read more