PtcRunner.Lisp.Keyword (PtcRunner v0.14.0)

Copy Markdown View Source

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

Names in the parser's bounded vocabulary use their fixed atom representation. Other 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.