Why must the last part of an Objective-C method name take an argument (when there is more than one part)?

This is Brad Cox. My original answer misunderstood the question. I assumed reallyFast was a hardcoded extension to trigger faster messaging, not a kind of syntactic sugar. The real answer is that Smalltalk didn’t support it, perhaps because its parser couldn’t deal with the (assumed) ambiguity. Although OC’s square brackets would remove any ambiguity, I … Read more

Why is adding null to a string legal?

From MSDN: In string concatenation operations, the C# compiler treats a null string the same as an empty string, but it does not convert the value of the original null string. More information on the + binary operator: The binary + operator performs string concatenation when one or both operands are of type string. If … Read more

Why can’t local variable be used in GNU C basic inline asm statements?

You can use local variables in extended assembly, but you need to tell the extended assembly construct about them. Consider: #include <stdio.h> int main (void) { int data1 = 10; int data2 = 20; int result; __asm__( ” movl %[mydata1], %[myresult]\n” ” imull %[mydata2], %[myresult]\n” : [myresult] “=&r” (result) : [mydata1] “r” (data1), [mydata2] “r” … Read more