MCPcopy Create free account
hub / github.com/crossoverJie/gscript / Peek

Method Peek

stack/stack.go:38–42  ·  view source on GitHub ↗

Peek Peek value, not remove element.

()

Source from the content-addressed store, hash-verified

36
37// Peek Peek value, not remove element.
38func (s *Stack) Peek() interface{} {
39 index := len(*s) - 1
40 element := (*s)[index] // Index into the slice and obtain the element.
41 return element
42}
43
44type Frame struct {
45 scope symbol.Scope

Callers 4

TestStack_PeekFunction · 0.95
pushStackMethod · 0.45
getLeftValueMethod · 0.45
currentScopeMethod · 0.45

Calls

no outgoing calls

Tested by 1

TestStack_PeekFunction · 0.76