Bug for UTF-8 version about rotate string

Started by ssqq, May 23, 2014, 09:10:14 PM

Previous topic - Next topic

ssqq

(rotate (copy "string"))
=> ?

(rotate "string") => "gstrin" ;; it is ok
(copy "string") => "string" ; it is ok too


version: newLISP v.10.6.0 32-bit on Win32 IPv4/6 UTF-8 libffi,

Platform: Winxp sp3

HPW

#1
Hello,



Rotate is a destructive function, so would need a Symbol to Change.



But after a look in the doc:



(set 'str "newLISP") → "newLISP"
(rotate (copy str)) → "PnewLIS"


This sample does not work as documented.



(rotate (copy str)) → "?"



So this is not true: With copy their behavior can be made non-destructive.



Bug?



Or:

(set 'str "newLISP")
(rotate (setq str2(copy str)))


Edit: I tested on non-UTF8

newLISP v.10.6.0 32-bit on Win32 IPv4/6 libffi, options: newlisp -h





Regards
Hans-Peter

Lutz

#2
Thanks for the bug report.



fixed here: http://www.newlisp.org/downloads/development/inprogress/newlisp-10.6.1.tgz">http://www.newlisp.org/downloads/develo ... 10.6.1.tgz">http://www.newlisp.org/downloads/development/inprogress/newlisp-10.6.1.tgz