Is there a decent way to write a Parenscript class macro that outputs ES6 class definitions?
If the class definitions look like this:
class Person {
sayHello() {
alert('hello');
}
walk() {
alert('I am walking!');
}
}
class Student extends Person {
sayGoodBye() {
alert('goodBye');
}
sayHello() {
alert('hi, I am a student');
}
}
I want to write them somewhat like this in Parenscript:
(def-class -person ()
(say-hello () (alert "hello"))
(walk () (alert "I am walking!")))
(def-class -student (-person)
(say-good-bye () (alert "goodBye"))
(say-hello () (alert "hi, I am a student")))
I have tried a couple of approaches - attached as answers below - but neither of them is entirely satisfactory. Is there a better solution that does not involve re-engineering Parenscript?