Skip to content

Copy values ​

This smallest complete Stated source defines copy-values. The generated CopyValues function returns a fresh sequence while preserving every occurrence and its encounter order.

Stated source ​

Source mapGrammarVocabularyTypeName / reference
Define copy-values as a function.It accepts an integer sequence named input.Collect the input values in encounter order into a fresh sequence. Retain every occurrence.

Generated Go ​

go
package generated

func CopyValues(p0 []int64) ([]int64, error) {
	result := make([]int64, len(p0))
	copy(result, p0)
	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.