ravikumar10 / genyris

Automatically exported from code.google.com/p/genyris
Other
0 stars 0 forks source link

.source returns a lambadq for macros #54

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.> defvar ^w 23
:
23 # Bignum
2.> defmacro zz(w) ^w
:
<LazyProcedure: <zz>> # LazyProcedure
> zz 99
:
23 # Bignum
> use zz .source
:
3.
What do you see?
(lambdaq (w) (quote w)) # Pair 

What is the expected output?
(lambdam (w) (quote w)) # Pair 

It computes the correct results, but I am surprised I thought defmacro would 
use lambdam. How does LazyProcedure know to re-evaluate in the caller 
environment, perhaps the class is printing the wrong name? Did lambdam get 
retired? No because:
> (lambdam (w) ^w) 99
:
23 # Bignum
> (lambdaq (w) ^w) 99
:
w # SimpleSymbol

Maybe its just the ,source function is putting the wrong symbol in...
> defmacro z
:
<LazyProcedure: <z>> # LazyProcedure
> use z .source
:
(lambdaq) # Pair

I smell a wumpus.

Original issue reported on code.google.com by birchb1...@gmail.com on 23 Apr 2013 at 8:01

GoogleCodeExporter commented 9 years ago
Yep. Wumpus. Fixed in 0.6.12-5-g5064e5a.

Original comment by birchb1...@gmail.com on 23 Apr 2013 at 11:32

GoogleCodeExporter commented 9 years ago

Original comment by birchb1...@gmail.com on 23 Apr 2013 at 11:33