Liking cljdoc? Tell your friends :D
All platforms.

com.vadelabs.toon.encode.primitives

Primitive value encoding for TOON format.

Handles encoding of nil, booleans, numbers, and strings.

Primitive value encoding for TOON format.

Handles encoding of nil, booleans, numbers, and strings.
raw docstring

encodeclj/s

(encode value)
(encode value delimiter)

Encodes a primitive value to its TOON string representation.

Encoding rules:

  • nil → "null"
  • true → "true"
  • false → "false"
  • numbers → string representation
  • strings → quoted if necessary based on delimiter

Parameters:

  • value: Primitive value (nil, boolean, number, or string)
  • delimiter: Delimiter character being used (default: comma)

Returns: String representation of the primitive value.

Examples: (encode nil) ;=> "null" (encode true) ;=> "true" (encode 42) ;=> "42" (encode "simple") ;=> "simple" (encode "has, comma") ;=> ""has, comma""

Encodes a primitive value to its TOON string representation.

Encoding rules:
- nil → "null"
- true → "true"
- false → "false"
- numbers → string representation
- strings → quoted if necessary based on delimiter

Parameters:
  - value: Primitive value (nil, boolean, number, or string)
  - delimiter: Delimiter character being used (default: comma)

Returns:
  String representation of the primitive value.

Examples:
  (encode nil)          ;=> "null"
  (encode true)         ;=> "true"
  (encode 42)           ;=> "42"
  (encode "simple")   ;=> "simple"
  (encode "has, comma") ;=> "\"has, comma\""
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close