-
Notifications
You must be signed in to change notification settings - Fork 50
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
copy-tree does not copy float-vector #475
Comments
The implementation explicitly returns the non-cloned value when the argument is not a list, so this doesn't seem like some sort of upredicted side effect (i.e. designed for lists but that "accidentally" could handle other sequence types). I am not sure if we should solve this by changing the implementation to also copy non-lists; add a warning; or just add more specific jmanual documentation. However, this is very similar to #361 , which promises destructive results but only delivers that on some cases. |
I think it is better to keep old behavior for keep backward compatibility, but we can warn the misusage or non-copied behavior. |
(just for future reference I would like to add that in this case irteusgl> (setq a (float-vector 1 2 3))
#f(1.0 2.0 3.0)
irteusgl> (setq b (copy-seq a))
#f(1.0 2.0 3.0)
irteusgl> (setf (elt b 0) 5)
5
irteusgl> a
#f(1.0 2.0 3.0)
irteusgl> b
#f(5.0 2.0 3.0)
irteusgl> (sys:address a)
94797007551080
irteusgl> (sys:address b)
94797007912976 EDIT: or |
|
I know
copy-tree
is forlist
, butcopy-tree
returns no error withfloat-vector
and does not copy the vector.It is better to warn
copy-tree
with float-vector.The text was updated successfully, but these errors were encountered: