Add encapsulation, sum types, type constraints and all the required machinery. Also -> threading macro #64

Merged
pkulev merged 40 commits from static-dispatch into main 2026-10-19 17:07:45 +02:00
Showing only changes of commit 958978efd3 - Show all commits

View File

@@ -191,8 +191,7 @@ forms, and what remains."
;; is the fmt-c directive for the `.' operator (see sex-fmt-c).
(('dot-access . rest) (cons '%. (map walk-expr rest)))
;; `%->' is the C arrow. Nothing writes it: it is what a member
;; path lowers to where the thing it reads from is a pointer, the
;; name `->' itself being the threading macro
;; path lowers to where the thing it reads from is a pointer
(('%-> . rest) (cons '%-> (map walk-expr rest)))
Review

Why C writer would know anything about what you do with the sex standard library? I suppose that mention should be rather deleted.

Why C writer would know anything about what you do with the sex standard library? I suppose that mention should be rather deleted.
Review

Well... Because it's a name clash with very well known and widely used bit of C syntax. So one might want to know why it's missing from Sex, while most of other semantics is accounted for.
However I don't have strong preference, might as well drop the comment.

Well... Because it's a name clash with very well known and widely used bit of C syntax. So one might want to know why it's missing from Sex, while most of other semantics is accounted for. However I don't have strong preference, might as well drop the comment.
(('var . _) (walk-var form))
;; An expression has no room for a statement, so a comment in a