Re: Avoiding variable clashes

2011-04-14 Thread Andy Wingo
On Thu 14 Apr 2011 03:08, Noah Lavine noah.b.lav...@gmail.com writes: The fact that we represent different variables as gensyms is an implementation detail, and unimportant. (In fact, I might like to change that detail at some point to get better error messages, but it's not high on my to-do

Re: Avoiding variable clashes

2011-04-14 Thread Hans Aberg
On 14 Apr 2011, at 03:08, Noah Lavine wrote: The beta rule is in denotational semantics something like ((lambda x . E_1) E_2) = [E_2/x]E_1, E_2 free for x in in E_1 where [E_2/x]E_1 means substituting all free occurrences of x with E_2. In addition, one has the alpha rule (lambda x . E)

Re: Avoiding variable clashes

2011-04-14 Thread Noah Lavine
The fact that we represent different variables as gensyms is an implementation detail, and unimportant. (In fact, I might like to change that detail at some point to get better error messages, but it's not high on my to-do list.) What are you referring to here? It's just part of my mental

Re: Avoiding variable clashes

2011-04-14 Thread Andy Wingo
On Thu 14 Apr 2011 15:13, Noah Lavine noah.b.lav...@gmail.com writes: We [assign] a unique gensym to each variable object, I think, but you could assign a unique anything to each variable object and it would work just as well. Is that an accurate picture of how Guile works? Yes, for lexical

Avoiding variable clashes

2011-04-13 Thread Hans Aberg
What method is Guile using to avoid substitution variable clashes (de Bruijn numbers, combinators, etc.)? Hans

Re: Avoiding variable clashes

2011-04-13 Thread Hans Aberg
On 13 Apr 2011, at 16:19, Andy Wingo wrote: What method is Guile using to avoid substitution variable clashes (de Bruijn numbers, combinators, etc.)? Each lexical variable is given a fresh name (a gensym) when it is introduced. The expander keeps an environment as to what name maps to

Re: Avoiding variable clashes

2011-04-13 Thread Andy Wingo
On Wed 13 Apr 2011 16:34, Hans Aberg haber...@telia.com writes: On 13 Apr 2011, at 16:19, Andy Wingo wrote: What method is Guile using to avoid substitution variable clashes (de Bruijn numbers, combinators, etc.)? Each lexical variable is given a fresh name (a gensym) when it is

Re: Avoiding variable clashes

2011-04-13 Thread Hans Aberg
On 13 Apr 2011, at 17:27, Andy Wingo wrote: What method is Guile using to avoid substitution variable clashes (de Bruijn numbers, combinators, etc.)? Each lexical variable is given a fresh name (a gensym) when it is introduced. The expander keeps an environment as to what name maps to

Re: Avoiding variable clashes

2011-04-13 Thread Noah Lavine
I think that mechanism is all that Guile uses at present. However, it should be general enough to resolve all situations where variables of the same name refer to different entities, assuming you set up the environments correctly. Are you planning on implementing a theorem prover for Guile? That

Re: Avoiding variable clashes

2011-04-13 Thread Hans Aberg
On 13 Apr 2011, at 18:25, Noah Lavine wrote: I think that mechanism is all that Guile uses at present. However, it should be general enough to resolve all situations where variables of the same name refer to different entities, assuming you set up the environments correctly. Are you

Re: Avoiding variable clashes

2011-04-13 Thread Hans Aberg
On 13 Apr 2011, at 18:25, Andy Wingo wrote: Sorry, I don't know what you mean. References? There is an article here: http://en.wikipedia.org/wiki/Variable_binding_operator I still don't understand. What are you trying to do? The beta rule is in denotational semantics something like