Skip to content

Commit

Permalink
Merge branch 'types' of https://github.com/bennn/mechanics into types
Browse files Browse the repository at this point in the history
  • Loading branch information
bkc39 committed Oct 14, 2015
2 parents 5302303 + 42b6ed4 commit e321e31
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion private/kernel/generics.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@
(define zero? base:zero?)

(define (one? obj) (= obj 1))

(define identity? one?)]))

(define-generics numeric
Expand All @@ -122,9 +123,10 @@
#:defaults
([number?
(define (negate x) (- x))

(define (atan x [y #f])
(if y (base:atan x y) (base:atan y)))

(define (invert x) (/ 1 x))

(define square base:sqr)
Expand All @@ -144,6 +146,7 @@
#:defaults
([number?
(define/generic super-= =)

(define = base:=)

(define (/= x y . zs) (not (apply = (list* x y zs))))]))
Expand Down

0 comments on commit e321e31

Please sign in to comment.