Re: What is the difference between set and setq?

2016-12-30 Thread Bruno Franco
> This might be a nice thing to add to the documentation too, > since the function definitions don't mention it. Sorry, I was completely wrong. The definition of set and setq Do mention whether the first argument is evaluated or not. I just didn't notice the quote in the form of the general

Re: What is the difference between set and setq?

2016-12-28 Thread Bruno Franco
>The same meaning of "eq" (or "quick") have functions like 'delete' / 'delq', >'assoc' / 'asoq', 'case' / 'casq' or 'push1' / 'push1q'. Thank you Alex, that was exactly my next question. On Tue, Dec 27, 2016 at 9:20 AM, Erik Gustafson wrote: > It is the *function*

Re: What is the difference between set and setq?

2016-12-27 Thread Erik Gustafson
It is the *function* call overhead, which is relatively expensive. [...] Thanks Alex, this is great. I'll add to the wiki article later today.

Re: What is the difference between set and setq?

2016-12-27 Thread Alexander Burger
On Tue, Dec 27, 2016 at 08:49:10AM +0100, Alexander Burger wrote: > > > On Mon, Dec 26, 2016 at 10:25 PM, Erik Gustafson < > Thanks Erik for the great explanation and the article! I feel I should also mention that the purpose of (setq A 'value) versus (set 'A 'value) is not at all to

Re: What is the difference between set and setq?

2016-12-26 Thread Alexander Burger
> > On Mon, Dec 26, 2016 at 10:25 PM, Erik Gustafson < Thanks Erik for the great explanation and the article! On Mon, Dec 26, 2016 at 11:37:36PM -0500, Bruno Franco wrote: > This might be a nice thing to add to the documentation too, since the > function definitions don't mention it. > difference

Re: What is the difference between set and setq?

2016-12-26 Thread Bruno Franco
This might be a nice thing to add to the documentation too, since the function definitions don't mention it. Maybe something like: "Its only difference with set is that setq does not evaluate its first argument" On Mon, Dec 26, 2016 at 11:26 PM, Bruno Franco wrote:

Re: What is the difference between set and setq?

2016-12-26 Thread Bruno Franco
Thank you so much Erik! I especially like that you said WHY setq is named like that. Its been bugging me for weeks! On Mon, Dec 26, 2016 at 10:25 PM, Erik Gustafson wrote: > Hahaha I read your post quickly and then wrote a possibly overkill answer. > > I deduce that

Re: What is the difference between set and setq?

2016-12-26 Thread Erik Gustafson
Hahaha I read your post quickly and then wrote a possibly overkill answer. I deduce that setq doesn't evaluate its first argument, while set does. Why > is that? > You've totally got it! So the short answer is flexibility vs convience, nothing deeper than that ;) Cheers!

Re: What is the difference between set and setq?

2016-12-26 Thread Erik Gustafson
Have a look at this article: http://picolisp.com/wiki/?evalvsnoneval Basically, the only difference is that 'set' evaluates its first argument, while 'setq' does not. In your example, (set B 1) 'B' is evaluated (and returns NIL because the symbol 'B' has not yet been given a value). 'set'