Friday, December 10, 2010

Curl pragma

Chris Barber's Zuzu Curl testing package is a sort of Curl goldmine.

Here is one snippet:

{getter public inline {size}:int

  {pragma suppress SyntaxRequiresInteger}
  {return {bit-count self.mask}}
  {pragma unsuppress SyntaxRequiresInteger}
}
There is very little documentation on pragmas in Curl other than the documentation page for pragma in the package CURL.LANGUAGE.PRAGMA

Here is a short exerpt:
This syntax allows the developer to specify directives in the source code to affect the behavior of advanced versions of the Curl IDE that support real-time error checking. Pragmas are ignored by the Curl RTE and have no effect on the runtime behavior of Curl programs.
That snippet is followed by the caveat that pragmas are only processed by the Curl plugin for Eclipse
One use that I think terrific is {pragma info|warning|error message}An example would be
{pragma info FIX_THIS really klunky and hard to test}

But how to keep these out of code commits (let there be no TODO in thy code escrow....) ?

No comments: