basic functionality, no generics

This commit is contained in:
Joeri Exelmans 2025-03-14 16:56:37 +01:00
commit a8260f2afb
17 changed files with 615 additions and 0 deletions

30
lib/literals.js Normal file
View file

@ -0,0 +1,30 @@
import {Int, Bool, Double} from "../primitives/symbols.js";
import { getListType, makeListModule } from "../structures/list_common.js";
const ListOfBool = getListType(Bool);
const ListOfBoolModule = makeListModule(Bool);
const ListOfInt = getListType(Int);
const ListOfIntModule = makeListModule(Int);
const ListOfListOfInt = getListType(ListOfInt);
const ListOfListOfIntModule = makeListModule(ListOfInt);
export const ModuleLiterals = [
{i: 0n, t: Int},
{i: 42n, t: Int},
{i: false, t: Bool},
{i: 3.14159265359, t: Double},
{i: {l:[42n, 43n]}, t: ListOfInt},
// {i: [[42n, 43n]], t: ListOfListOfInt},
// i'm lazy
...ListOfIntModule,
// ...ListOfBoolModule,
// ...ListOfListOfIntModule,
];