Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

math:ilog loops forever in coalton form for most bases #964

Closed
macrologist opened this issue Jul 10, 2023 · 0 comments · Fixed by #965
Closed

math:ilog loops forever in coalton form for most bases #964

macrologist opened this issue Jul 10, 2023 · 0 comments · Fixed by #965

Comments

@macrologist
Copy link
Collaborator

Consider


(defpackage #:bad-ilog
  (:import-from
   #:common-lisp
   #:describe
   #:disassemble)
  (:use #:coalton #:coalton-prelude)
  (:local-nicknames
   (#:math #:coalton-library/math))
  (:export))

(named-readtables:in-readtable coalton:coalton)

(in-package #:bad-ilog)

(coalton-toplevel

  (define (ilog10 x)
    (math:ilog 10 x))

  (define (ilog3 x)
    (math:ilog 3 x))

  (define (ilog2 x)
    (math:ilog 2 x)))

Calling each function works as expected, however, calling math:ilog in a coalton form will hang forever, except when the base is 2.

BAD-ILOG> (coalton (ilog10 (the Ufix 1001)))
3
BAD-ILOG> (coalton (ilog10 (the Ufix 100)))
2
BAD-ILOG> (coalton (math:ilog 10 100))
; Evaluation aborted on COMMON-LISP:NIL.
BAD-ILOG> (coalton (math:ilog 2 100))
6
eliaslfox added a commit that referenced this issue Jul 10, 2023
Remove an invalid recursive specialization.

Fixes #964
@eliaslfox eliaslfox mentioned this issue Jul 10, 2023
eliaslfox added a commit that referenced this issue Jul 10, 2023
Remove an invalid recursive specialization.

Fixes #964
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant