package main

import (
	"fmt"
)

func opRun(val1 value, envs []environ) (value, bool) {
	if !isList(val1) {
		panic(fmt.Errorf("run: %s (%s)", errListExpected, val1.String()))
	}
	return interpret(&scanProvider{isList: true, list: toList(val1)}, envs)
}

func opIf(val1, val2, val3 value, envs []environ) (value, bool) {
	if toBool(val1) {
		return opRun(val2, envs)
	}
	return opRun(val3, envs)
}
