Tricks

As the creator of a programming language and the developer of the interpreter, it is much easier for me to see through the intricacies of the features to underlying functionality of the interpreter itself. This knowledge manifests itself in programming “tricks” that allow certain operations to be done that may not be obvious. Here are some that I’ve used. If there’s something you need done and it doesn’t seem to fit into any language feature, try to work around it. You may find a loophole that you didn’t know existed.

Returning an Array of Nonstructured Type from a Function

Although it is not allowed to declare a function as

int [] 
not_legal() 
{
  int array[ARRAY_SIZE]={1,2,3,4,5,-1}; 
  return array; 
}

it is still possible to return an ...

Get Sun Performance and Tuning: Java™ and the Internet, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.