[Top][All Lists]

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

Re: Mis-features of let

From: Stefan Monnier
Subject: Re: Mis-features of let
Date: Tue, 19 Apr 2005 00:31:40 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

>> Another way is to post here an example of a specific behavior which
>> you find counter intuitive (basically write a bug report, but asking
>> why it works that way, rather than claiming it's a bug ;-).

> I didn't say it *was* a bug, but "a bug waiting to happen".  Perhaps

I didn't mean to imply that you claimed it was a bug.

> thats an idiom you're not familiar with.  Sorry.  But my other
> statement should have made it clear I wasn't claiming it was a bug:

It was indeed quite clear and I understood it just fine, thank you.

> So your saying "no mention in any Elisp manual section that covers
> plists or symbol function cells about this behavior" isn't specific
> enough?

Indeed, because I have no clue what "this behavior" is.

> I'm sure your not implying I should have actually listed every section
> that refers to either of these subjects so I can't tell what more you
> expected me to cite.

No, it wouldn't have helped.

> I also expressed "The `feature' is only _implied_, not documented."
> IOW, no place (as in anywhere in the user or reference manual) do I
> find a warning or even a passing mention that a symbol, created by let
> or let* is handled differently from a symbol created through set,
> fset, any of the def... forms, intern, etc.

Show us in what way they are treated differently.  I.e. show us some elisp
code and the result(s) returned and then tell us what result you expected
instead and why.

> From what you've said (and experiments point to you being correct), no
> one should ever use put, fset, setplist etc on any symbol whose origin
> might be let or let*

No, that's not what I said.  Simply (fset <sym> <val>) has no interaction
with things like (set <sym> <val>) or (let ((<sym> <val>)) ...) and
vice versa.

> since the resulting behavior would apparently be
> undefined (as evidenced by the example in my previous post).

I see no such evidence.  Can you explain what other behavior you expected?

> Hence, a bug waiting to happen.

Think of it this way: in elisp a symbol is an object in memory with the
following 4 fields:

   name, function, value, plist

`fset' affects the `function' field, while `set' and `let' affect the
`value' field of a symbol.

A "variable" is a more abstract concept, corresponding more or less to
a location in memory holding a value.  E.g. in elisp the `value' field of
a symbol is used as a "variable".


reply via email to

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