MCPcopy
hub / github.com/google/mangle / List

Function List

ast/ast.go:371–381  ·  view source on GitHub ↗

List constructs a list constant. Parts can only be accessed in transforms.

(constants []Constant)

Source from the content-addressed store, hash-verified

369
370// List constructs a list constant. Parts can only be accessed in transforms.
371func List(constants []Constant) Constant {
372 list := &ListNil
373 if constants == nil {
374 return *list
375 }
376 for i := len(constants) - 1; i >= 0; i-- {
377 next := ListCons(&constants[i], list)
378 list = &next
379 }
380 return *list
381}
382
383// Map constructs a map constant. Parts can only be accessed in transforms.
384func Map(kvMap map[*Constant]*Constant) *Constant {

Callers 14

TestDisplayStringFunction · 0.92
TestListMapStructFunction · 0.92
TestHasTypeFunction · 0.92
TestFilterFunction · 0.92
TestMatchConsFunction · 0.92
TestListContainsFunction · 0.92
TestReducerCollectFunction · 0.92
TestEvalApplyFnFunction · 0.92
TestNameFunsFunction · 0.92
EvalApplyFnFunction · 0.92
ast_test.goFile · 0.85

Calls 1

ListConsFunction · 0.85

Tested by 12

TestDisplayStringFunction · 0.74
TestListMapStructFunction · 0.74
TestHasTypeFunction · 0.74
TestFilterFunction · 0.74
TestMatchConsFunction · 0.74
TestListContainsFunction · 0.74
TestReducerCollectFunction · 0.74
TestEvalApplyFnFunction · 0.74
TestNameFunsFunction · 0.74
TestHashFunction · 0.68
TestListConstantFunction · 0.68