[fine] Design notes, more garbage

This commit is contained in:
John Doty 2024-01-25 22:09:44 -08:00
parent 19e57db724
commit e66ffbb5ae

View file

@ -39,3 +39,28 @@ The `new` keyword is a compromise: we know that the context
immediately following the `new` keyword is always a type expression,
so we know that e.g. `<` or whatever means "generic type parameter"
and not "less than".
## Lambdas/Closures/Anonymous Functions
Looking for a syntax here; I want to keep `fun` as a declaration like
`let` and not let it enter the expression space. I don't like
fat-arrow syntax because it makes expression parsing very ambiguous,
potentially requiring a lot of lookahead. (TODO: Is that true?)
Maybe a leading character like ` \x => x+1 ` or ` \(x,y) => x+y `?
## Interfaces/Traits/Whatever
These are incomplete structural types. Methods are easier to make
compatible than members, but members should also work so long as they
are strict prefixes of the thing.
What about sound casting with narrowing? That's union types baby, do
we really want those? It could be neat if we're doing otherwise
structural-compatibility.
## On Objects and Classes
Sometimes I think it should all be structural types.
Maybe later there can be anonymous types that match shapes.