Skip to content

basilisp.math namespace #681

Open
Open
@chrisrink10

Description

@chrisrink10

We should add a basilisp.math namespace which passes through the Python math library functions in the same way as Clojure's 1.11 clojure.math (code).

Split out from #672 and #662

Get the symbols in Clojure:

(require '[clojure.math :as math])
(sort (keys (ns-publics 'clojure.math)))

In Basilisp:

(import math)
(require '[basilisp.set :as set])
(def clj-math (set ...))  ;; copy the value from above
(def lpy-math (into #{} (comp (remove #(.startswith % "__")) (map #(.replace % "_" "-")) (map symbol)) (python/dir math)))
(def shared-math (set/intersection (set clj-math) (set lpy-math)))
(def clj-only (set/difference (set clj-math) (set lpy-math)))
(def lpy-only (set/difference (set lpy-math) (set clj-math)))

Note that several functions just have different names, but likely the same functionality.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    To do

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions