Bug for UTF-8 version about rotate string

For the Compleat Fan
Locked
ssqq
Posts: 88
Joined: Sun May 04, 2014 12:49 pm

Bug for UTF-8 version about rotate string

Post 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

HPW
Posts: 1390
Joined: Thu Sep 26, 2002 9:15 am
Location: Germany
Contact:

Re: Bug for UTF-8 version about rotate string

Post 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
Hans-Peter

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Re: Bug for UTF-8 version about rotate string

Post by Lutz »

Thanks for the bug report.

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

Locked