tisp

tiny lisp
git clone git://edryd.org/tisp
Log | Files | Refs | LICENSE

commit 5bc32008609192c89046017386871d687d71f34a
parent 1ed7b501230f6b87a1ea9d13441d572c51f2a6ca
Author: Ed van Bruggen <edvb@uw.edu>
Date:   Sat, 24 Oct 2020 23:31:59 -0700

Use numerator and denominator as ratios' get prop

Diffstat:
tib/math.tsp | 4++--
tisp.c | 4++--
2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/tib/math.tsp b/tib/math.tsp @@ -6,8 +6,8 @@ ;;; Functions -(def (numerator x) (get x 'num)) -(def (denominator x) (get x 'den)) +(def (numerator x) (get x 'numerator)) +(def (denominator x) (get x 'denominator)) (def (inc x) (+ x 1)) (def (dec x) (- x 1)) (def (truncate x) (* (floor (abs x)) (sgn x))) diff --git a/tisp.c b/tisp.c @@ -906,9 +906,9 @@ prim_get(Tsp st, Hash env, Val args) break; case TSP_INT: case TSP_RATIO: - if (!strncmp(prop->v.s, "num", 3)) + if (!strncmp(prop->v.s, "numerator", 3)) return mk_int(v->v.n.num); - if (!strncmp(prop->v.s, "den", 3)) + if (!strncmp(prop->v.s, "denominator", 3)) return mk_int(v->v.n.den); break; case TSP_PAIR: