Skip to content

Commit 8d46a6b

Browse files
committed
Add RTCompat Peek
Signed-off-by: James Hamlin <[email protected]>
1 parent 773acc1 commit 8d46a6b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

pkg/runtime/rtcompat.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,14 @@ func (rt *RTMethods) NthDefault(x interface{}, i int, def interface{}) interface
5555
return v
5656
}
5757

58+
func (rt *RTMethods) Peek(x interface{}) interface{} {
59+
if IsNil(x) {
60+
return nil
61+
}
62+
stk := x.(IPersistentStack)
63+
return stk.Peek()
64+
}
65+
5866
func (rt *RTMethods) Pop(x interface{}) interface{} {
5967
if IsNil(x) {
6068
return nil

0 commit comments

Comments
 (0)