Data update

This commit is contained in:
Ingy döt Net 2025-08-11 18:05:26 -07:00
parent 4d5544505c
commit 4924dd0264
3073 changed files with 55820 additions and 4408 deletions

View file

@ -0,0 +1,24 @@
(defvar *modulus* nil)
(defmacro define-enhanced-op (enhanced-op op)
`(defun ,enhanced-op (&rest args)
(if *modulus*
(mod (apply ,op args) *modulus*)
(apply ,op args))))
(define-enhanced-op enhanced+ #'+)
(define-enhanced-op enhanced-expt #'expt)
(defun f (x)
(enhanced+ (enhanced-expt x 100) x 1))
;; Use f on regular integers.
(princ "No modulus: ")
(princ (f 10))
(terpri)
;; Use f on modular integers.
(let ((*modulus* 13))
(princ "modulus 13: ")
(princ (f 10))
(terpri))