-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Execute function for core package #473
Conversation
能不能给我分享更多有趣的东西
|
@LingDong- It's done. I did a rough test for everything. Hope I didn't break them. For array output, I use function hanzinize(value) {
if (typeof value == "number") {
return num2hanzi(value);
} else if (typeof value == "boolean") {
return bool2hanzi(value);
} else if (Array.isArray(value)) {
return value.map(i => hanzinize(i)).join("。");
} else {
return value;
}
} |
Nice, thanks a lot! For nested structures, I had one idea is to use indentation so we don't introduce extra symbols. But then I did some experimentation on how I would use that to express various structures, and found it ambiguous & problematic. So symbols are probably the way to go. e.g.
My plan is to add this JSON.stringify-like functionality to the standard library 格物經. Discussion welcome! |
Sounds very promising! If we could port num2hanzi in Wenyan natively, then maybe we could have two different |
Execute function for core package
This resolves #469, resolves #471
Progress
evalCompiled
functionexecute
functioncompile
api changes with backward compatibly, Proposal for new compile API #471ide
site
outputHanzi
for CLIOuput Hanzi
for ideoutputHanzi
for runtime