Skip to content
This repository was archived by the owner on Apr 3, 2025. It is now read-only.
This repository was archived by the owner on Apr 3, 2025. It is now read-only.

Would this enable unit conversions? #11

@samuelgoto

Description

@samuelgoto

By reading the text, it would seem like it would, but wanted to sanity check:

let a = 1_cm;
let b = 1_m;
console.log(`${a.plus(b)} meters`);
// prints 1.01_m

I'm assuming that by the virtue of these things being extensible through the definition of

function _cm() {
  // do some magical thing in user land
}
function _m() {
  // do other magical things in user land
}

Is that a correct interpretation of this feature?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions