Skip to content

Filter values ​

filter-values keeps values strictly greater than a threshold. The emitted Go makes the stable traversal and comparison explicit.

Stated source ​

Source mapGrammarVocabularyTypeName / reference
Define filter-values as a function.It accepts an integer sequence named input and an integer named threshold.Collect the input values in encounter order into a fresh sequence. Retain each value only when it is greater than the threshold.

Generated Go ​

go
package generated

func FilterValues(p0 []int64, p1 int64) ([]int64, error) {
	result := make([]int64, 0)
	for _, value := range p0 {
		if value > p1 {
			result = append(result, value)
		}
	}
	return result, nil
}

Download the Stated source · Download the generated Go

Stated compiles controlled English deterministically. It does not call an LLM at compile time.