Om du har problem med att få detta paket att fungera i WSL/WSL2 kan följande vara till hjälp:
sudo apt install libxext-dev libxi-dev libx11-dev
npm install
If you run the mce and declare a fucntion, when calling the function the passed argument gets transformed to a record. I believe the issue is on line 288. transform_application() maps
tagged_list_to_record forcing the transformation. Tried changing it to map incremental_transform. But now i got other errors trycing to call the factorial function
"throw new Error('head(xs) expects a pair as argument xs, but encountered ' + (0, stringify_1.stringify)(xs));"
"Error: head(xs) expects a pair as argument xs, but encountered undefined"
Leads to repetitive and harder to read code, just use an enum for this in the component and a switch statement.
Moreover, the identifiying functions are scattered all over the place, just have a module for ascertaining the type and then pipe the result into an enum to a module that acts on that result.
Evaluating something like:
if (true) { 1; } else { 0; }
Results in:
unknown syntax -- evaluate [ "conditional_statement",
[ ["literal", [true, null]],
[["literal", [1, null]], [["literal", [0, null]], null]]]]
Because it is tagged as a conditional_statement
instead of a conditional_expression
which the is_conditional()
function is searching for at line (115).
Talking about branch homework11.
This code is very bunched up in a single file, this allows every function to be in the scope of every other function which increases coupling and reduces maintainability.
In the outtagged line, line 329, there is a call for transform_component that should be transform_expression.
is_truthy, is_falsy?
Alternative: is_boolean_true
Inputting function test(bar) { const temp = bar; return temp; }
gives error:
Error: tail(xs) expects a pair as argument xs, but encountered "block"
Fix:
function transform_block(block: TaggedListBlock): Block {
return { tag: "block", body: map(transform_statement, list_ref(block, 0)) };
}
list_ref should not go to index zero as this returns string "block", instead:
function transform_block(block: TaggedListBlock): Block {
return { tag: "block", body: map(transform_statement, list_ref(block, 1)) };
}
When running the program, the history that is displayed from the 'user_read' function gets displayed as raw input with the '\n' still present:
"--- session start ---\nM-evaluate input:\nfunction factorial(n) {\n return n < 2 \n ? n \n : n * factorial(n - 1);\n}\nfactorial(5);\nM-evaluate value:\n120"
instead of the more readable output:
--- session start ---
M-evaluate input:
function factorial(n) {
return n < 2
? n
: n * factorial(n - 1);
}
factorial(5);
M-evaluate value:
120 ""
Although this does not fully fix the inpropper printing, one solution is to change in the user_read function to run:
display("", prompt_string);
instead of:
display(prompt_string);
There is still ' "" ' being printed but I haven't found a way to remove that.
If there is a way to remove that as well or an alternative solution is found, please get back to this issue.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.