Giter Club home page Giter Club logo

Comments (1)

Leedehai avatar Leedehai commented on June 12, 2024

Hi, thanks for your feedback!

When I was implementing the function I thought about the single-argument form, but decided to not add it because it could create confusion: if pdv(x) displays diff / (diff x), then what should pdv(x, t) be: (diff x) / (diff t) or diff / (diff x diff t)?

Unlike Latex, Typst doesn't provide a special syntax for optional args like func[optional]{args} so we could write pdv{x} and pdv[f]{x} to differentiate diff / (diff x) and (diff f) / (diff x). Certainly, we could adopt a special rule along the line of "if there's only one argument, treat it as the variable name and leave the function name empty; if there are multiple arguments, treat the first as the function name and the rest as variable names", but I'd prefer not to carve out an ad-hoc special rule. Also (though a minor point), one could say, "I'd rather adopt the special rule that treats the single argument as the function name, and the variable name shall be x by default, because this is quite common".

That said, I do recognize the necessity to write the operator form (i.e. without a function name), so you may simply omit the function name (as shown in the manual pdf), which is more explicit in the intention:
Screenshot 2023-05-02 at 11 18 18

from typst-physics.

Related Issues (15)

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.