Closed 11111000000 closed 9 years ago
There is now a let
keyword in ECMAscript, so perhaps the let
macro should compile to that. Otherwise, what would (let (a 1 b 2) (console.log a b))
compile to? I see several alternatives:
//this isn't very different from (scoped (var a 1 b 2) (console.log a b))
(function() {
var a = 1, b = 2;
console.log(a, b);
})();
// this is not particularly readable, but is concise
(function(a, b) {
console.log(a, b);
})(1, 2);
But in general, the strength of having such a flexible language defined in terms of macros is that it should be very easy for people to package up "flavors" of sibilant macros and publish them as npm packages. Without any change to sibilant, users could (import "let-macros")
and then have access to whatever redefined or extended macros you want.
@11111000000 Did this address your issue? Does anyone else have comments on this? I'm going to close this as stale if there's no additional feedback.
ok, thanks, think that answer is helpful
Imo
let
is more natural thanvar
concept.