Code Style¶
Follow the official Nim style guide as used throughout the codebase:
- 2-space indentation,
camelCasefor procs and variables,PascalCasefor types. - Mark public API symbols with
*; keep implementation details unexported.
GEOS binding rules¶
- Declare raw
libgeos_cbindings only insrc/nimgeos/private/geos_abi.nim— feature modules import it but never re-declare bindings elsewhere. - Guard every public entry point with the existing guards —
checkContext(context.nim),checkHandleforGeometry(geometry.nim) andCoordSeq(geometries/coord_seq.nim) — following the established pattern: guard → call the_rbinding → raiseGeosGeomErrorwhen GEOS returns nil or an exception code. - Raise only error types from
src/nimgeos/errors.nim, with messages matching the existing conventions ("<op> called on nil Geometry","<op> failed"). See Error Types.