Giter VIP home page Giter VIP logo

mce-typed's Introduction

mce-typed

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

mce-typed's People

Contributors

tobiaswrigstad avatar johannesborgstrom avatar

Watchers

Kostis Sagonas avatar  avatar Eva Darulova avatar  avatar

mce-typed's Issues

bug in incremental_transform

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"

Unnecessary overuse of ternary operator

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.

BUG: if (test) {consequent} else {alternate} is not recognised as a conditional expression.

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.

Non-modularized code

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.

Name spaces

is_truthy, is_falsy?
Alternative: is_boolean_true

bug in transform_block, solved

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)) };
}

inpropper printing to the screen in driver-loop

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.