shithub: femtolisp

Download patch

ref: 87f00731e2864debf2efe657de5181fbe5e17a72
parent: de6e8e4292e56df2ff007cc97faf58fcc031a070
author: mag <mag-one@autistici.org>
date: Fri May 26 18:18:01 EDT 2023

mpint -> bignum

--- a/cvalues.c
+++ b/cvalues.c
@@ -7,7 +7,7 @@
 #endif
 
 value_t int8sym, uint8sym, int16sym, uint16sym, int32sym, uint32sym;
-value_t int64sym, uint64sym, mpintsym;
+value_t int64sym, uint64sym, bignumsym;
 value_t longsym, ulongsym, bytesym, wcharsym;
 value_t floatsym, doublesym;
 value_t gftypesym, stringtypesym, wcstringtypesym;
@@ -338,7 +338,7 @@
 	return 0;
 }
 
-/* */ BUILTIN("mpint", mpint)
+BUILTIN("bignum", bignum)
 {
 	if(nargs == 0){
 		PUSH(fixnum(0));
@@ -350,6 +350,7 @@
 	return cv;
 }
 
+
 value_t
 mk_mpint(mpint *n)
 {
@@ -1629,8 +1630,8 @@
 	mk_primtype(float, float);
 	mk_primtype(double, double);
 
-	ctor_cv_intern(mpint, T_MPINT, mpint*);
-	mpinttype = get_type(mpintsym);
+	ctor_cv_intern(bignum, T_MPINT, mpint*);
+	mpinttype = get_type(bignumsym);
 	mpinttype->init = cvalue_mpint_init;
 	mpinttype->vtable = &mpint_vtable;
 
--- a/print.c
+++ b/print.c
@@ -716,7 +716,7 @@
 			HPOS += ios_printf(f, "%"PRIu64, ui64);
 		else
 			HPOS += ios_printf(f, "#%s(%"PRIu64")", symbol_name(type), ui64);
-	}else if(type == mpintsym){
+	}else if(type == bignumsym){
 		mpint *i = *(mpint**)data;
 		char *s = mptoa(i, 10, nil, 0);
 		if(weak || print_princ)