Random
Source Code

sprong

A five-character sequence of C code: Left-square-bracket, zero, right-square-bracket, hyphen, greater-than.

Sprongs are a specific programming trick for C and C++ that can be used to quickly access a struct when you have a handle (a pointer-to-a-pointer) to it. Instead of "(**handle).member" you can use the equivalent code "handle0->member". The somewhat unusual construct "0->" is pronounced "sprong", and brings to mind the sound of a spring. The word may have been coined by Maf Vosburgh.

The use of sprongs was common among Macintosh computer programmers circa System 7 in the mid-1990s because of the large number of handles used in the Mac OS API.

Without sprongs: (** (** GetMainDevice() ).gdPMap ).pixelSize
With sprongs: GetMainDevice() 0-> gdPMap 0-> pixelSize

by drewthaler June 29, 2006

34👍 21👎