We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
This is code that use iteration protocol.
(let ((obj (object)) (max 10)) (set-obj! obj Symbol.iterator (lambda () (let ((i 0)) (object :next (lambda () (set! i (+ i 1)) (if (> i max) `&(:done #t) `&(:done #f :value ,(/ 1 i)))))))) (print (iterator->array obj)) (print (Array.from (iterator->array obj))))
The problem is that the output array/vector contain JavaScript float numbers instead of LIPS rational numbers.
#(1 0.5 0.3333333333333333 0.25 0.2 0.16666666666666666 0.14285714285714285 0.125 0.1111111111111111 0.1)
It seems that the problem is array::push that unbox the value:
(let ((x (vector))) (x.push 1/2) x) ;; ==> #(0.5)
The text was updated successfully, but these errors were encountered:
fix unintentional unboxing in iterator->array #328
iterator->array
72bfd20
add unit test #328
7ac3ef6
No branches or pull requests
This is code that use iteration protocol.
The problem is that the output array/vector contain JavaScript float numbers instead of LIPS rational numbers.
It seems that the problem is array::push that unbox the value:
The text was updated successfully, but these errors were encountered: