MCPcopy
hub / github.com/fluentpython/example-code-2e / Sym

Function Sym

18-with-match/lispy/original/lispy.py:11–14  ·  view source on GitHub ↗

Find or create unique Symbol entry for str s in symbol table.

(s, symbol_table={})

Source from the content-addressed store, hash-verified

9class Symbol(str): pass
10
11def Sym(s, symbol_table={}):
12 "Find or create unique Symbol entry for str s in symbol table."
13 if s not in symbol_table: symbol_table[s] = Symbol(s)
14 return symbol_table[s]
15
16_quote, _if, _set, _define, _lambda, _begin, _definemacro, = map(Sym,
17"quote if set! define lambda begin define-macro".split())

Callers 1

atomFunction · 0.85

Calls 1

SymbolClass · 0.85

Tested by

no test coverage detected