lisp-polymorph / polymorph.maths

Maths for polymorph.stl

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

polymorph.maths

  • Equality
(define-polymorphic-function = (&rest args))
(define-polymorphic-function /= (&rest args))

Equality checks if all supplied objects are clones of each other. Recursive. Always returns boolean. If only one object is supplied always returns T. If objects of incomparable types are supplied defaults to nil, and if the incomparability of types is known at compile time signals a warning about it.

(define-polymorphic-function < (&rest args))
(define-polymorphic-function <= (&rest args))
(define-polymorphic-function > (&rest args))
(define-polymorphic-function >= (&rest args))

Standard mathematical comparison. By default is defined as reals, chars, and strings. Always returns boolean. If only one object is supplied always returns T. Supplying objects of incomparable types is an error.

(define-polymorphic-function min (first &rest args))
(define-polymorphic-function max (first &rest args))

Min and max are based on < and > operator defined above.

(define-polymorphic-function + (&rest args))
((define-polymorphic-function - (x &rest args))
d(define-polymorphic-function * (&rest args))
efine-polymorphic-function / (x &rest args))

Standard mathematical operations. Defined for numbers. + and - are also defined for chars. Always returns object from the same domain. For numbers adhere to clhs documentation.

About

Maths for polymorph.stl


Languages

Language:Common Lisp 100.0%