71104 / lambda

The Lambda Programming Language
MIT License
19 stars 2 forks source link

More problems with `let` #100

Open 71104 opened 8 years ago

71104 commented 8 years ago
let console.log.lol = 0 in console.log 5  # prints "undefined" instead of "5"
let console.log.lol = 0 in console.log.lol  # runtime error
71104 commented 8 years ago

The second one happens because there's a marshal round-trip for the log function and "expandos" don't get marshalled towards the native side. That is, when the expanded log closure is marshalled to a native function, the native function doesn't have the extra "lol" property.

71104 commented 8 years ago

As of 6b61305dd7c812b83f0c56be355c0676d85e6a02, the second one is gone and the problem with the first one is that after the expansion console.log's character becomes undefined.