When I test *repace* in ubuntu 14.04, I found following test would fail:
(set 'str "---axb--ayb---")
(replace "(a)(.)(b)" str (append $3 $3 $1) 0)
(= str "---bxa---bya---")
function *replace* could not catch $0, $1 in Ubuntu 14.04
Re: function *replace* could not catch $0, $1 in Ubuntu 14.0
Look at your code again. You probably mean:
Code: Select all
>
(set 'str "---axb--ayb---")
(replace "(a)(.)(b)" str (append $3 $2 $1) 0)
(= str "---bxa--bya---")
"---axb--ayb---"
"---bxa--bya---"
true
>
Re: function *replace* could not catch $0, $1 in Ubuntu 14.0
yes, I write error code.
I found the int-option in replace is could not ignore like *regex*. if ignore the int-option, newLISP would make "find-str" as *literal str*, if add int-option, newLISP would treat *find-str* as *regex-str".
(replace "(a)" "aabb" "c")
=> "aabb"
> (replace "(a)" "aabb" "c" 0)
=> "ccbb"
I found the int-option in replace is could not ignore like *regex*. if ignore the int-option, newLISP would make "find-str" as *literal str*, if add int-option, newLISP would treat *find-str* as *regex-str".
(replace "(a)" "aabb" "c")
=> "aabb"
> (replace "(a)" "aabb" "c" 0)
=> "ccbb"