Giter VIP home page Giter VIP logo

hilbert.js's People

Contributors

bovine3dom avatar dependabot[bot] avatar kairacat avatar mend-for-github-com[bot] avatar pjhenning avatar plegner avatar renovate-bot avatar renovate[bot] avatar skim-amplify avatar swarty avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

hilbert.js's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Awaiting Schedule

These updates are awaiting their schedule. Click on a checkbox to get an update now.

  • Update dependency tslib to v2.6.2
  • Update Test and Build (@typescript-eslint/eslint-plugin, @typescript-eslint/parser, esbuild, eslint, eslint-plugin-import)

Detected dependencies

github-actions
.github/workflows/codeql.yml
  • actions/checkout v3
  • github/codeql-action v2
  • github/codeql-action v2
.github/workflows/test.yml
  • actions/checkout v3
  • actions/setup-node v3
  • bahmutov/npm-install v1
npm
package.json
  • @mathigon/core 1.1.10
  • @mathigon/fermat 1.1.9
  • @types/tape 5.6.0
  • @typescript-eslint/eslint-plugin 6.2.1
  • @typescript-eslint/parser 6.2.1
  • esbuild 0.18.17
  • eslint 8.46.0
  • eslint-plugin-import 2.28.0
  • tape 5.6.6
  • ts-node 10.9.1
  • tslib 2.6.1
  • typescript 5.1.6
  • node >=14

  • Check this box to trigger a request for Renovate to run again on this repository

Unary minus can't follow other operators

The unary minus operator can't be used after other operators!
Each of these examples throws a SyntaxError during the call to collapse:

Expression.parse("1 * -1").collapse(); // SyntaxError: This expression is invalid.
Expression.parse("1 + -1").collapse(); // SyntaxError: A “+” cannot be followed by a “−”.
Expression.parse("x = -1").collapse(); // SyntaxError: A “=” cannot be followed by a “−”.

The first example being different might be because of special behaviour for implicit multiplication?

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Awaiting Schedule

These updates are awaiting their schedule. Click on a checkbox to get an update now.

  • Update Dev Dependencies (esbuild, eslint, tape)
  • Update actions/setup-node action to v4
  • Update github/codeql-action action to v3
  • Update typescript-eslint monorepo to v7 (major) (@typescript-eslint/eslint-plugin, @typescript-eslint/parser)

Detected dependencies

github-actions
.github/workflows/codeql.yml
  • actions/checkout v4
  • github/codeql-action v2
  • github/codeql-action v2
.github/workflows/test.yml
  • actions/checkout v4
  • actions/setup-node v3
  • bahmutov/npm-install v1
npm
package.json
  • @mathigon/core 1.1.16
  • @mathigon/fermat 1.1.15
  • @types/tape 5.6.4
  • @typescript-eslint/eslint-plugin 6.21.0
  • @typescript-eslint/parser 6.21.0
  • esbuild 0.20.0
  • eslint 8.56.0
  • eslint-plugin-import 2.29.1
  • tape 5.7.4
  • ts-node 10.9.2
  • tslib 2.6.2
  • typescript 5.3.3
  • node >=16

af(...) should be interpreted as a*f*(...) if a, f are variables

Hi, I'm trying to chase down what I regard as a bug - please forgive me if this isn't the right repository.

On the Mathigon circles course, the surface area of a cylinder rejects the solution 2πr(r+h). hilbert.js interprets this as a function:

> hilbert.Expression.parse("2πr(r+h)")
ExprTerm {
  items: [ ExprNumber { n: 2 }, ExprFunction { fn: 'πr', args: [Array] } ]
}

which I think is totally reasonable without any context. What I'd suggest is that once you are aware of the context, if fn isn't a valid function, you fall back to trying to parse it as identifiers times the ( "function". I think the right place to do that is here

https://github.com/mathigon/boost.js/blob/aa980832146a48978f57e047258911a096122915/src/eval.ts#L438

but I'm not sure :)

Suggested failing test:

  test.equal(compile('r(a)')({r: 2, a: 2}), 4); // Fails - returns undefined

One thing I haven't been able to track down so far is how 2rh gets turned into 2*r*h - compile gives me

> compile('2rh')
/home/olie/projects/boost.js/src/eval.ts:72
        throw new Error(`${message} at character ${index} of "${expr}"`);
        ^

Uncaught Error: Variable names cannot start with a number (2r) at character 1 of "2rh"

but this does currently work in Mathigon. Wherever that happens might be the place to handle function composition if you felt like a challenge (probably: check if whole word is a function, if not, from right to left, compose functions if each character is a function; if it isn't, switch to parsing as identifiers from then).


PS: Mathigon is very cool :)

Action Required: Fix Renovate Configuration

There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.

Error type: undefined. Note: this is a nested preset so please contact the preset author if you are unable to fix it yourself.

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.