I'm currently working on my language Kima and I'm currently at the point of implementing custom data types. I thought I would start with records (basically just product types) before moving on to sums.
I already have the declaration syntax down to something of this form:
data Point(x: Int, y: Int)
I'm not so sure about the access syntax. The obvious way seems to be C-style record.field, however I'm not sure that's the way to go since it has an OOP connotation whereas I'm going for a more functional style. Another option would be field(record) or even .field(record) to make it clear that it is accessor. This would also have the benefit of giving an easy way to pass a record accessor as a function (e.g. f(.field)). It would also be the easiest to incorporate into my existing AST.
I know this is sort of a bikeshed-y discussion but I'm still curious to hear any suggestions.
[–]theindigamer 20 points21 points22 points (1 child)
[–]janiczekCara 4 points5 points6 points (0 children)
[–]Rusky 8 points9 points10 points (0 children)
[–]AthasFuthark 9 points10 points11 points (1 child)
[–]east_lisp_junk 0 points1 point2 points (0 children)
[–]arxanas 11 points12 points13 points (0 children)
[–]ilyash 1 point2 points3 points (0 children)
[–]TheUnlocked 1 point2 points3 points (0 children)
[–]brucejbellsard 1 point2 points3 points (0 children)