Rebrand sexp → sx across web platform (173 files)
Rename all sexp directories, files, identifiers, and references to sx. artdag/ excluded (separate media processing DSL). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
66
shared/sx/__init__.py
Normal file
66
shared/sx/__init__.py
Normal file
@@ -0,0 +1,66 @@
|
||||
"""
|
||||
S-expression language core.
|
||||
|
||||
Parse, evaluate, and serialize s-expressions. This package provides the
|
||||
foundation for the composable fragment architecture described in
|
||||
``docs/sx-architecture-plan.md``.
|
||||
|
||||
Quick start::
|
||||
|
||||
from shared.sx import parse, evaluate, serialize, Symbol, Keyword
|
||||
|
||||
expr = parse('(let ((x 10)) (+ x 1))')
|
||||
result = evaluate(expr) # → 11
|
||||
|
||||
expr2 = parse('(map (fn (n) (* n n)) (list 1 2 3))')
|
||||
result2 = evaluate(expr2) # → [1, 4, 9]
|
||||
"""
|
||||
|
||||
from .types import (
|
||||
NIL,
|
||||
Component,
|
||||
Keyword,
|
||||
Lambda,
|
||||
Symbol,
|
||||
)
|
||||
from .parser import (
|
||||
ParseError,
|
||||
parse,
|
||||
parse_all,
|
||||
serialize,
|
||||
)
|
||||
from .evaluator import (
|
||||
EvalError,
|
||||
evaluate,
|
||||
make_env,
|
||||
)
|
||||
from .primitives import (
|
||||
all_primitives,
|
||||
get_primitive,
|
||||
register_primitive,
|
||||
)
|
||||
from .env import Env
|
||||
|
||||
__all__ = [
|
||||
# Types
|
||||
"Symbol",
|
||||
"Keyword",
|
||||
"Lambda",
|
||||
"Component",
|
||||
"NIL",
|
||||
# Parser
|
||||
"parse",
|
||||
"parse_all",
|
||||
"serialize",
|
||||
"ParseError",
|
||||
# Evaluator
|
||||
"evaluate",
|
||||
"make_env",
|
||||
"EvalError",
|
||||
# Primitives
|
||||
"register_primitive",
|
||||
"get_primitive",
|
||||
"all_primitives",
|
||||
# Environment
|
||||
"Env",
|
||||
]
|
||||
Reference in New Issue
Block a user