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

Function require

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

Signal a syntax error if predicate is false.

(x, predicate, msg="wrong length")

Source from the content-addressed store, hash-verified

270 return list(map(expand, x)) # (f arg...) => expand each
271
272def require(x, predicate, msg="wrong length"):
273 "Signal a syntax error if predicate is false."
274 if not predicate: raise SyntaxError(to_string(x)+': '+msg)
275
276_append, _cons, _let = map(Sym, "append cons let".split())
277

Callers 3

expandFunction · 0.85
expand_quasiquoteFunction · 0.85
letFunction · 0.85

Calls 1

to_stringFunction · 0.85

Tested by

no test coverage detected