help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Is there any difference between `equal' and `string=' for strings?


From: Emanuel Berg
Subject: Re: Is there any difference between `equal' and `string=' for strings?
Date: Fri, 20 Aug 2021 08:41:28 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

>> (string= 'hi 'hi) -> t
>
> With symbols their "print names" are used, you can get that
> with
>
>   (symbol-name 'hi) ; "hi"

The reason for this, I think, is for example so one can do
a `defun' like this

  (defun do-something (method)
    (when (string= method "now")
      (message "I'm all over it") ))

Then one can do either

  (do-something "now")

or

  (do-something 'now)

-- 
underground experts united
https://dataswamp.org/~incal




reply via email to

[Prev in Thread] Current Thread [Next in Thread]