Page 1 of 1

Bug for UTF-8 version about rotate string

Posted: Sat May 24, 2014 4:10 am
by ssqq

Code: Select all

(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

Re: Bug for UTF-8 version about rotate string

Posted: Sat May 24, 2014 4:56 am
by HPW
Hello,

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

But after a look in the doc:

Code: Select all

(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:

Code: Select all

(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

Re: Bug for UTF-8 version about rotate string

Posted: Sat May 24, 2014 6:53 am
by Lutz
Thanks for the bug report.

fixed here: http://www.newlisp.org/downloads/develo ... 10.6.1.tgz