PtcRunner.Lisp.Keyword (PtcRunner v0.12.0)

Copy Markdown View Source

Runtime representation for PTC-Lisp keywords that are not in the bounded atom vocabulary.

Existing atom-backed keywords remain atoms for compatibility. New source keywords use this struct so user input cannot grow the BEAM atom table while keywords stay distinct from strings.

Summary

Functions

Whether name is a syntactically valid keyword name per the parser grammar.

Types

t()

@type t() :: %PtcRunner.Lisp.Keyword{name: String.t()}

Functions

keyword?(atom)

@spec keyword?(term()) :: boolean()

name(atom)

@spec name(atom() | t()) :: String.t()

new(name)

@spec new(String.t()) :: t()

valid_name?(name)

@spec valid_name?(term()) :: boolean()

Whether name is a syntactically valid keyword name per the parser grammar.

A novel keyword externalizes to a plain binary, so this is the check callers use to tell a genuine externalized keyword from an arbitrary string at a boundary.