MCPcopy Create free account
hub / github.com/benbjohnson/immutable / ExampleList_Prepend

Function ExampleList_Prepend

immutable_test.go:522–535  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

520}
521
522func ExampleList_Prepend() {
523 l := NewList[string]()
524 l = l.Prepend("foo")
525 l = l.Prepend("bar")
526 l = l.Prepend("baz")
527
528 fmt.Println(l.Get(0))
529 fmt.Println(l.Get(1))
530 fmt.Println(l.Get(2))
531 // Output:
532 // baz
533 // bar
534 // foo
535}
536
537func ExampleList_Set() {
538 l := NewList[string]()

Callers

nothing calls this directly

Calls 2

PrependMethod · 0.45
GetMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…