Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

20231002 uncurry and typescript fixed #47

Merged
merged 3 commits into from
Oct 3, 2023

Conversation

prozacchiwawa
Copy link
Contributor

@prozacchiwawa prozacchiwawa commented Oct 3, 2023

Add a description of the IProgram and ITuple types which is what we're calling the Program and Tuple results. Fixed deficiencies in uncurry and added a cat2 program as an example and test.

Fixed reported warnings in typescript test code to see how the new type info functions. Most objects users hold will be IProgram objects which have a gamut of instance methods attached via proxies.

interface ITuple {
    to_program(): IProgram;
}

interface IProgram {
    toString(): string;
    as_pair(): ITuple;
    listp(): bool;
    nullp(): bool;
    as_int(): number;
    as_bigint(): bigint;
    as_bin(): [Uint8Array];
    first(): IProgram;
    rest(): IProgram;
    cons(p: IProgram): IProgram;
    run(code: IProgram, env: IProgram): [number, IProgram];
    list_len(): number;
    equal_to(other: IProgram): bool;
    as_javascript(): any;
    curry(args: [IProgram]): IProgram;
    sha256tree(): [Uint8Array];
    uncurry_error(): [IProgram];
    uncurry(): [IProgram, Array<IProgram>|null];

}

@prozacchiwawa prozacchiwawa merged commit 59f1505 into base Oct 3, 2023
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants