From 8656383c44f2080e59c526ff3b7fb7ac4c2301a9 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Mon, 17 Oct 2016 22:00:26 -0700 Subject: Provide functions to alter range objects. Ranges continue to be immutable; but a backdoor is needed for upcoming support for circular notation. * lib.c (set_from, set_to): New functions. * lib.h (set_from, set_to): Declared. --- lib.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'lib.c') diff --git a/lib.c b/lib.c index c032bde1..46033a21 100644 --- a/lib.c +++ b/lib.c @@ -8712,6 +8712,20 @@ val to(val range) return range->rn.to; } +val set_from(val range, val from) +{ + type_check(range, RNG); + set(mkloc(range->rn.from, range), from); + return range; +} + +val set_to(val range, val to) +{ + type_check(range, RNG); + set(mkloc(range->rn.to, range), to); + return range; +} + val env(void) { if (env_list) { -- cgit v1.2.3