-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
native: Add for ABCL, CCL, Clasp, CMUCL, ECL, and SBCL
- Loading branch information
Showing
4 changed files
with
51 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
(in-package #:quaviver/native) | ||
|
||
(defclass client () ()) | ||
|
||
#+(or abcl ccl clasp cmucl ecl sbcl) | ||
(defmethod quaviver:float-decimal ((client client) value) | ||
#+abcl | ||
(multiple-value-bind (digits digits-length leading-point | ||
trailing-point position) | ||
(system::flonum-to-string (abs value)) | ||
(declare (ignore leading-point trailing-point)) | ||
(values (remove nil (map 'vector #'digit-char-p digits)) | ||
(- position digits-length -1) | ||
(floor (float-sign value)))) | ||
#+ccl | ||
(multiple-value-bind (digits sign exponent) | ||
(ccl::flonum-to-string value) | ||
(values (map 'vector #'digit-char-p digits) | ||
exponent | ||
sign)) | ||
#+(or clasp cmucl ecl sbcl) | ||
(multiple-value-bind (position digits) | ||
#+clasp (core::float-to-digits nil value nil nil) | ||
#+cmucl (lisp::flonum-to-digits value) | ||
#+ecl (si::float-to-digits nil value nil nil) | ||
#+sbcl (sb-impl::flonum-to-digits value) | ||
(values (map 'vector #'digit-char-p digits) | ||
(- position (length digits)) | ||
(floor (float-sign value))))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
(cl:defpackage #:quaviver/native | ||
(:use #:common-lisp) | ||
(:export #:client)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters