[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: eval trouble
From: |
David Combs |
Subject: |
Re: eval trouble |
Date: |
Sun, 14 Sep 2008 20:57:39 +0000 (UTC) |
In article <mailman.17522.1219697977.18990.help-gnu-emacs@gnu.org>,
Lennart Borgman (gmail) <lennart.borgman@gmail.com> wrote:
>David Kastrup wrote:
>> "Lennart Borgman (gmail)" <lennart.borgman@gmail.com> writes:
>>
>>> Pascal J. Bourguignon wrote:
>>>> "Lennart Borgman (gmail)" <lennart.borgman@gmail.com> writes:
>>>>>> Here is the code that does NOT work:
>>>>>>
>>>>>> (defun mumamo-define-no-mode (mode-sym)
>>>>>> (let ((mumamo-repl4 (make-symbol (format "mumamo-repl4-%s" mode-sym)))
>>>>> It works if I replace make-symbol with intern. But why does eval care
>>>>> about that?
>>>> eval doesn't care, but how would you be able to refer again to the
>>>> defined thing if you don't have its name in some dictionary?
>>>
>>> Thanks. I see. I thought eval interned the symbol, or perhaps rather
>>> created an interned symbol. In this case it does not do that.
>>
>> Eval _does_ create an interned symbol. But it is not EQ to the unique
>> uninterned symbol that make-symbol creates.
>>
>
>I am a bit confused, but I guess you mean if the symbol does not exist:
>
>(let ((sym (make-symbol "xýzw")))
> (eval `(progn (setq ,sym 1)
> (put ',sym 'some 'value))))
>
>(mapatoms (lambda (atom)
> (when (string= (symbol-name atom)
> "xyzw")
> (error "Found %s" atom))))
>
>
>
Please, why the comma before sym -- quoted, no less:
> (put ',sym 'some 'value))))
Thanks!
David
- Re: eval trouble,
David Combs <=