Skip to content
This repository has been archived by the owner on Mar 19, 2021. It is now read-only.

Commit

Permalink
Add ClearHistory()
Browse files Browse the repository at this point in the history
Allows the caller to reset the history of past evaluations.
  • Loading branch information
Devin Carraway committed Aug 8, 2018
1 parent 41b6cd2 commit 0bc48ea
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions compute/compute.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ import (

var resHistory = []float64{}

// ClearHistory removes prior evaluation history used for @ references.
func ClearHistory() {
resHistory = []float64{}
}

func Evaluate(in string) (float64, error) {
floats := NewFloatStack()
ops := NewStringStack()
Expand Down

0 comments on commit 0bc48ea

Please sign in to comment.