LogoLogo
  • Internet Object 1.0
  • Internet Object
    • Abstract
    • The Poetic Principles of Internet Object
    • Objectives
    • Introducing Internet Object
  • The Structure
    • Internet Object Document
      • Header
      • Data Sections
    • Structural Elements
      • Structural Characters and Literals
      • Literals
      • Other Special Characters
      • Whitespaces
    • Values Representations
      • Objects
      • Arrays
      • Strings
        • Open Strings
        • Regular Strings
        • Raw Strings
      • Numeric Values
        • Number
        • BigInt
        • Decimal
        • NaN and Infinity
      • Base64
      • Date and Time
      • Booleans
      • Nulls
    • Comments
    • Encoding
  • The Collections
    • Collection
    • Creating Collection
    • Collection Rules
    • Data Streaming
  • The Definitions
    • Definitions
    • Variables
    • Complex Schema
  • Schema Definition Language
    • Internet Object Schema
    • The structure
    • Data Types
      • Any
      • String
        • String Derived Types
          • Email
          • URL
          • Date
          • Time
          • DateTime
      • Number
        • Derived Types
          • int
          • byte
          • int16
          • int32
      • Object
      • Array
      • Bool
      • Base64
      • Date and Time
    • Dynamic Schema
    • MemberDef (with Object Schema Comparison)
    • TypeDef
  • Other
    • Best Practices
    • FAQs
    • Contributors
    • License
Powered by GitBook
On this page
Edit on GitHub
Export as PDF
  1. The Structure

Values Representations

Overview of value types in Internet Object

PreviousWhitespacesNextObjects

Last updated 1 month ago

Was this helpful?

CtrlK
  • Value Categories
  • Scalar Values
  • Structured Values
  • String Types
  • Numeric Types
  • Temporal Types
  • Binary Data
  • Value Syntax Overview
  • Type Coercion and Conversion
  • Comments and Whitespace
  • Encoding and Character Support
  • Navigation
  • Quick Links
  • By Use Case
  • See Also

Was this helpful?

Internet Object supports a rich set of value types that represent different kinds of data. Values are the fundamental building blocks of Internet Object documents, ranging from simple scalar values like numbers and strings to complex structured values like objects and arrays.

All values in Internet Object are designed to be:

  • Human-readable: Easy to read and write by humans

  • Machine-parseable: Efficiently processed by computers

  • Type-safe: Clear distinction between different data types

  • Expressive: Rich enough to represent complex data structures

Value Categories

Internet Object values are organized into several categories:

Scalar Values

Scalar values represent single, atomic pieces of data:

  • Numbers - Numeric values including integers, floats, and special numeric types

  • Strings - Text data with various encoding and formatting options

  • Booleans - True/false values

  • Null - Absence of value

  • Base64 Byte Strings - Binary data encoded as Base64

  • Date and Time - Temporal values with ISO 8601 compatibility

Structured Values

Structured values contain other values and provide organization:

  • Objects - Key-value pairs representing entities

  • Arrays - Ordered collections of values

String Types

Internet Object provides several string types to handle different text scenarios:

Type
Syntax
Description
Use Cases

Regular Strings

"text" or 'text'

Standard quoted strings with escape sequences

General text, user input, formatted content

Open Strings

unquoted text

Strings without quotes

Simple identifiers, natural language

Raw Strings

r"text" or r'text'

Literal strings without escape processing

File paths, regex patterns, code snippets

Numeric Types

Internet Object supports various numeric types for different precision and range requirements:

Type
Syntax
Description
Range

Numbers

42, 3.14, 1e10

Standard floating-point numbers

IEEE 754 double precision

BigInt

42n, 0x1ABn

Arbitrary precision integers

Unlimited

Decimal

42.5m, 3.14159m

High-precision decimal numbers

Configurable precision

Special Values

NaN, Inf, -Inf

Non-finite numeric values

IEEE 754 special values

Temporal Types

Internet Object provides built-in support for date and time values:

Type
Syntax
Description
Example

Date

d'2024-03-20'

Date-only values

d'2024-03-20', d'2024'

Time

t'14:30:45'

Time-only values

t'14:30:45.123', t'09:00'

DateTime

dt'2024-03-20T14:30:45Z'

Combined date and time

dt'2024-03-20T14:30:45.123Z'

Binary Data

For binary data representation, Internet Object uses:

  • Base64 Byte Strings (b'SGVsbG8=') - Efficient encoding of binary data as text

Value Syntax Overview

Here's a quick reference of value syntax in Internet Object:

# Scalar Values
42                                     # Number
"Hello, World!"                        # Regular string
'Single quotes work too'               # Regular string
unquoted string                        # Open string
r"C:\Users\file.txt"                   # Raw string
true                                   # Boolean
false                                  # Boolean
null                                   # Null
b'SGVsbG8gV29ybGQ='                    # Base64 byte string
d'2024-03-20'                          # Date
t'14:30:45'                            # Time
dt'2024-03-20T14:30:45Z'               # DateTime

# Structured Values
{                                      # Object
  name: "John Doe",
  age: 30,
  active: true
}

[1, 2, 3, "four", true]                # Array

Type Coercion and Conversion

Internet Object maintains strict type boundaries:

  • No implicit conversion: Values retain their declared types

  • Explicit parsing: Type conversion happens during parsing based on syntax

  • Validation: Type constraints are enforced during processing

  • Preservation: Original format and type information is maintained

Comments and Whitespace

Values can be accompanied by:

  • Comments: # This is a comment

  • Whitespace: Flexible spacing and indentation

  • Line breaks: Multi-line value formatting

{
  # User information
  name: "John Doe",    # Full name
  age: 30,             # Age in years

  # Contact details
  email: "[email protected]"
}

Encoding and Character Support

Internet Object values support:

  • Unicode: Full Unicode character set (UTF-8 encoding)

  • Escape sequences: Standard escape codes in regular strings

  • Raw representation: Literal character preservation in raw strings

  • Normalization: Unicode normalization for consistent processing

Navigation

Quick Links

  • Scalar Types: Numbers • Strings • Booleans • Null • Binary Data • Date & Time

  • Structured Types: Objects • Arrays

By Use Case

  • Text Data: String Types - Regular, Open, and Raw strings

  • Numeric Data: Number Types - Standard, BigInt, Decimal, and Special values

  • Temporal Data: Date and Time - Dates, times, and datetimes

  • Binary Data: Base64 Byte Strings - Encoded binary content

  • Logical Data: Booleans and Null

  • Complex Data: Objects and Arrays

See Also

  • Internet Object Structure Overview - Understanding the overall document structure

  • Schema Definition Language - Type definitions and validation

  • Best Practices - Guidelines for effective Internet Object usage