Jump to content

Copy a string: Difference between revisions

Emacs Lisp: Actually show how to copy a string
(added Ol)
(Emacs Lisp: Actually show how to copy a string)
Line 951:
 
=={{header|Emacs Lisp}}==
 
<lang Lisp>
<lang Lisp>(setqlet* ((str1 "hi")
(setq str2 (str1-ref str1)
(str2 (copy-sequence str1)))
(eq str1 str2)</lang>
(eq str1 str1-ref) ;=> t
(eq str1 str2)</lang ;=> nil
(equal str1 str1-ref) ;=> t
(equal str1 str2)) ;=> t
</lang Lisp>
 
=={{header|Erlang}}==
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.