Tristan Brice Velloza Kildaire on Nostr: There are some cases where I use many interfaces (in fact a lot) but a lot of the AST ...
There are some cases where I use many interfaces (in fact a lot) but a lot of the AST is sub-typing (or sub-classing) as it naturally makes sense.
A BinaryOperstor has a LHS and RHS of type Expression. BinaryOperstor itself is a kind-of Expression. Hence it can nest itself with (1*1)+(2*1).
Examples like those are prevalent through TBS syntax of T (and all languages) and hence implementation wise it just made sense to model it using OOP like that.
Open to suggestions and critique!
Published at
2024-04-09 20:59:19Event JSON
{
"id": "b5705639f949bcf2e0338d9cf83e17c8ac9cc486fabbb5d53041ff84f7d4ebc6",
"pubkey": "d6149823c90c4865e4bc434a4be1a1ee8f72aabd8328dd059ba4f11f7633b0b6",
"created_at": 1712696359,
"kind": 1,
"tags": [
[
"e",
"6f83f5623b435e6da8876de40ac53fe68be2fba158f1b5af40c173564adbc673",
"",
"root"
],
[
"e",
"71dcd4e822ea96e1028a92f3e124e34a3f47cedad6d142babc8aff4317520551"
],
[
"e",
"93949ff1678717b3cf684a9fcacdf63a85c27f8e89b42e7043bd76a9442b447d",
"",
"reply"
],
[
"p",
"d6149823c90c4865e4bc434a4be1a1ee8f72aabd8328dd059ba4f11f7633b0b6"
],
[
"p",
"4c800257a588a82849d049817c2bdaad984b25a45ad9f6dad66e47d3b47e3b2f"
]
],
"content": "There are some cases where I use many interfaces (in fact a lot) but a lot of the AST is sub-typing (or sub-classing) as it naturally makes sense.\n\nA BinaryOperstor has a LHS and RHS of type Expression. BinaryOperstor itself is a kind-of Expression. Hence it can nest itself with (1*1)+(2*1).\n\nExamples like those are prevalent through TBS syntax of T (and all languages) and hence implementation wise it just made sense to model it using OOP like that.\n\nOpen to suggestions and critique!",
"sig": "2df76bf82a41d91acf0591b5d89e9bd93e91f4a517e0f6754e38fd2ec8712652e86bddd9dd143d36ca2744def33dd33951a8a63e165e8a49e89a5d35cf2672d6"
}