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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.