Skip to content

Commit

Permalink
Add RTCompat Peek
Browse files Browse the repository at this point in the history
Signed-off-by: James Hamlin <[email protected]>
  • Loading branch information
jfhamlin committed Jan 28, 2024
1 parent 773acc1 commit 8d46a6b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pkg/runtime/rtcompat.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,14 @@ func (rt *RTMethods) NthDefault(x interface{}, i int, def interface{}) interface
return v
}

func (rt *RTMethods) Peek(x interface{}) interface{} {
if IsNil(x) {
return nil
}
stk := x.(IPersistentStack)
return stk.Peek()
}

func (rt *RTMethods) Pop(x interface{}) interface{} {
if IsNil(x) {
return nil
Expand Down

0 comments on commit 8d46a6b

Please sign in to comment.