shithub: mc

ref: 51d5a41b3f09a15fef2f427a129f877365d10bf6
dir: /test/constslice.myr/

View raw version
use std

const slpart = array[1:3]
const slfull = array[:]
const slinline = [6,7,8][:]
const array = [1,2,3,4,5]

const main = {
	/* expected output 23 */
	for x in slpart
		std.put("%i", x)
	;;
	/* expected output 12345 */
	for x in slfull
		std.put("%i", x)
	;;
	/* expected output 678 */
	for x in slinline
		std.put("%i", x)
	;;
	std.put("\n")
}